{
  "openapi": "3.1.0",
  "info": {
    "title": "Estactics API",
    "version": "1.0.0",
    "description": "Manage your Estactics clients, properties and team data from your own systems."
  },
  "servers": [
    {
      "url": "http://localhost:4000/api",
      "description": "Estactics API"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "API keys",
      "description": "Manage API keys from code."
    },
    {
      "name": "Activities",
      "description": "The timeline of notes and events on each client."
    },
    {
      "name": "Brands",
      "description": "The brands your organization operates under."
    },
    {
      "name": "Calendar events",
      "description": "Meetings, viewings and follow-ups."
    },
    {
      "name": "Client settings",
      "description": "How your organization handles new and returning clients."
    },
    {
      "name": "Clients",
      "description": "The people in your CRM: leads, prospects and customers."
    },
    {
      "name": "Contacts",
      "description": "Your address book of suppliers and partners."
    },
    {
      "name": "Dashboards",
      "description": "Ready-made reports on your clients and team."
    },
    {
      "name": "Developers",
      "description": "The property developers you work with."
    },
    {
      "name": "Email senders",
      "description": "The addresses your emails are sent from."
    },
    {
      "name": "Email templates",
      "description": "The emails your organization sends."
    },
    {
      "name": "Emails",
      "description": "A log of the emails sent from your organization."
    },
    {
      "name": "External agents",
      "description": "Agents outside your organization who bring you properties."
    },
    {
      "name": "Labels",
      "description": "Tags you can put on clients."
    },
    {
      "name": "Lead registrations",
      "description": "Each time a client signs up through a campaign."
    },
    {
      "name": "Marketing campaigns",
      "description": "The campaigns your leads come from."
    },
    {
      "name": "Organization",
      "description": "Your company account."
    },
    {
      "name": "Properties",
      "description": "The homes, plots and commercial units you list."
    },
    {
      "name": "Roles",
      "description": "What each person on your team is allowed to do."
    },
    {
      "name": "Stages",
      "description": "The steps of your sales pipeline."
    },
    {
      "name": "Teams",
      "description": "The team structure of your organization, called hierarchies in the API."
    },
    {
      "name": "Users",
      "description": "The people on your team."
    }
  ],
  "paths": {
    "/apiTokens/getUserApiTokens": {
      "get": {
        "operationId": "apiTokens_getUserApiTokens",
        "tags": [
          "API keys"
        ],
        "summary": "List API keys",
        "description": "Returns your API keys. The secret part is never returned.",
        "x-required-permission": "apiTokens.MANAGE",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 8,
                      "name": "Website",
                      "maskedRawToken": "atsec_...abcd",
                      "expiredAt": null,
                      "lastUsedAt": null,
                      "disabled": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/apiTokens/createUserApiToken": {
      "post": {
        "operationId": "apiTokens_createUserApiToken",
        "tags": [
          "API keys"
        ],
        "summary": "Create an API key",
        "description": "Creates an API key with no permissions. You can have up to 5.",
        "x-required-permission": "apiTokens.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "A name that reminds you what the key is for."
                  },
                  "duration": {
                    "type": "string",
                    "enum": [
                      "s",
                      "m",
                      "h",
                      "d",
                      "M",
                      "Y"
                    ],
                    "description": "Unit of time for the expiry. Leave out for a key that does not expire."
                  },
                  "amount": {
                    "type": "integer",
                    "description": "How many units until the key expires."
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "Website",
                "duration": "M",
                "amount": 6
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "userId": {
                          "type": "integer"
                        },
                        "token": {
                          "type": "string",
                          "description": "The API key. It is shown only this once."
                        },
                        "expiredAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "When the key expires."
                        }
                      },
                      "required": [
                        "id",
                        "token"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 8,
                    "userId": 18,
                    "token": "atsec_your_new_key",
                    "expiredAt": null
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/apiTokens/updateUserApiToken": {
      "post": {
        "operationId": "apiTokens_updateUserApiToken",
        "tags": [
          "API keys"
        ],
        "summary": "Update an API key",
        "description": "Changes the name or permissions of a key. You can only give permissions you have yourself.",
        "x-required-permission": "apiTokens.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the key."
                  },
                  "name": {
                    "type": "string"
                  },
                  "permissions": {
                    "type": "object",
                    "description": "What the key is allowed to do."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 8,
                "name": "Main website"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 8
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/apiTokens/getTokenPermissions": {
      "post": {
        "operationId": "apiTokens_getTokenPermissions",
        "tags": [
          "API keys"
        ],
        "summary": "Get API key permissions",
        "description": "Returns the permissions of one of your keys.",
        "x-required-permission": "apiTokens.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the key."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 8
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "permissions": {
                          "type": [
                            "object",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 8,
                    "permissions": {
                      "clients": {
                        "scopes": [
                          "VIEW"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/apiTokens/getUserAllowedPermissions": {
      "get": {
        "operationId": "apiTokens_getUserAllowedPermissions",
        "tags": [
          "API keys"
        ],
        "summary": "List permissions you can assign",
        "description": "Returns the permissions you are able to give to a key.",
        "x-required-permission": "apiTokens.MANAGE",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/apiTokens/rotateUserApiToken": {
      "post": {
        "operationId": "apiTokens_rotateUserApiToken",
        "tags": [
          "API keys"
        ],
        "summary": "Rotate an API key",
        "description": "Creates a new key with the same permissions, and retires the old one after the delay you choose.",
        "x-required-permission": "apiTokens.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the key."
                  },
                  "expireDelay": {
                    "type": "string",
                    "enum": [
                      "now",
                      "1d",
                      "2d",
                      "1w",
                      "1M"
                    ],
                    "description": "How long the old key keeps working."
                  }
                },
                "required": [
                  "id",
                  "expireDelay"
                ]
              },
              "example": {
                "id": 8,
                "expireDelay": "1w"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "userId": {
                          "type": "integer"
                        },
                        "token": {
                          "type": "string",
                          "description": "The API key. It is shown only this once."
                        },
                        "expiredAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "When the key expires."
                        }
                      },
                      "required": [
                        "id",
                        "token"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 8,
                    "userId": 18,
                    "token": "atsec_your_new_key",
                    "expiredAt": null
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/apiTokens/removeUserApiToken": {
      "post": {
        "operationId": "apiTokens_removeUserApiToken",
        "tags": [
          "API keys"
        ],
        "summary": "Delete an API key",
        "description": "Permanently cancels a key. It stops working on the next request.",
        "x-required-permission": "apiTokens.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the key."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 8
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "userId": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 8,
                    "userId": 18
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/activities/create": {
      "post": {
        "operationId": "activities_create",
        "tags": [
          "Activities"
        ],
        "summary": "Create an activity",
        "description": "Adds a note or event to the timeline of a client.",
        "x-required-permission": "clients.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "clientId": {
                    "type": "integer",
                    "description": "ID of the client this activity belongs to."
                  },
                  "type": {
                    "type": "string",
                    "description": "Kind of activity. See List activity types."
                  },
                  "message": {
                    "type": "string",
                    "description": "The note text."
                  },
                  "favorite": {
                    "type": "boolean",
                    "description": "True when the activity is pinned."
                  }
                },
                "required": [
                  "clientId",
                  "type"
                ]
              },
              "example": {
                "clientId": 1042,
                "type": "NOTE",
                "message": "Called and left a message."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 588
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/activities/update": {
      "post": {
        "operationId": "activities_update",
        "tags": [
          "Activities"
        ],
        "summary": "Update an activity",
        "description": "Changes the text of an activity, or pins it.",
        "x-required-permission": "clients.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the activity."
                  },
                  "message": {
                    "type": "string",
                    "description": "The note text."
                  },
                  "favorite": {
                    "type": "boolean",
                    "description": "True when the activity is pinned."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 588,
                "favorite": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "id"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 588
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/activities/remove": {
      "post": {
        "operationId": "activities_remove",
        "tags": [
          "Activities"
        ],
        "summary": "Delete an activity",
        "description": "Permanently deletes an activity.",
        "x-required-permission": "clients.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the activity to delete."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 588
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "id"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 588
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/activities/search": {
      "post": {
        "operationId": "activities_search",
        "tags": [
          "Activities"
        ],
        "summary": "Search activities",
        "description": "Returns a list of activities, with only the fields you ask for.",
        "x-required-permission": "activities.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fields"
                ],
                "properties": {
                  "fields": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "id",
                        "clientId",
                        "type",
                        "message",
                        "messageVariables",
                        "favorite",
                        "isSystemActivity",
                        "createdByUserId",
                        "createdByFullName",
                        "clientFullName",
                        "createdAt"
                      ]
                    },
                    "description": "The fields to return. Required."
                  },
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  },
                  "orderBy": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "ASC",
                        "DESC"
                      ]
                    },
                    "description": "Field to sort by. The field must also be listed in `fields`."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "How many records to return. Always set this, because leaving it out can return every record."
                  },
                  "offset": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "How many records to skip."
                  }
                }
              },
              "example": {
                "fields": [
                  "id",
                  "type",
                  "message",
                  "createdAt"
                ],
                "filters": [
                  {
                    "clientId": {
                      "mode": "EQ",
                      "value": [
                        1042
                      ]
                    }
                  }
                ],
                "orderBy": {
                  "createdAt": "DESC"
                },
                "limit": 25
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Activity ID."
                          },
                          "clientId": {
                            "type": "integer",
                            "description": "ID of the client this activity belongs to."
                          },
                          "type": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Kind of activity. See List activity types."
                          },
                          "message": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The note text."
                          },
                          "messageVariables": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "description": "Values used inside system generated messages."
                          },
                          "favorite": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "True when the activity is pinned."
                          },
                          "isSystemActivity": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "True when Estactics created the activity automatically."
                          },
                          "createdByUserId": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "ID of the person who created the activity."
                          },
                          "createdByFullName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Name of the person who created the activity."
                          },
                          "clientFullName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Name of the client."
                          },
                          "createdAt": {
                            "type": "string",
                            "description": "When the activity was created."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 588,
                      "type": "NOTE",
                      "message": "Called and left a message.",
                      "createdAt": "2026-11-09 18:39:46"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/activities/searchCount": {
      "post": {
        "operationId": "activities_searchCount",
        "tags": [
          "Activities"
        ],
        "summary": "Count activities",
        "description": "Returns how many activities match the filters. Use it together with Search to build pagination.",
        "x-required-permission": "activities.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  }
                }
              },
              "example": {
                "filters": [
                  {
                    "clientId": {
                      "mode": "EQ",
                      "value": [
                        1042
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": 42
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/activities/getActivitiesTypesDisplayList": {
      "get": {
        "operationId": "activities_getActivitiesTypesDisplayList",
        "tags": [
          "Activities"
        ],
        "summary": "List activity types",
        "description": "Returns the allowed values for `type`.",
        "x-required-permission": "activities.VIEW",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "NOTE",
                      "value": "NOTE"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/brands/create": {
      "post": {
        "operationId": "brands_create",
        "tags": [
          "Brands"
        ],
        "summary": "Create a brand",
        "description": "Adds a brand. How many brands you can have depends on your plan.",
        "x-required-permission": "brands.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Brand name."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country."
                  },
                  "city": {
                    "type": "string",
                    "description": "City."
                  },
                  "state": {
                    "type": "string",
                    "description": "State or district."
                  },
                  "address": {
                    "type": "string",
                    "description": "Street address."
                  },
                  "zipcode": {
                    "type": "integer",
                    "description": "Postal code."
                  },
                  "homepage": {
                    "type": "string",
                    "description": "Website."
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "Main brand",
                "city": "Limassol"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 3
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/brands/update": {
      "post": {
        "operationId": "brands_update",
        "tags": [
          "Brands"
        ],
        "summary": "Update a brand",
        "description": "Changes a brand. Send only the fields you want to change.",
        "x-required-permission": "brands.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the brand."
                  },
                  "name": {
                    "type": "string",
                    "description": "Brand name."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country."
                  },
                  "city": {
                    "type": "string",
                    "description": "City."
                  },
                  "state": {
                    "type": "string",
                    "description": "State or district."
                  },
                  "address": {
                    "type": "string",
                    "description": "Street address."
                  },
                  "zipcode": {
                    "type": "integer",
                    "description": "Postal code."
                  },
                  "homepage": {
                    "type": "string",
                    "description": "Website."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 3,
                "homepage": "https://www.example.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "id"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 3
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/brands/search": {
      "post": {
        "operationId": "brands_search",
        "tags": [
          "Brands"
        ],
        "summary": "Search brands",
        "description": "Returns a list of brands, with only the fields you ask for.",
        "x-required-permission": "brands.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fields"
                ],
                "properties": {
                  "fields": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "id",
                        "name",
                        "isDefault",
                        "country",
                        "city",
                        "state",
                        "address",
                        "zipcode",
                        "homepage",
                        "logoUrl",
                        "iconUrl"
                      ]
                    },
                    "description": "The fields to return. Required."
                  },
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  },
                  "orderBy": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "ASC",
                        "DESC"
                      ]
                    },
                    "description": "Field to sort by. The field must also be listed in `fields`."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "How many records to return. Always set this, because leaving it out can return every record."
                  },
                  "offset": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "How many records to skip."
                  }
                }
              },
              "example": {
                "fields": [
                  "id",
                  "name",
                  "isDefault"
                ],
                "limit": 25
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Brand ID."
                          },
                          "name": {
                            "type": "string",
                            "description": "Brand name."
                          },
                          "isDefault": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "True for the main brand of your organization."
                          },
                          "country": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Country."
                          },
                          "city": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "City."
                          },
                          "state": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "State or district."
                          },
                          "address": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Street address."
                          },
                          "zipcode": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Postal code."
                          },
                          "homepage": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Website."
                          },
                          "logoUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Logo URL."
                          },
                          "iconUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Icon URL."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 3,
                      "name": "Main brand",
                      "isDefault": true
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/brands/searchCount": {
      "post": {
        "operationId": "brands_searchCount",
        "tags": [
          "Brands"
        ],
        "summary": "Count brands",
        "description": "Returns how many brands match the filters. Use it together with Search to build pagination.",
        "x-required-permission": "brands.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  }
                }
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": 42
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/brands/getDisplayList": {
      "post": {
        "operationId": "brands_getDisplayList",
        "tags": [
          "Brands"
        ],
        "summary": "List brands for a picker",
        "description": "Returns brand names and IDs, handy for dropdowns.",
        "x-required-permission": "clients.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "value": {
                            "type": "integer"
                          },
                          "iconUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "Main brand",
                      "value": 3,
                      "iconUrl": null
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/brands/updateBrandLogo": {
      "post": {
        "operationId": "brands_updateBrandLogo",
        "tags": [
          "Brands"
        ],
        "summary": "Upload a brand logo",
        "description": "Uploads or replaces the logo. Send the request as `multipart/form-data`, with the file in a field called `logoFile`.",
        "x-required-permission": "brands.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "brandId": {
                    "type": "integer",
                    "description": "ID of the brand."
                  },
                  "logoFile": {
                    "type": "string",
                    "format": "binary",
                    "description": "The image file."
                  }
                },
                "required": [
                  "brandId",
                  "logoFile"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/brands/removeBrandLogo": {
      "post": {
        "operationId": "brands_removeBrandLogo",
        "tags": [
          "Brands"
        ],
        "summary": "Delete a brand logo",
        "description": "Removes the logo.",
        "x-required-permission": "brands.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "brandId": {
                    "type": "integer",
                    "description": "ID of the brand."
                  }
                },
                "required": [
                  "brandId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/brands/updateBrandIcon": {
      "post": {
        "operationId": "brands_updateBrandIcon",
        "tags": [
          "Brands"
        ],
        "summary": "Upload a brand icon",
        "description": "Uploads or replaces the icon. Send the request as `multipart/form-data`, with the file in a field called `iconFile`.",
        "x-required-permission": "brands.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "brandId": {
                    "type": "integer",
                    "description": "ID of the brand."
                  },
                  "iconFile": {
                    "type": "string",
                    "format": "binary",
                    "description": "The image file."
                  }
                },
                "required": [
                  "brandId",
                  "iconFile"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/brands/removeBrandIcon": {
      "post": {
        "operationId": "brands_removeBrandIcon",
        "tags": [
          "Brands"
        ],
        "summary": "Delete a brand icon",
        "description": "Removes the icon.",
        "x-required-permission": "brands.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "brandId": {
                    "type": "integer",
                    "description": "ID of the brand."
                  }
                },
                "required": [
                  "brandId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/calendarEvents/create": {
      "post": {
        "operationId": "calendarEvents_create",
        "tags": [
          "Calendar events"
        ],
        "summary": "Create a calendar event",
        "description": "Adds an event to the calendar of the person who owns the API key.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "eventType": {
                    "type": "string",
                    "enum": [
                      "EVENT",
                      "FRONTAL_MEETING",
                      "ONLINE_MEETING",
                      "VIEWING",
                      "FOLLOW_UP"
                    ],
                    "description": "Kind of event."
                  },
                  "title": {
                    "type": "string",
                    "description": "Event title."
                  },
                  "notes": {
                    "type": "string",
                    "description": "Notes."
                  },
                  "isAllDay": {
                    "type": "boolean",
                    "description": "True for an all-day event."
                  },
                  "startsAt": {
                    "type": "string",
                    "description": "Start date and time."
                  },
                  "endsAt": {
                    "type": "string",
                    "description": "End date and time."
                  },
                  "startsAtDate": {
                    "type": "string",
                    "format": "date",
                    "description": "Start date, for all-day events."
                  },
                  "endsAtDate": {
                    "type": "string",
                    "format": "date",
                    "description": "End date, for all-day events."
                  },
                  "relatedClientId": {
                    "type": "integer",
                    "description": "ID of the client this event is about."
                  },
                  "relatedPropertyId": {
                    "type": "integer",
                    "description": "ID of the property this event is about."
                  },
                  "usersInvitesIds": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "IDs of the invited team members."
                  }
                },
                "required": [
                  "eventType"
                ]
              },
              "example": {
                "eventType": "VIEWING",
                "title": "Viewing with Alex",
                "startsAt": "2027-01-15 10:00:00",
                "endsAt": "2027-01-15 11:00:00",
                "relatedClientId": 1042
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "organizationId": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "userId": {
                          "type": [
                            "integer",
                            "string",
                            "null"
                          ]
                        },
                        "eventType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "relatedClientId": {
                          "type": [
                            "integer",
                            "string",
                            "null"
                          ]
                        },
                        "relatedPropertyId": {
                          "type": [
                            "integer",
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 201,
                    "organizationId": 7,
                    "userId": 18,
                    "eventType": "VIEWING",
                    "relatedClientId": 1042,
                    "relatedPropertyId": null
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/calendarEvents/update": {
      "post": {
        "operationId": "calendarEvents_update",
        "tags": [
          "Calendar events"
        ],
        "summary": "Update a calendar event",
        "description": "Changes an event. Send only the fields you want to change.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the event."
                  },
                  "eventType": {
                    "type": "string",
                    "enum": [
                      "EVENT",
                      "FRONTAL_MEETING",
                      "ONLINE_MEETING",
                      "VIEWING",
                      "FOLLOW_UP"
                    ],
                    "description": "Kind of event."
                  },
                  "title": {
                    "type": "string",
                    "description": "Event title."
                  },
                  "notes": {
                    "type": "string",
                    "description": "Notes."
                  },
                  "isAllDay": {
                    "type": "boolean",
                    "description": "True for an all-day event."
                  },
                  "startsAt": {
                    "type": "string",
                    "description": "Start date and time."
                  },
                  "endsAt": {
                    "type": "string",
                    "description": "End date and time."
                  },
                  "startsAtDate": {
                    "type": "string",
                    "format": "date",
                    "description": "Start date, for all-day events."
                  },
                  "endsAtDate": {
                    "type": "string",
                    "format": "date",
                    "description": "End date, for all-day events."
                  },
                  "relatedClientId": {
                    "type": "integer",
                    "description": "ID of the client this event is about."
                  },
                  "relatedPropertyId": {
                    "type": "integer",
                    "description": "ID of the property this event is about."
                  },
                  "usersInvitesIds": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "IDs of the invited team members."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 201,
                "title": "Viewing moved"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "organizationId": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "userId": {
                          "type": [
                            "integer",
                            "string",
                            "null"
                          ]
                        },
                        "eventType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "relatedClientId": {
                          "type": [
                            "integer",
                            "string",
                            "null"
                          ]
                        },
                        "relatedPropertyId": {
                          "type": [
                            "integer",
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 201,
                    "organizationId": 7,
                    "userId": 18,
                    "eventType": "VIEWING",
                    "relatedClientId": 1042,
                    "relatedPropertyId": null
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/calendarEvents/remove": {
      "post": {
        "operationId": "calendarEvents_remove",
        "tags": [
          "Calendar events"
        ],
        "summary": "Delete a calendar event",
        "description": "Permanently deletes an event.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the event to delete."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 201
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "eventType": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 201,
                    "eventType": "VIEWING"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/calendarEvents/search": {
      "post": {
        "operationId": "calendarEvents_search",
        "tags": [
          "Calendar events"
        ],
        "summary": "Search calendar events",
        "description": "Returns a list of calendar events, with only the fields you ask for.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fields"
                ],
                "properties": {
                  "fields": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "id",
                        "userId",
                        "eventType",
                        "title",
                        "notes",
                        "isAllDay",
                        "startsAt",
                        "endsAt",
                        "startsAtDate",
                        "endsAtDate",
                        "relatedClientId",
                        "relatedClient",
                        "relatedPropertyId",
                        "relatedProperty",
                        "usersInvitesIds"
                      ]
                    },
                    "description": "The fields to return. Required."
                  },
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  },
                  "orderBy": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "ASC",
                        "DESC"
                      ]
                    },
                    "description": "Field to sort by. The field must also be listed in `fields`."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "How many records to return. Always set this, because leaving it out can return every record."
                  },
                  "offset": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "How many records to skip."
                  }
                }
              },
              "example": {
                "fields": [
                  "id",
                  "title",
                  "startsAt"
                ],
                "orderBy": {
                  "startsAt": "ASC"
                },
                "limit": 25
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Event ID."
                          },
                          "userId": {
                            "type": "integer",
                            "description": "ID of the person the event belongs to."
                          },
                          "eventType": {
                            "type": "string",
                            "enum": [
                              "EVENT",
                              "FRONTAL_MEETING",
                              "ONLINE_MEETING",
                              "VIEWING",
                              "FOLLOW_UP"
                            ],
                            "description": "Kind of event."
                          },
                          "title": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Event title."
                          },
                          "notes": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Notes."
                          },
                          "isAllDay": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "True for an all-day event."
                          },
                          "startsAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Start date and time."
                          },
                          "endsAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "End date and time."
                          },
                          "startsAtDate": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date",
                            "description": "Start date, for all-day events."
                          },
                          "endsAtDate": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date",
                            "description": "End date, for all-day events."
                          },
                          "relatedClientId": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "ID of the client this event is about."
                          },
                          "relatedClient": {
                            "type": [
                              "object",
                              "string",
                              "null"
                            ],
                            "description": "The related client."
                          },
                          "relatedPropertyId": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "ID of the property this event is about."
                          },
                          "relatedProperty": {
                            "type": [
                              "object",
                              "string",
                              "null"
                            ],
                            "description": "The related property."
                          },
                          "usersInvitesIds": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "integer"
                            },
                            "description": "IDs of the invited team members."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 201,
                      "title": "Viewing with Alex",
                      "startsAt": "2027-01-15 10:00:00"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/calendarEvents/searchCount": {
      "post": {
        "operationId": "calendarEvents_searchCount",
        "tags": [
          "Calendar events"
        ],
        "summary": "Count calendar events",
        "description": "Returns how many calendar events match the filters. Use it together with Search to build pagination.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  }
                }
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": 42
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/clientsSettings/fetch": {
      "post": {
        "operationId": "clientsSettings_fetch",
        "tags": [
          "Client settings"
        ],
        "summary": "Get client settings",
        "description": "Returns the client settings of your organization.",
        "x-required-permission": "clients.CONFIGURE_SETTINGS",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "Settings ID."
                        },
                        "organizationId": {
                          "type": "integer",
                          "description": "Organization ID."
                        },
                        "sendClientWelcomeEmail": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "Send a welcome email to each new client."
                        },
                        "duplicateBehaviorEnabled": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "React when an existing client signs up again."
                        },
                        "duplicateBehaviorSendEmailEnabled": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "Email the owning agent when an existing client signs up again."
                        },
                        "duplicateBehaviorChangeStageToId": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "Move a returning client to this stage."
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 1,
                    "sendClientWelcomeEmail": false,
                    "duplicateBehaviorEnabled": false,
                    "duplicateBehaviorSendEmailEnabled": false,
                    "duplicateBehaviorChangeStageToId": null
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/clientsSettings/update": {
      "post": {
        "operationId": "clientsSettings_update",
        "tags": [
          "Client settings"
        ],
        "summary": "Update client settings",
        "description": "Changes the client settings of your organization. Turning off `duplicateBehaviorEnabled` also clears the two related settings.",
        "x-required-permission": "clients.CONFIGURE_SETTINGS",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sendClientWelcomeEmail": {
                    "type": "boolean",
                    "description": "Send a welcome email to each new client."
                  },
                  "duplicateBehaviorEnabled": {
                    "type": "boolean",
                    "description": "React when an existing client signs up again."
                  },
                  "duplicateBehaviorSendEmailEnabled": {
                    "type": "boolean",
                    "description": "Email the owning agent when an existing client signs up again."
                  },
                  "duplicateBehaviorChangeStageToId": {
                    "type": "integer",
                    "description": "Move a returning client to this stage."
                  }
                }
              },
              "example": {
                "sendClientWelcomeEmail": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "Settings ID."
                        },
                        "organizationId": {
                          "type": "integer",
                          "description": "Organization ID."
                        },
                        "sendClientWelcomeEmail": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "Send a welcome email to each new client."
                        },
                        "duplicateBehaviorEnabled": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "React when an existing client signs up again."
                        },
                        "duplicateBehaviorSendEmailEnabled": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "Email the owning agent when an existing client signs up again."
                        },
                        "duplicateBehaviorChangeStageToId": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "Move a returning client to this stage."
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 1,
                    "sendClientWelcomeEmail": true,
                    "duplicateBehaviorEnabled": false,
                    "duplicateBehaviorSendEmailEnabled": false,
                    "duplicateBehaviorChangeStageToId": null
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/clients/create": {
      "post": {
        "operationId": "clients_create",
        "tags": [
          "Clients"
        ],
        "summary": "Create a client",
        "description": "Adds a new client. An email or phone number that already belongs to a client is rejected, unless you set `throwErrorOnClientExists` to false.",
        "x-required-permission": "clients.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "firstName": {
                    "type": "string",
                    "description": "First name."
                  },
                  "lastName": {
                    "type": "string",
                    "description": "Last name."
                  },
                  "email": {
                    "type": "string",
                    "description": "Email address. Masked or left out when the API key lacks email visibility."
                  },
                  "language": {
                    "type": "string",
                    "description": "Preferred language code, for example en."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country name."
                  },
                  "city": {
                    "type": "string",
                    "description": "City."
                  },
                  "address": {
                    "type": "string",
                    "description": "Street address."
                  },
                  "campaignCode": {
                    "type": "string",
                    "description": "Code of the marketing campaign the client came from."
                  },
                  "brandId": {
                    "type": "integer",
                    "description": "ID of the brand the client belongs to."
                  },
                  "assignedToUserId": {
                    "type": "integer",
                    "description": "ID of the agent who owns the client."
                  },
                  "assignedToHierarchyId": {
                    "type": "integer",
                    "description": "ID of the team that owns the client."
                  },
                  "phone": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "integer"
                      }
                    ],
                    "description": "Phone number. Send it in international format, such as +35799123456, or send the national number together with `phoneDialCode`."
                  },
                  "phoneDialCode": {
                    "type": "integer",
                    "description": "Dial code without the plus sign. Only needed when `phone` is not in international format."
                  },
                  "phoneCountryCode": {
                    "type": "string",
                    "description": "Two-letter country code. Only needed together with `phoneDialCode`."
                  },
                  "phoneDefaultCountry": {
                    "type": "string",
                    "description": "Country to assume for a phone number with no dial code, for example CY."
                  },
                  "throwErrorOnClientExists": {
                    "type": "boolean",
                    "description": "When false, a client who already exists is returned instead of an error. Defaults to true."
                  },
                  "utmSource": {
                    "type": "string",
                    "description": "UTM source. Saved only when `campaignCode` is sent."
                  },
                  "utmMedium": {
                    "type": "string",
                    "description": "UTM medium. Saved only when `campaignCode` is sent."
                  },
                  "utmCampaign": {
                    "type": "string",
                    "description": "UTM campaign. Saved only when `campaignCode` is sent."
                  },
                  "utmTerm": {
                    "type": "string",
                    "description": "UTM term. Saved only when `campaignCode` is sent."
                  },
                  "utmContent": {
                    "type": "string",
                    "description": "UTM content. Saved only when `campaignCode` is sent."
                  },
                  "form": {
                    "type": "object",
                    "description": "Any extra answers from your form. Saved only when `campaignCode` is sent."
                  }
                },
                "required": [
                  "firstName",
                  "email",
                  "phone"
                ]
              },
              "example": {
                "firstName": "Alex",
                "lastName": "Morgan",
                "email": "alex.morgan@example.com",
                "phone": "+35799123456",
                "language": "en",
                "country": "Cyprus"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "assignedToUser": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "assignedToUserLanguage": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 1042,
                    "assignedToUser": null,
                    "assignedToUserLanguage": null
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/clients/update": {
      "post": {
        "operationId": "clients_update",
        "tags": [
          "Clients"
        ],
        "summary": "Update a client",
        "description": "Changes the details of a client. Send only the fields you want to change.",
        "x-required-permission": "clients.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the client to update."
                  },
                  "firstName": {
                    "type": "string",
                    "description": "First name."
                  },
                  "lastName": {
                    "type": "string",
                    "description": "Last name."
                  },
                  "email": {
                    "type": "string",
                    "description": "Email address. Masked or left out when the API key lacks email visibility."
                  },
                  "phoneCountryCode": {
                    "type": "string",
                    "description": "Two-letter country code of the phone number, for example CY."
                  },
                  "phoneDialCode": {
                    "type": "integer",
                    "description": "International dial code without the plus sign, for example 357."
                  },
                  "phone": {
                    "type": "integer",
                    "description": "National phone number, digits only. Masked or left out when the API key lacks phone visibility."
                  },
                  "gender": {
                    "type": "string",
                    "description": "Gender.",
                    "enum": [
                      "MALE",
                      "FEMALE",
                      null
                    ]
                  },
                  "language": {
                    "type": "string",
                    "description": "Preferred language code, for example en."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country name."
                  },
                  "city": {
                    "type": "string",
                    "description": "City."
                  },
                  "address": {
                    "type": "string",
                    "description": "Street address."
                  },
                  "stageId": {
                    "type": "integer",
                    "description": "ID of the pipeline stage."
                  },
                  "doNotContact": {
                    "type": "boolean",
                    "description": "True when the client must not be contacted."
                  },
                  "labelIds": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "IDs of the labels on this client."
                  },
                  "interestTypes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "What the client wants to do: BUY or RENT."
                  },
                  "preferredPropertyTypes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Property types the client is interested in."
                  },
                  "preferredCountry": {
                    "type": "string",
                    "description": "Country the client wants to buy or rent in."
                  },
                  "preferredCity": {
                    "type": "string",
                    "description": "City the client wants to buy or rent in."
                  },
                  "preferredArea": {
                    "type": "string",
                    "description": "Area the client wants to buy or rent in."
                  },
                  "preferredBedrooms": {
                    "type": "integer",
                    "description": "Number of bedrooms wanted."
                  },
                  "preferredBathrooms": {
                    "type": "integer",
                    "description": "Number of bathrooms wanted."
                  },
                  "purchasePurpose": {
                    "type": "string",
                    "description": "Why the client is buying.",
                    "enum": [
                      "INVESTMENT",
                      "RESIDENCY",
                      "HOLIDAY_HOME",
                      "OTHER",
                      null
                    ]
                  },
                  "propertyStageInterests": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Construction stages the client is interested in."
                  },
                  "preferredFeatures": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Property features the client wants."
                  },
                  "deliveryDeadline": {
                    "type": "string",
                    "description": "Latest delivery date that suits the client."
                  },
                  "interestNotes": {
                    "type": "string",
                    "description": "Free text notes about what the client wants."
                  },
                  "minBudget": {
                    "type": "number",
                    "description": "Lowest budget."
                  },
                  "maxBudget": {
                    "type": "number",
                    "description": "Highest budget."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 1042,
                "city": "Limassol",
                "preferredBedrooms": 3
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "Client ID."
                        },
                        "firstName": {
                          "type": "string",
                          "description": "First name."
                        },
                        "lastName": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Last name."
                        },
                        "fullName": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "First and last name together."
                        },
                        "email": {
                          "type": "string",
                          "description": "Email address. Masked or left out when the API key lacks email visibility."
                        },
                        "phoneCountryCode": {
                          "type": "string",
                          "description": "Two-letter country code of the phone number, for example CY."
                        },
                        "phoneDialCode": {
                          "type": "integer",
                          "description": "International dial code without the plus sign, for example 357."
                        },
                        "phone": {
                          "type": "integer",
                          "description": "National phone number, digits only. Masked or left out when the API key lacks phone visibility."
                        },
                        "language": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Preferred language code, for example en."
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Country name."
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "City."
                        },
                        "address": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Street address."
                        },
                        "gender": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Gender.",
                          "enum": [
                            "MALE",
                            "FEMALE",
                            null,
                            null
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Lifecycle status, worked out from the stage."
                        },
                        "campaignCode": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Code of the marketing campaign the client came from."
                        },
                        "brandId": {
                          "type": "integer",
                          "description": "ID of the brand the client belongs to."
                        },
                        "brand": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Brand name."
                        },
                        "stageId": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "ID of the pipeline stage."
                        },
                        "stage": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "description": "The pipeline stage.",
                          "properties": {
                            "id": {
                              "type": "integer"
                            },
                            "name": {
                              "type": "string"
                            },
                            "icon": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "color": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "category": {
                              "type": "string"
                            }
                          }
                        },
                        "doNotContact": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "True when the client must not be contacted."
                        },
                        "labelIds": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "integer"
                          },
                          "description": "IDs of the labels on this client."
                        },
                        "assignedToUserId": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "ID of the agent who owns the client."
                        },
                        "assignedToUser": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Email of the agent who owns the client."
                        },
                        "assignedToUserFullName": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Name of the agent who owns the client."
                        },
                        "assignedToHierarchyId": {
                          "type": "integer",
                          "description": "ID of the team that owns the client."
                        },
                        "assignedToHierarchy": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Name of the team that owns the client."
                        },
                        "interestTypes": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          },
                          "description": "What the client wants to do: BUY or RENT."
                        },
                        "preferredPropertyTypes": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          },
                          "description": "Property types the client is interested in."
                        },
                        "preferredCountry": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Country the client wants to buy or rent in."
                        },
                        "preferredCity": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "City the client wants to buy or rent in."
                        },
                        "preferredArea": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Area the client wants to buy or rent in."
                        },
                        "preferredBedrooms": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "Number of bedrooms wanted."
                        },
                        "preferredBathrooms": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "Number of bathrooms wanted."
                        },
                        "purchasePurpose": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Why the client is buying.",
                          "enum": [
                            "INVESTMENT",
                            "RESIDENCY",
                            "HOLIDAY_HOME",
                            "OTHER",
                            null,
                            null
                          ]
                        },
                        "propertyStageInterests": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          },
                          "description": "Construction stages the client is interested in."
                        },
                        "preferredFeatures": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          },
                          "description": "Property features the client wants."
                        },
                        "deliveryDeadline": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Latest delivery date that suits the client."
                        },
                        "interestNotes": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Free text notes about what the client wants."
                        },
                        "minBudget": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Lowest budget."
                        },
                        "maxBudget": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Highest budget."
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "When the client was created."
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "When the client was last changed."
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 1042,
                    "firstName": "Alex",
                    "lastName": "Morgan",
                    "city": "Limassol",
                    "preferredBedrooms": 3
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/clients/modifyClientCategorization": {
      "post": {
        "operationId": "clients_modifyClientCategorization",
        "tags": [
          "Clients"
        ],
        "summary": "Move a client to a brand or team",
        "description": "Changes the brand and team a client belongs to, and optionally the agent who owns them.",
        "x-required-permission": "clients.MANAGE_CATEGORIZATION",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the client."
                  },
                  "brandId": {
                    "type": "integer",
                    "description": "ID of the brand the client belongs to."
                  },
                  "assignedToHierarchyId": {
                    "type": "integer",
                    "description": "ID of the team that owns the client."
                  },
                  "assignedToUserId": {
                    "type": "integer",
                    "description": "ID of the agent who owns the client."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 1042,
                "brandId": 3,
                "assignedToHierarchyId": 7
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "Client ID."
                        },
                        "firstName": {
                          "type": "string",
                          "description": "First name."
                        },
                        "lastName": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Last name."
                        },
                        "fullName": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "First and last name together."
                        },
                        "email": {
                          "type": "string",
                          "description": "Email address. Masked or left out when the API key lacks email visibility."
                        },
                        "phoneCountryCode": {
                          "type": "string",
                          "description": "Two-letter country code of the phone number, for example CY."
                        },
                        "phoneDialCode": {
                          "type": "integer",
                          "description": "International dial code without the plus sign, for example 357."
                        },
                        "phone": {
                          "type": "integer",
                          "description": "National phone number, digits only. Masked or left out when the API key lacks phone visibility."
                        },
                        "language": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Preferred language code, for example en."
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Country name."
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "City."
                        },
                        "address": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Street address."
                        },
                        "gender": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Gender.",
                          "enum": [
                            "MALE",
                            "FEMALE",
                            null,
                            null
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Lifecycle status, worked out from the stage."
                        },
                        "campaignCode": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Code of the marketing campaign the client came from."
                        },
                        "brandId": {
                          "type": "integer",
                          "description": "ID of the brand the client belongs to."
                        },
                        "brand": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Brand name."
                        },
                        "stageId": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "ID of the pipeline stage."
                        },
                        "stage": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "description": "The pipeline stage.",
                          "properties": {
                            "id": {
                              "type": "integer"
                            },
                            "name": {
                              "type": "string"
                            },
                            "icon": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "color": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "category": {
                              "type": "string"
                            }
                          }
                        },
                        "doNotContact": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "True when the client must not be contacted."
                        },
                        "labelIds": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "integer"
                          },
                          "description": "IDs of the labels on this client."
                        },
                        "assignedToUserId": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "ID of the agent who owns the client."
                        },
                        "assignedToUser": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Email of the agent who owns the client."
                        },
                        "assignedToUserFullName": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Name of the agent who owns the client."
                        },
                        "assignedToHierarchyId": {
                          "type": "integer",
                          "description": "ID of the team that owns the client."
                        },
                        "assignedToHierarchy": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Name of the team that owns the client."
                        },
                        "interestTypes": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          },
                          "description": "What the client wants to do: BUY or RENT."
                        },
                        "preferredPropertyTypes": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          },
                          "description": "Property types the client is interested in."
                        },
                        "preferredCountry": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Country the client wants to buy or rent in."
                        },
                        "preferredCity": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "City the client wants to buy or rent in."
                        },
                        "preferredArea": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Area the client wants to buy or rent in."
                        },
                        "preferredBedrooms": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "Number of bedrooms wanted."
                        },
                        "preferredBathrooms": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "Number of bathrooms wanted."
                        },
                        "purchasePurpose": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Why the client is buying.",
                          "enum": [
                            "INVESTMENT",
                            "RESIDENCY",
                            "HOLIDAY_HOME",
                            "OTHER",
                            null,
                            null
                          ]
                        },
                        "propertyStageInterests": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          },
                          "description": "Construction stages the client is interested in."
                        },
                        "preferredFeatures": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          },
                          "description": "Property features the client wants."
                        },
                        "deliveryDeadline": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Latest delivery date that suits the client."
                        },
                        "interestNotes": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Free text notes about what the client wants."
                        },
                        "minBudget": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Lowest budget."
                        },
                        "maxBudget": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Highest budget."
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "When the client was created."
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "When the client was last changed."
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 1042,
                    "brandId": 3,
                    "assignedToHierarchyId": 7
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/clients/changeClientAssignee": {
      "post": {
        "operationId": "clients_changeClientAssignee",
        "tags": [
          "Clients"
        ],
        "summary": "Change the agent of a client",
        "description": "Assigns a client to another agent. Send `assignedToUserId` as null to remove the agent.",
        "x-required-permission": "clients.CHANGE_ASSIGNEE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the client."
                  },
                  "assignedToUserId": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "ID of the new agent, or null to remove the agent."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 1042,
                "assignedToUserId": 18
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "Client ID."
                        },
                        "firstName": {
                          "type": "string",
                          "description": "First name."
                        },
                        "lastName": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Last name."
                        },
                        "fullName": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "First and last name together."
                        },
                        "email": {
                          "type": "string",
                          "description": "Email address. Masked or left out when the API key lacks email visibility."
                        },
                        "phoneCountryCode": {
                          "type": "string",
                          "description": "Two-letter country code of the phone number, for example CY."
                        },
                        "phoneDialCode": {
                          "type": "integer",
                          "description": "International dial code without the plus sign, for example 357."
                        },
                        "phone": {
                          "type": "integer",
                          "description": "National phone number, digits only. Masked or left out when the API key lacks phone visibility."
                        },
                        "language": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Preferred language code, for example en."
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Country name."
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "City."
                        },
                        "address": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Street address."
                        },
                        "gender": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Gender.",
                          "enum": [
                            "MALE",
                            "FEMALE",
                            null,
                            null
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Lifecycle status, worked out from the stage."
                        },
                        "campaignCode": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Code of the marketing campaign the client came from."
                        },
                        "brandId": {
                          "type": "integer",
                          "description": "ID of the brand the client belongs to."
                        },
                        "brand": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Brand name."
                        },
                        "stageId": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "ID of the pipeline stage."
                        },
                        "stage": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "description": "The pipeline stage.",
                          "properties": {
                            "id": {
                              "type": "integer"
                            },
                            "name": {
                              "type": "string"
                            },
                            "icon": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "color": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "category": {
                              "type": "string"
                            }
                          }
                        },
                        "doNotContact": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "True when the client must not be contacted."
                        },
                        "labelIds": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "integer"
                          },
                          "description": "IDs of the labels on this client."
                        },
                        "assignedToUserId": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "ID of the agent who owns the client."
                        },
                        "assignedToUser": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Email of the agent who owns the client."
                        },
                        "assignedToUserFullName": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Name of the agent who owns the client."
                        },
                        "assignedToHierarchyId": {
                          "type": "integer",
                          "description": "ID of the team that owns the client."
                        },
                        "assignedToHierarchy": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Name of the team that owns the client."
                        },
                        "interestTypes": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          },
                          "description": "What the client wants to do: BUY or RENT."
                        },
                        "preferredPropertyTypes": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          },
                          "description": "Property types the client is interested in."
                        },
                        "preferredCountry": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Country the client wants to buy or rent in."
                        },
                        "preferredCity": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "City the client wants to buy or rent in."
                        },
                        "preferredArea": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Area the client wants to buy or rent in."
                        },
                        "preferredBedrooms": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "Number of bedrooms wanted."
                        },
                        "preferredBathrooms": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "Number of bathrooms wanted."
                        },
                        "purchasePurpose": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Why the client is buying.",
                          "enum": [
                            "INVESTMENT",
                            "RESIDENCY",
                            "HOLIDAY_HOME",
                            "OTHER",
                            null,
                            null
                          ]
                        },
                        "propertyStageInterests": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          },
                          "description": "Construction stages the client is interested in."
                        },
                        "preferredFeatures": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          },
                          "description": "Property features the client wants."
                        },
                        "deliveryDeadline": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Latest delivery date that suits the client."
                        },
                        "interestNotes": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Free text notes about what the client wants."
                        },
                        "minBudget": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Lowest budget."
                        },
                        "maxBudget": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Highest budget."
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "When the client was created."
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "When the client was last changed."
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 1042,
                    "assignedToUserId": 18,
                    "assignedToUserFullName": "Jamie Parker"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/clients/remove": {
      "post": {
        "operationId": "clients_remove",
        "tags": [
          "Clients"
        ],
        "summary": "Delete a client",
        "description": "Permanently deletes a client. This cannot be undone.",
        "x-required-permission": "clients.REMOVE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the client to delete."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 1042
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 1042
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/clients/search": {
      "post": {
        "operationId": "clients_search",
        "tags": [
          "Clients"
        ],
        "summary": "Search clients",
        "description": "Returns a list of clients, with only the fields you ask for.",
        "x-required-permission": "clients.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fields"
                ],
                "properties": {
                  "fields": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "id",
                        "firstName",
                        "lastName",
                        "fullName",
                        "email",
                        "phoneCountryCode",
                        "phoneDialCode",
                        "phone",
                        "language",
                        "country",
                        "city",
                        "address",
                        "gender",
                        "status",
                        "campaignCode",
                        "brandId",
                        "brand",
                        "stageId",
                        "stage",
                        "doNotContact",
                        "labelIds",
                        "assignedToUserId",
                        "assignedToUser",
                        "assignedToUserFullName",
                        "assignedToHierarchyId",
                        "assignedToHierarchy",
                        "interestTypes",
                        "preferredPropertyTypes",
                        "preferredCountry",
                        "preferredCity",
                        "preferredArea",
                        "preferredBedrooms",
                        "preferredBathrooms",
                        "purchasePurpose",
                        "propertyStageInterests",
                        "preferredFeatures",
                        "deliveryDeadline",
                        "interestNotes",
                        "minBudget",
                        "maxBudget",
                        "createdAt",
                        "updatedAt"
                      ]
                    },
                    "description": "The fields to return. Required."
                  },
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  },
                  "orderBy": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "ASC",
                        "DESC"
                      ]
                    },
                    "description": "Field to sort by. The field must also be listed in `fields`."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "How many records to return. Always set this, because leaving it out can return every record."
                  },
                  "offset": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "How many records to skip."
                  }
                }
              },
              "example": {
                "fields": [
                  "id",
                  "fullName",
                  "stage"
                ],
                "filters": [
                  {
                    "city": {
                      "mode": "EQ",
                      "value": [
                        "Limassol"
                      ]
                    }
                  }
                ],
                "orderBy": {
                  "id": "DESC"
                },
                "limit": 25,
                "offset": 0
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Client ID."
                          },
                          "firstName": {
                            "type": "string",
                            "description": "First name."
                          },
                          "lastName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Last name."
                          },
                          "fullName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "First and last name together."
                          },
                          "email": {
                            "type": "string",
                            "description": "Email address. Masked or left out when the API key lacks email visibility."
                          },
                          "phoneCountryCode": {
                            "type": "string",
                            "description": "Two-letter country code of the phone number, for example CY."
                          },
                          "phoneDialCode": {
                            "type": "integer",
                            "description": "International dial code without the plus sign, for example 357."
                          },
                          "phone": {
                            "type": "integer",
                            "description": "National phone number, digits only. Masked or left out when the API key lacks phone visibility."
                          },
                          "language": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Preferred language code, for example en."
                          },
                          "country": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Country name."
                          },
                          "city": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "City."
                          },
                          "address": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Street address."
                          },
                          "gender": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Gender.",
                            "enum": [
                              "MALE",
                              "FEMALE",
                              null,
                              null
                            ]
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Lifecycle status, worked out from the stage."
                          },
                          "campaignCode": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Code of the marketing campaign the client came from."
                          },
                          "brandId": {
                            "type": "integer",
                            "description": "ID of the brand the client belongs to."
                          },
                          "brand": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Brand name."
                          },
                          "stageId": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "ID of the pipeline stage."
                          },
                          "stage": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "description": "The pipeline stage.",
                            "properties": {
                              "id": {
                                "type": "integer"
                              },
                              "name": {
                                "type": "string"
                              },
                              "icon": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "color": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "category": {
                                "type": "string"
                              }
                            }
                          },
                          "doNotContact": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "True when the client must not be contacted."
                          },
                          "labelIds": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "integer"
                            },
                            "description": "IDs of the labels on this client."
                          },
                          "assignedToUserId": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "ID of the agent who owns the client."
                          },
                          "assignedToUser": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Email of the agent who owns the client."
                          },
                          "assignedToUserFullName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Name of the agent who owns the client."
                          },
                          "assignedToHierarchyId": {
                            "type": "integer",
                            "description": "ID of the team that owns the client."
                          },
                          "assignedToHierarchy": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Name of the team that owns the client."
                          },
                          "interestTypes": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "string"
                            },
                            "description": "What the client wants to do: BUY or RENT."
                          },
                          "preferredPropertyTypes": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "string"
                            },
                            "description": "Property types the client is interested in."
                          },
                          "preferredCountry": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Country the client wants to buy or rent in."
                          },
                          "preferredCity": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "City the client wants to buy or rent in."
                          },
                          "preferredArea": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Area the client wants to buy or rent in."
                          },
                          "preferredBedrooms": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Number of bedrooms wanted."
                          },
                          "preferredBathrooms": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Number of bathrooms wanted."
                          },
                          "purchasePurpose": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Why the client is buying.",
                            "enum": [
                              "INVESTMENT",
                              "RESIDENCY",
                              "HOLIDAY_HOME",
                              "OTHER",
                              null,
                              null
                            ]
                          },
                          "propertyStageInterests": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "string"
                            },
                            "description": "Construction stages the client is interested in."
                          },
                          "preferredFeatures": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "string"
                            },
                            "description": "Property features the client wants."
                          },
                          "deliveryDeadline": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Latest delivery date that suits the client."
                          },
                          "interestNotes": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Free text notes about what the client wants."
                          },
                          "minBudget": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Lowest budget."
                          },
                          "maxBudget": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Highest budget."
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the client was created."
                          },
                          "updatedAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the client was last changed."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 1042,
                      "fullName": "Alex Morgan",
                      "stage": {
                        "id": 1,
                        "name": "New",
                        "icon": null,
                        "color": null,
                        "category": "ENTRY"
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/clients/searchCount": {
      "post": {
        "operationId": "clients_searchCount",
        "tags": [
          "Clients"
        ],
        "summary": "Count clients",
        "description": "Returns how many clients match the filters. Use it together with Search to build pagination.",
        "x-required-permission": "clients.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  }
                }
              },
              "example": {
                "filters": [
                  {
                    "city": {
                      "mode": "EQ",
                      "value": [
                        "Limassol"
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": 42
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/clients/getClientProfile": {
      "post": {
        "operationId": "clients_getClientProfile",
        "tags": [
          "Clients"
        ],
        "summary": "Get a client profile",
        "description": "Returns everything about one client, grouped the same way as the client page in the CRM.",
        "x-required-permission": "clients.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "clientId": {
                    "type": "integer",
                    "description": "ID of the client."
                  }
                },
                "required": [
                  "clientId"
                ]
              },
              "example": {
                "clientId": 1042
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "categorization": {
                          "type": "object",
                          "description": "Brand, team and agent."
                        },
                        "about": {
                          "type": "object",
                          "description": "Contact details."
                        },
                        "profiling": {
                          "type": "object",
                          "description": "Stage, labels and what the client is looking for."
                        },
                        "stages": {
                          "type": "array",
                          "description": "The pipeline stages of your organization."
                        },
                        "clientSources": {
                          "description": "The campaigns this client registered through."
                        },
                        "upcomingEngagements": {
                          "type": "array",
                          "description": "Upcoming meetings with this client."
                        },
                        "callsCount": {
                          "description": "How many answered calls this client has."
                        }
                      },
                      "required": [
                        "categorization",
                        "about",
                        "profiling"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "categorization": {
                      "brandId": 3
                    },
                    "about": {
                      "id": 1042,
                      "firstName": "Alex"
                    },
                    "profiling": {
                      "stage": {
                        "id": 1,
                        "name": "New"
                      }
                    },
                    "stages": [],
                    "clientSources": [],
                    "upcomingEngagements": [],
                    "callsCount": 0
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/clients/getClientsDisplayList": {
      "post": {
        "operationId": "clients_getClientsDisplayList",
        "tags": [
          "Clients"
        ],
        "summary": "List clients for a picker",
        "description": "Returns client names and IDs, handy for dropdowns.",
        "x-required-permission": "clients.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "searchValue": {
                    "type": "string",
                    "description": "Only return clients whose name matches."
                  },
                  "skip": {
                    "type": "integer",
                    "description": "How many records to skip."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "How many records to return."
                  }
                }
              },
              "example": {
                "searchValue": "Alex",
                "skip": 0,
                "limit": 10
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "value": {
                            "type": "integer"
                          },
                          "gender": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "Alex Morgan",
                      "value": 1042,
                      "gender": null
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/clients/getInterestTypesDisplayList": {
      "get": {
        "operationId": "clients_getInterestTypesDisplayList",
        "tags": [
          "Clients"
        ],
        "summary": "List interest types",
        "description": "Returns the allowed values for `interestTypes`.",
        "x-required-permission": "clients.VIEW",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "BUY",
                      "value": "BUY"
                    },
                    {
                      "text": "RENT",
                      "value": "RENT"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/clients/getPurchasePurposesDisplayList": {
      "get": {
        "operationId": "clients_getPurchasePurposesDisplayList",
        "tags": [
          "Clients"
        ],
        "summary": "List purchase purposes",
        "description": "Returns the allowed values for `purchasePurpose`.",
        "x-required-permission": "clients.VIEW",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "INVESTMENT",
                      "value": "INVESTMENT"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/contacts/create": {
      "post": {
        "operationId": "contacts_create",
        "tags": [
          "Contacts"
        ],
        "summary": "Create a contact",
        "description": "Adds someone to your address book.",
        "x-required-permission": "contacts.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "firstName": {
                    "type": "string",
                    "description": "First name."
                  },
                  "lastName": {
                    "type": "string",
                    "description": "Last name."
                  },
                  "type": {
                    "type": "string",
                    "description": "Kind of contact. See List contact types."
                  },
                  "service": {
                    "type": "string",
                    "description": "What the contact does, for example PLUMBER. See List contact types."
                  },
                  "email": {
                    "type": "string",
                    "description": "Email address."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country name."
                  },
                  "city": {
                    "type": "string",
                    "description": "City."
                  },
                  "address": {
                    "type": "string",
                    "description": "Street address."
                  },
                  "website": {
                    "type": "string",
                    "description": "Website."
                  },
                  "phoneCountryCode": {
                    "type": "string",
                    "description": "Two-letter country code of the phone number."
                  },
                  "phoneDialCode": {
                    "type": "integer",
                    "description": "Dial code without the plus sign."
                  },
                  "phone": {
                    "type": "integer",
                    "description": "National phone number, digits only."
                  },
                  "notes": {
                    "type": "string",
                    "description": "Notes."
                  },
                  "externalLinks": {
                    "type": [
                      "array",
                      "object",
                      "null"
                    ],
                    "description": "Links to profiles on other sites."
                  }
                },
                "required": [
                  "firstName",
                  "type",
                  "service",
                  "country",
                  "phoneCountryCode",
                  "phoneDialCode",
                  "phone"
                ]
              },
              "example": {
                "firstName": "Jamie",
                "lastName": "Parker",
                "type": "SERVICE_PROVIDER",
                "service": "PLUMBER",
                "country": "Cyprus",
                "phoneCountryCode": "CY",
                "phoneDialCode": 357,
                "phone": 99123456
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 66
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/contacts/update": {
      "post": {
        "operationId": "contacts_update",
        "tags": [
          "Contacts"
        ],
        "summary": "Update a contact",
        "description": "Changes a contact. Send only the fields you want to change.",
        "x-required-permission": "contacts.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the contact."
                  },
                  "firstName": {
                    "type": "string",
                    "description": "First name."
                  },
                  "lastName": {
                    "type": "string",
                    "description": "Last name."
                  },
                  "type": {
                    "type": "string",
                    "description": "Kind of contact. See List contact types."
                  },
                  "service": {
                    "type": "string",
                    "description": "What the contact does, for example PLUMBER. See List contact types."
                  },
                  "email": {
                    "type": "string",
                    "description": "Email address."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country name."
                  },
                  "city": {
                    "type": "string",
                    "description": "City."
                  },
                  "address": {
                    "type": "string",
                    "description": "Street address."
                  },
                  "website": {
                    "type": "string",
                    "description": "Website."
                  },
                  "phoneCountryCode": {
                    "type": "string",
                    "description": "Two-letter country code of the phone number."
                  },
                  "phoneDialCode": {
                    "type": "integer",
                    "description": "Dial code without the plus sign."
                  },
                  "phone": {
                    "type": "integer",
                    "description": "National phone number, digits only."
                  },
                  "notes": {
                    "type": "string",
                    "description": "Notes."
                  },
                  "externalLinks": {
                    "type": [
                      "array",
                      "object",
                      "null"
                    ],
                    "description": "Links to profiles on other sites."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 66,
                "city": "Limassol"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "id"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 66
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/contacts/remove": {
      "post": {
        "operationId": "contacts_remove",
        "tags": [
          "Contacts"
        ],
        "summary": "Delete a contact",
        "description": "Permanently deletes a contact.",
        "x-required-permission": "contacts.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the contact to delete."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 66
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "id"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 66
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/contacts/search": {
      "post": {
        "operationId": "contacts_search",
        "tags": [
          "Contacts"
        ],
        "summary": "Search contacts",
        "description": "Returns a list of contacts, with only the fields you ask for.",
        "x-required-permission": "contacts.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fields"
                ],
                "properties": {
                  "fields": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "id",
                        "firstName",
                        "lastName",
                        "fullName",
                        "type",
                        "service",
                        "email",
                        "country",
                        "city",
                        "address",
                        "website",
                        "phoneCountryCode",
                        "phoneDialCode",
                        "phone",
                        "notes",
                        "externalLinks"
                      ]
                    },
                    "description": "The fields to return. Required."
                  },
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  },
                  "orderBy": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "ASC",
                        "DESC"
                      ]
                    },
                    "description": "Field to sort by. The field must also be listed in `fields`."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "How many records to return. Always set this, because leaving it out can return every record."
                  },
                  "offset": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "How many records to skip."
                  }
                }
              },
              "example": {
                "fields": [
                  "id",
                  "fullName",
                  "service"
                ],
                "limit": 25
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Contact ID."
                          },
                          "firstName": {
                            "type": "string",
                            "description": "First name."
                          },
                          "lastName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Last name."
                          },
                          "fullName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "First and last name together."
                          },
                          "type": {
                            "type": "string",
                            "description": "Kind of contact. See List contact types."
                          },
                          "service": {
                            "type": "string",
                            "description": "What the contact does, for example PLUMBER. See List contact types."
                          },
                          "email": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Email address."
                          },
                          "country": {
                            "type": "string",
                            "description": "Country name."
                          },
                          "city": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "City."
                          },
                          "address": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Street address."
                          },
                          "website": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Website."
                          },
                          "phoneCountryCode": {
                            "type": "string",
                            "description": "Two-letter country code of the phone number."
                          },
                          "phoneDialCode": {
                            "type": "integer",
                            "description": "Dial code without the plus sign."
                          },
                          "phone": {
                            "type": "integer",
                            "description": "National phone number, digits only."
                          },
                          "notes": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Notes."
                          },
                          "externalLinks": {
                            "type": [
                              "array",
                              "object",
                              "null"
                            ],
                            "description": "Links to profiles on other sites."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 66,
                      "fullName": "Jamie Parker",
                      "service": "PLUMBER"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/contacts/searchCount": {
      "post": {
        "operationId": "contacts_searchCount",
        "tags": [
          "Contacts"
        ],
        "summary": "Count contacts",
        "description": "Returns how many contacts match the filters. Use it together with Search to build pagination.",
        "x-required-permission": "contacts.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  }
                }
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": 42
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/contacts/getContactsTypesDisplayList": {
      "get": {
        "operationId": "contacts_getContactsTypesDisplayList",
        "tags": [
          "Contacts"
        ],
        "summary": "List contact types",
        "description": "Returns the allowed values for `type` and `service`.",
        "x-required-permission": "contacts.VIEW",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "description": "The allowed values."
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "PLUMBER",
                      "value": "PLUMBER"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/dashboards/getResourcesCount": {
      "post": {
        "operationId": "dashboards_getResourcesCount",
        "tags": [
          "Dashboards"
        ],
        "summary": "Get resource totals",
        "description": "Returns how many clients, properties and other records you have.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array"
                      ],
                      "description": "The report data."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/dashboards/getSalesPipeline": {
      "post": {
        "operationId": "dashboards_getSalesPipeline",
        "tags": [
          "Dashboards"
        ],
        "summary": "Get the sales pipeline",
        "description": "Returns how many clients are in each pipeline stage.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array"
                      ],
                      "description": "The report data."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/dashboards/getRecentlyAssignedClients": {
      "get": {
        "operationId": "dashboards_getRecentlyAssignedClients",
        "tags": [
          "Dashboards"
        ],
        "summary": "Get recently assigned clients",
        "description": "Returns the clients most recently assigned to the owner of the API key.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array"
                      ],
                      "description": "The report data."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/dashboards/getClientActivities": {
      "post": {
        "operationId": "dashboards_getClientActivities",
        "tags": [
          "Dashboards"
        ],
        "summary": "Get client activity over time",
        "description": "Returns activity totals for the period. Without `userIds`, it reports on the owner of the API key.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "range": {
                    "type": "string",
                    "enum": [
                      "THIS_WEEK",
                      "LAST_MONTH",
                      "LAST_6_MONTHS",
                      "THIS_YEAR"
                    ],
                    "description": "The time period to report on."
                  },
                  "userIds": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  }
                },
                "required": [
                  "range"
                ]
              },
              "example": {
                "range": "THIS_WEEK"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array"
                      ],
                      "description": "The report data."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/dashboards/getAgentsClients": {
      "post": {
        "operationId": "dashboards_getAgentsClients",
        "tags": [
          "Dashboards"
        ],
        "summary": "Get clients per agent",
        "description": "Returns how many clients each agent has.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array"
                      ],
                      "description": "The report data."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/dashboards/getUnassignedClients": {
      "post": {
        "operationId": "dashboards_getUnassignedClients",
        "tags": [
          "Dashboards"
        ],
        "summary": "Get unassigned clients",
        "description": "Returns the clients that no agent owns yet.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array"
                      ],
                      "description": "The report data."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/dashboards/getTeamEngagements": {
      "post": {
        "operationId": "dashboards_getTeamEngagements",
        "tags": [
          "Dashboards"
        ],
        "summary": "Get team engagements",
        "description": "Returns meeting and follow-up totals for your team during the period.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "range": {
                    "type": "string",
                    "enum": [
                      "THIS_WEEK",
                      "LAST_MONTH",
                      "LAST_6_MONTHS",
                      "THIS_YEAR"
                    ],
                    "description": "The time period to report on."
                  }
                },
                "required": [
                  "range"
                ]
              },
              "example": {
                "range": "THIS_WEEK"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array"
                      ],
                      "description": "The report data."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/dashboards/getCampaignsPerformance": {
      "post": {
        "operationId": "dashboards_getCampaignsPerformance",
        "tags": [
          "Dashboards"
        ],
        "summary": "Get campaign performance",
        "description": "Returns how each campaign is performing.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array"
                      ],
                      "description": "The report data."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/dashboards/getCampaignOverview": {
      "post": {
        "operationId": "dashboards_getCampaignOverview",
        "tags": [
          "Dashboards"
        ],
        "summary": "Get a campaign overview",
        "description": "Returns the numbers for one campaign.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "campaignId": {
                    "type": "integer",
                    "description": "ID of the campaign."
                  }
                },
                "required": [
                  "campaignId"
                ]
              },
              "example": {
                "campaignId": 45
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array"
                      ],
                      "description": "The report data."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/developers/create": {
      "post": {
        "operationId": "developers_create",
        "tags": [
          "Developers"
        ],
        "summary": "Create a developer",
        "description": "Adds a property developer.",
        "x-required-permission": "developers.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Developer name."
                  },
                  "contact": {
                    "type": "string",
                    "description": "Main contact person."
                  },
                  "email": {
                    "type": "string",
                    "description": "Email address."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country name."
                  },
                  "city": {
                    "type": "string",
                    "description": "City."
                  },
                  "address": {
                    "type": "string",
                    "description": "Street address."
                  },
                  "website": {
                    "type": "string",
                    "description": "Website."
                  },
                  "phoneCountryCode": {
                    "type": "string",
                    "description": "Two-letter country code of the phone number."
                  },
                  "phoneDialCode": {
                    "type": "integer",
                    "description": "Dial code without the plus sign."
                  },
                  "phone": {
                    "type": "integer",
                    "description": "National phone number, digits only."
                  },
                  "notes": {
                    "type": "string",
                    "description": "Notes."
                  },
                  "externalLinks": {
                    "type": [
                      "array",
                      "object",
                      "null"
                    ],
                    "description": "Links to profiles on other sites."
                  },
                  "contacts": {
                    "type": [
                      "array",
                      "object",
                      "null"
                    ],
                    "description": "Other contact people."
                  }
                },
                "required": [
                  "name",
                  "contact",
                  "country",
                  "phoneCountryCode",
                  "phoneDialCode",
                  "phone"
                ]
              },
              "example": {
                "name": "Harbor Homes",
                "contact": "Jamie Parker",
                "country": "Cyprus",
                "phoneCountryCode": "CY",
                "phoneDialCode": 357,
                "phone": 99123456
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 14
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/developers/update": {
      "post": {
        "operationId": "developers_update",
        "tags": [
          "Developers"
        ],
        "summary": "Update a developer",
        "description": "Changes a developer. Send only the fields you want to change.",
        "x-required-permission": "developers.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the developer."
                  },
                  "name": {
                    "type": "string",
                    "description": "Developer name."
                  },
                  "contact": {
                    "type": "string",
                    "description": "Main contact person."
                  },
                  "email": {
                    "type": "string",
                    "description": "Email address."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country name."
                  },
                  "city": {
                    "type": "string",
                    "description": "City."
                  },
                  "address": {
                    "type": "string",
                    "description": "Street address."
                  },
                  "website": {
                    "type": "string",
                    "description": "Website."
                  },
                  "phoneCountryCode": {
                    "type": "string",
                    "description": "Two-letter country code of the phone number."
                  },
                  "phoneDialCode": {
                    "type": "integer",
                    "description": "Dial code without the plus sign."
                  },
                  "phone": {
                    "type": "integer",
                    "description": "National phone number, digits only."
                  },
                  "notes": {
                    "type": "string",
                    "description": "Notes."
                  },
                  "externalLinks": {
                    "type": [
                      "array",
                      "object",
                      "null"
                    ],
                    "description": "Links to profiles on other sites."
                  },
                  "contacts": {
                    "type": [
                      "array",
                      "object",
                      "null"
                    ],
                    "description": "Other contact people."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 14,
                "city": "Limassol"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "id"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 14
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/developers/remove": {
      "post": {
        "operationId": "developers_remove",
        "tags": [
          "Developers"
        ],
        "summary": "Delete a developer",
        "description": "Permanently deletes a developer.",
        "x-required-permission": "developers.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the developer to delete."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 14
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 14
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/developers/search": {
      "post": {
        "operationId": "developers_search",
        "tags": [
          "Developers"
        ],
        "summary": "Search developers",
        "description": "Returns a list of developers, with only the fields you ask for.",
        "x-required-permission": "developers.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fields"
                ],
                "properties": {
                  "fields": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "id",
                        "name",
                        "contact",
                        "email",
                        "country",
                        "city",
                        "address",
                        "website",
                        "phoneCountryCode",
                        "phoneDialCode",
                        "phone",
                        "notes",
                        "externalLinks",
                        "contacts",
                        "logoUrl",
                        "iconUrl"
                      ]
                    },
                    "description": "The fields to return. Required."
                  },
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  },
                  "orderBy": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "ASC",
                        "DESC"
                      ]
                    },
                    "description": "Field to sort by. The field must also be listed in `fields`."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "How many records to return. Always set this, because leaving it out can return every record."
                  },
                  "offset": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "How many records to skip."
                  }
                }
              },
              "example": {
                "fields": [
                  "id",
                  "name",
                  "city"
                ],
                "limit": 25
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Developer ID."
                          },
                          "name": {
                            "type": "string",
                            "description": "Developer name."
                          },
                          "contact": {
                            "type": "string",
                            "description": "Main contact person."
                          },
                          "email": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Email address."
                          },
                          "country": {
                            "type": "string",
                            "description": "Country name."
                          },
                          "city": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "City."
                          },
                          "address": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Street address."
                          },
                          "website": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Website."
                          },
                          "phoneCountryCode": {
                            "type": "string",
                            "description": "Two-letter country code of the phone number."
                          },
                          "phoneDialCode": {
                            "type": "integer",
                            "description": "Dial code without the plus sign."
                          },
                          "phone": {
                            "type": "integer",
                            "description": "National phone number, digits only."
                          },
                          "notes": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Notes."
                          },
                          "externalLinks": {
                            "type": [
                              "array",
                              "object",
                              "null"
                            ],
                            "description": "Links to profiles on other sites."
                          },
                          "contacts": {
                            "type": [
                              "array",
                              "object",
                              "null"
                            ],
                            "description": "Other contact people."
                          },
                          "logoUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Logo URL."
                          },
                          "iconUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Icon URL."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 14,
                      "name": "Harbor Homes",
                      "city": "Limassol"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/developers/searchCount": {
      "post": {
        "operationId": "developers_searchCount",
        "tags": [
          "Developers"
        ],
        "summary": "Count developers",
        "description": "Returns how many developers match the filters. Use it together with Search to build pagination.",
        "x-required-permission": "developers.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  }
                }
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": 42
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/developers/getDisplayList": {
      "post": {
        "operationId": "developers_getDisplayList",
        "tags": [
          "Developers"
        ],
        "summary": "List developers for a picker",
        "description": "Returns developer names and IDs, handy for dropdowns.",
        "x-required-permission": "properties.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "value": {
                            "type": "integer"
                          },
                          "iconUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "Harbor Homes",
                      "value": 14,
                      "iconUrl": null
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/developers/updateDeveloperLogo": {
      "post": {
        "operationId": "developers_updateDeveloperLogo",
        "tags": [
          "Developers"
        ],
        "summary": "Upload a developer logo",
        "description": "Uploads or replaces the logo. Send the request as `multipart/form-data`, with the file in a field called `logoFile`.",
        "x-required-permission": "developers.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "developerId": {
                    "type": "integer",
                    "description": "ID of the developer."
                  },
                  "logoFile": {
                    "type": "string",
                    "format": "binary",
                    "description": "The image file."
                  }
                },
                "required": [
                  "developerId",
                  "logoFile"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/developers/removeDeveloperLogo": {
      "post": {
        "operationId": "developers_removeDeveloperLogo",
        "tags": [
          "Developers"
        ],
        "summary": "Delete a developer logo",
        "description": "Removes the logo.",
        "x-required-permission": "developers.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "developerId": {
                    "type": "integer",
                    "description": "ID of the developer."
                  }
                },
                "required": [
                  "developerId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/developers/updateDeveloperIcon": {
      "post": {
        "operationId": "developers_updateDeveloperIcon",
        "tags": [
          "Developers"
        ],
        "summary": "Upload a developer icon",
        "description": "Uploads or replaces the icon. Send the request as `multipart/form-data`, with the file in a field called `iconFile`.",
        "x-required-permission": "developers.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "developerId": {
                    "type": "integer",
                    "description": "ID of the developer."
                  },
                  "iconFile": {
                    "type": "string",
                    "format": "binary",
                    "description": "The image file."
                  }
                },
                "required": [
                  "developerId",
                  "iconFile"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/developers/removeDeveloperIcon": {
      "post": {
        "operationId": "developers_removeDeveloperIcon",
        "tags": [
          "Developers"
        ],
        "summary": "Delete a developer icon",
        "description": "Removes the icon.",
        "x-required-permission": "developers.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "developerId": {
                    "type": "integer",
                    "description": "ID of the developer."
                  }
                },
                "required": [
                  "developerId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/emailSenders/create": {
      "post": {
        "operationId": "emailSenders_create",
        "tags": [
          "Email senders"
        ],
        "summary": "Create an email sender",
        "description": "Adds a sender address.",
        "x-required-permission": "emails.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name people see."
                  },
                  "username": {
                    "type": "string",
                    "description": "The part of the address before the @."
                  },
                  "isDefault": {
                    "type": "boolean",
                    "description": "True for the sender used by default."
                  }
                },
                "required": [
                  "name",
                  "username"
                ]
              },
              "example": {
                "name": "Sales team",
                "username": "sales",
                "isDefault": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/emailSenders/update": {
      "post": {
        "operationId": "emailSenders_update",
        "tags": [
          "Email senders"
        ],
        "summary": "Update an email sender",
        "description": "Changes a sender. Always send `name` and `username`. Setting `isDefault` to true removes it from the previous default sender.",
        "x-required-permission": "emails.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the sender."
                  },
                  "name": {
                    "type": "string",
                    "description": "The name people see."
                  },
                  "username": {
                    "type": "string",
                    "description": "The part of the address before the @."
                  },
                  "isDefault": {
                    "type": "boolean",
                    "description": "True for the sender used by default."
                  }
                },
                "required": [
                  "id",
                  "name",
                  "username"
                ]
              },
              "example": {
                "id": 4,
                "name": "Sales",
                "username": "sales"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/emailSenders/remove": {
      "post": {
        "operationId": "emailSenders_remove",
        "tags": [
          "Email senders"
        ],
        "summary": "Delete an email sender",
        "description": "Permanently deletes a sender.",
        "x-required-permission": "emails.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the sender to delete."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 4
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/emailSenders/search": {
      "post": {
        "operationId": "emailSenders_search",
        "tags": [
          "Email senders"
        ],
        "summary": "Search email senders",
        "description": "Returns a list of email senders, with only the fields you ask for.",
        "x-required-permission": "emails.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fields"
                ],
                "properties": {
                  "fields": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "id",
                        "name",
                        "username",
                        "email",
                        "isDefault",
                        "assignedTemplatesCount"
                      ]
                    },
                    "description": "The fields to return. Required."
                  },
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  },
                  "orderBy": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "ASC",
                        "DESC"
                      ]
                    },
                    "description": "Field to sort by. The field must also be listed in `fields`."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "How many records to return. Always set this, because leaving it out can return every record."
                  },
                  "offset": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "How many records to skip."
                  }
                }
              },
              "example": {
                "fields": [
                  "id",
                  "name",
                  "email"
                ],
                "limit": 25
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Sender ID."
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The name people see."
                          },
                          "username": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The part of the address before the @."
                          },
                          "email": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Full email address."
                          },
                          "isDefault": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "True for the sender used by default."
                          },
                          "assignedTemplatesCount": {
                            "type": [
                              "integer",
                              "string",
                              "null"
                            ],
                            "description": "How many templates use this sender."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 4,
                      "name": "Sales team",
                      "email": "sales@mail.estactics.com"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/emailSenders/searchCount": {
      "post": {
        "operationId": "emailSenders_searchCount",
        "tags": [
          "Email senders"
        ],
        "summary": "Count email senders",
        "description": "Returns how many email senders match the filters. Use it together with Search to build pagination.",
        "x-required-permission": "emails.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  }
                }
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": 42
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/emailSenders/getDisplayList": {
      "post": {
        "operationId": "emailSenders_getDisplayList",
        "tags": [
          "Email senders"
        ],
        "summary": "List email senders for a picker",
        "description": "Returns sender names and IDs, handy for dropdowns.",
        "x-required-permission": "emails.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/emailTemplates/search": {
      "post": {
        "operationId": "emailTemplates_search",
        "tags": [
          "Email templates"
        ],
        "summary": "Search email templates",
        "description": "Returns a list of email templates, with only the fields you ask for.",
        "x-required-permission": "emails.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fields"
                ],
                "properties": {
                  "fields": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "id",
                        "name",
                        "channel",
                        "topic",
                        "language",
                        "subject",
                        "bodyContentHtml",
                        "senderId",
                        "parentTemplateId",
                        "translationsCount"
                      ]
                    },
                    "description": "The fields to return. Required."
                  },
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  },
                  "orderBy": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "ASC",
                        "DESC"
                      ]
                    },
                    "description": "Field to sort by. The field must also be listed in `fields`."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "How many records to return. Always set this, because leaving it out can return every record."
                  },
                  "offset": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "How many records to skip."
                  }
                }
              },
              "example": {
                "fields": [
                  "id",
                  "name",
                  "channel",
                  "topic"
                ],
                "limit": 25
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Template ID."
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Template name."
                          },
                          "channel": {
                            "type": "string",
                            "description": "Channel of the template."
                          },
                          "topic": {
                            "type": "string",
                            "description": "Topic of the template."
                          },
                          "language": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Language code of the template."
                          },
                          "subject": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Subject line."
                          },
                          "bodyContentHtml": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Email body as HTML."
                          },
                          "senderId": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "ID of the sender."
                          },
                          "parentTemplateId": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "ID of the main template, when this one is a translation."
                          },
                          "translationsCount": {
                            "type": [
                              "integer",
                              "string",
                              "null"
                            ],
                            "description": "How many translations the template has."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 33,
                      "name": "Welcome",
                      "channel": "CLIENTS",
                      "topic": "WELCOME"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/emailTemplates/searchCount": {
      "post": {
        "operationId": "emailTemplates_searchCount",
        "tags": [
          "Email templates"
        ],
        "summary": "Count email templates",
        "description": "Returns how many email templates match the filters. Use it together with Search to build pagination.",
        "x-required-permission": "emails.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  }
                }
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": 42
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/emailTemplates/getEmailChannelsTopics": {
      "post": {
        "operationId": "emailTemplates_getEmailChannelsTopics",
        "tags": [
          "Email templates"
        ],
        "summary": "List email channels and topics",
        "description": "Returns the channels and topics you can create templates for.",
        "x-required-permission": "emails.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/emailTemplates/getPreviewEmailLayout": {
      "post": {
        "operationId": "emailTemplates_getPreviewEmailLayout",
        "tags": [
          "Email templates"
        ],
        "summary": "Preview an email",
        "description": "Returns the full email as it would be sent, using your branding.",
        "x-required-permission": "emails.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "language": {
                    "type": "string"
                  },
                  "subject": {
                    "type": "string"
                  },
                  "bodyContentHtml": {
                    "type": "string"
                  },
                  "channel": {
                    "type": "string"
                  },
                  "topic": {
                    "type": "string"
                  }
                },
                "required": [
                  "language",
                  "bodyContentHtml",
                  "channel",
                  "topic"
                ]
              },
              "example": {
                "language": "en",
                "subject": "Welcome",
                "bodyContentHtml": "<p>Hello there</p>",
                "channel": "NOTIFICATIONS",
                "topic": "CLIENT_WELCOMING"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "string"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/emailTemplates/createChannelTopicGroupTemplates": {
      "post": {
        "operationId": "emailTemplates_createChannelTopicGroupTemplates",
        "tags": [
          "Email templates"
        ],
        "summary": "Create email templates",
        "description": "Creates a set of templates for one channel and topic, one per language.",
        "x-required-permission": "emails.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "isDefault": {
                    "type": "boolean",
                    "description": "True for the default template of this channel and topic."
                  },
                  "channel": {
                    "type": "string",
                    "description": "Channel of the template. See List email channels and topics."
                  },
                  "topic": {
                    "type": "string",
                    "description": "Topic of the template."
                  },
                  "templates": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "senderId": {
                          "type": "integer"
                        },
                        "language": {
                          "type": "string"
                        },
                        "subject": {
                          "type": "string"
                        },
                        "bodyContentHtml": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "name",
                        "senderId",
                        "language",
                        "subject",
                        "bodyContentHtml"
                      ]
                    }
                  }
                },
                "required": [
                  "channel",
                  "topic",
                  "templates"
                ]
              },
              "example": {
                "isDefault": false,
                "channel": "NOTIFICATIONS",
                "topic": "CLIENT_WELCOMING",
                "templates": [
                  {
                    "name": "Welcome",
                    "senderId": 4,
                    "language": "en",
                    "subject": "Welcome",
                    "bodyContentHtml": "<p>Hello there</p>"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/emailTemplates/updateChannelTopicGroupTemplates": {
      "post": {
        "operationId": "emailTemplates_updateChannelTopicGroupTemplates",
        "tags": [
          "Email templates"
        ],
        "summary": "Update email templates",
        "description": "Updates the set of templates for one channel and topic.",
        "x-required-permission": "emails.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "isDefault": {
                    "type": "boolean",
                    "description": "True for the default template of this channel and topic."
                  },
                  "channel": {
                    "type": "string",
                    "description": "Channel of the template. See List email channels and topics."
                  },
                  "topic": {
                    "type": "string",
                    "description": "Topic of the template."
                  },
                  "templates": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "parentTemplateId": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "name": {
                          "type": "string"
                        },
                        "senderId": {
                          "type": "integer"
                        },
                        "language": {
                          "type": "string"
                        },
                        "subject": {
                          "type": "string"
                        },
                        "bodyContentHtml": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "required": [
                  "channel",
                  "topic",
                  "templates"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/emailTemplates/addChannelTopicGroupTemplateLanguage": {
      "post": {
        "operationId": "emailTemplates_addChannelTopicGroupTemplateLanguage",
        "tags": [
          "Email templates"
        ],
        "summary": "Add a template language",
        "description": "Adds a translation to an existing template.",
        "x-required-permission": "emails.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "parentTemplateId": {
                    "type": "integer",
                    "description": "ID of the main template."
                  },
                  "name": {
                    "type": "string"
                  },
                  "senderId": {
                    "type": "integer"
                  },
                  "language": {
                    "type": "string"
                  },
                  "subject": {
                    "type": "string"
                  },
                  "bodyContentHtml": {
                    "type": "string"
                  }
                },
                "required": [
                  "parentTemplateId",
                  "name",
                  "senderId",
                  "language",
                  "subject",
                  "bodyContentHtml"
                ]
              },
              "example": {
                "parentTemplateId": 33,
                "name": "Welcome",
                "senderId": 4,
                "language": "el",
                "subject": "Welcome",
                "bodyContentHtml": "<p>Hello there</p>"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/emailTemplates/remove": {
      "post": {
        "operationId": "emailTemplates_remove",
        "tags": [
          "Email templates"
        ],
        "summary": "Delete an email template",
        "description": "Permanently deletes a template.",
        "x-required-permission": "emails.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the template to delete."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 33
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/emails/search": {
      "post": {
        "operationId": "emails_search",
        "tags": [
          "Emails"
        ],
        "summary": "Search emails",
        "description": "Returns a list of emails, with only the fields you ask for.",
        "x-required-permission": "emails.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fields"
                ],
                "properties": {
                  "fields": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "id",
                        "status",
                        "senderName",
                        "senderEmail",
                        "toEmail",
                        "subject",
                        "channel",
                        "topic",
                        "createdAt",
                        "seenAt"
                      ]
                    },
                    "description": "The fields to return. Required."
                  },
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  },
                  "orderBy": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "ASC",
                        "DESC"
                      ]
                    },
                    "description": "Field to sort by. The field must also be listed in `fields`."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "How many records to return. Always set this, because leaving it out can return every record."
                  },
                  "offset": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "How many records to skip."
                  }
                }
              },
              "example": {
                "fields": [
                  "id",
                  "toEmail",
                  "subject",
                  "status"
                ],
                "orderBy": {
                  "id": "DESC"
                },
                "limit": 25
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Email ID."
                          },
                          "status": {
                            "type": "string",
                            "description": "Delivery status."
                          },
                          "senderName": {
                            "type": "string",
                            "description": "Sender name."
                          },
                          "senderEmail": {
                            "type": "string",
                            "description": "Sender address."
                          },
                          "toEmail": {
                            "type": "string",
                            "description": "Recipient address."
                          },
                          "subject": {
                            "type": "string",
                            "description": "Subject line."
                          },
                          "channel": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Channel of the email."
                          },
                          "topic": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Topic of the email."
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the email was created."
                          },
                          "seenAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the recipient opened the email."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 930,
                      "toEmail": "alex.morgan@example.com",
                      "subject": "Welcome",
                      "status": "SENT"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/emails/searchCount": {
      "post": {
        "operationId": "emails_searchCount",
        "tags": [
          "Emails"
        ],
        "summary": "Count emails",
        "description": "Returns how many emails match the filters. Use it together with Search to build pagination.",
        "x-required-permission": "emails.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  }
                }
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": 42
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/externalAgents/create": {
      "post": {
        "operationId": "externalAgents_create",
        "tags": [
          "External agents"
        ],
        "summary": "Create an external agent",
        "description": "Adds an external agent.",
        "x-required-permission": "externalAgents.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "firstName": {
                    "type": "string",
                    "description": "First name."
                  },
                  "lastName": {
                    "type": "string",
                    "description": "Last name."
                  },
                  "email": {
                    "type": "string",
                    "description": "Email address."
                  },
                  "gender": {
                    "type": "string",
                    "enum": [
                      "MALE",
                      "FEMALE"
                    ],
                    "description": "Gender."
                  },
                  "company": {
                    "type": "string",
                    "description": "Agency the person works for."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country name."
                  },
                  "city": {
                    "type": "string",
                    "description": "City."
                  },
                  "address": {
                    "type": "string",
                    "description": "Street address."
                  },
                  "phoneCountryCode": {
                    "type": "string",
                    "description": "Two-letter country code of the phone number."
                  },
                  "phoneDialCode": {
                    "type": "integer",
                    "description": "Dial code without the plus sign."
                  },
                  "phone": {
                    "type": "integer",
                    "description": "National phone number, digits only."
                  },
                  "notes": {
                    "type": "string",
                    "description": "Notes."
                  },
                  "externalLinks": {
                    "type": [
                      "array",
                      "object",
                      "null"
                    ],
                    "description": "Links to profiles on other sites."
                  }
                },
                "required": [
                  "firstName",
                  "gender",
                  "country",
                  "phoneCountryCode",
                  "phoneDialCode",
                  "phone"
                ]
              },
              "example": {
                "firstName": "Robin",
                "lastName": "Taylor",
                "gender": "MALE",
                "country": "Cyprus",
                "phoneCountryCode": "CY",
                "phoneDialCode": 357,
                "phone": 99123456
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 9
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/externalAgents/update": {
      "post": {
        "operationId": "externalAgents_update",
        "tags": [
          "External agents"
        ],
        "summary": "Update an external agent",
        "description": "Changes an external agent. Send only the fields you want to change.",
        "x-required-permission": "externalAgents.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the external agent."
                  },
                  "firstName": {
                    "type": "string",
                    "description": "First name."
                  },
                  "lastName": {
                    "type": "string",
                    "description": "Last name."
                  },
                  "email": {
                    "type": "string",
                    "description": "Email address."
                  },
                  "gender": {
                    "type": "string",
                    "enum": [
                      "MALE",
                      "FEMALE"
                    ],
                    "description": "Gender."
                  },
                  "company": {
                    "type": "string",
                    "description": "Agency the person works for."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country name."
                  },
                  "city": {
                    "type": "string",
                    "description": "City."
                  },
                  "address": {
                    "type": "string",
                    "description": "Street address."
                  },
                  "phoneCountryCode": {
                    "type": "string",
                    "description": "Two-letter country code of the phone number."
                  },
                  "phoneDialCode": {
                    "type": "integer",
                    "description": "Dial code without the plus sign."
                  },
                  "phone": {
                    "type": "integer",
                    "description": "National phone number, digits only."
                  },
                  "notes": {
                    "type": "string",
                    "description": "Notes."
                  },
                  "externalLinks": {
                    "type": [
                      "array",
                      "object",
                      "null"
                    ],
                    "description": "Links to profiles on other sites."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 9,
                "company": "Your agency"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "id"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 9
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/externalAgents/remove": {
      "post": {
        "operationId": "externalAgents_remove",
        "tags": [
          "External agents"
        ],
        "summary": "Delete an external agent",
        "description": "Permanently deletes an external agent.",
        "x-required-permission": "externalAgents.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the external agent to delete."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 9
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 9
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/externalAgents/search": {
      "post": {
        "operationId": "externalAgents_search",
        "tags": [
          "External agents"
        ],
        "summary": "Search external agents",
        "description": "Returns a list of external agents, with only the fields you ask for.",
        "x-required-permission": "externalAgents.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fields"
                ],
                "properties": {
                  "fields": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "id",
                        "firstName",
                        "lastName",
                        "fullName",
                        "email",
                        "gender",
                        "company",
                        "country",
                        "city",
                        "address",
                        "phoneCountryCode",
                        "phoneDialCode",
                        "phone",
                        "notes",
                        "externalLinks",
                        "profilePhoto"
                      ]
                    },
                    "description": "The fields to return. Required."
                  },
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  },
                  "orderBy": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "ASC",
                        "DESC"
                      ]
                    },
                    "description": "Field to sort by. The field must also be listed in `fields`."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "How many records to return. Always set this, because leaving it out can return every record."
                  },
                  "offset": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "How many records to skip."
                  }
                }
              },
              "example": {
                "fields": [
                  "id",
                  "fullName",
                  "company"
                ],
                "limit": 25
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "External agent ID."
                          },
                          "firstName": {
                            "type": "string",
                            "description": "First name."
                          },
                          "lastName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Last name."
                          },
                          "fullName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "First and last name together."
                          },
                          "email": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Email address."
                          },
                          "gender": {
                            "type": "string",
                            "enum": [
                              "MALE",
                              "FEMALE"
                            ],
                            "description": "Gender."
                          },
                          "company": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Agency the person works for."
                          },
                          "country": {
                            "type": "string",
                            "description": "Country name."
                          },
                          "city": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "City."
                          },
                          "address": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Street address."
                          },
                          "phoneCountryCode": {
                            "type": "string",
                            "description": "Two-letter country code of the phone number."
                          },
                          "phoneDialCode": {
                            "type": "integer",
                            "description": "Dial code without the plus sign."
                          },
                          "phone": {
                            "type": "integer",
                            "description": "National phone number, digits only."
                          },
                          "notes": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Notes."
                          },
                          "externalLinks": {
                            "type": [
                              "array",
                              "object",
                              "null"
                            ],
                            "description": "Links to profiles on other sites."
                          },
                          "profilePhoto": {
                            "type": [
                              "object",
                              "string",
                              "null"
                            ],
                            "description": "Profile photo."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 9,
                      "fullName": "Robin Taylor",
                      "company": null
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/externalAgents/searchCount": {
      "post": {
        "operationId": "externalAgents_searchCount",
        "tags": [
          "External agents"
        ],
        "summary": "Count external agents",
        "description": "Returns how many external agents match the filters. Use it together with Search to build pagination.",
        "x-required-permission": "externalAgents.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  }
                }
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": 42
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/externalAgents/getDisplayList": {
      "post": {
        "operationId": "externalAgents_getDisplayList",
        "tags": [
          "External agents"
        ],
        "summary": "List external agents for a picker",
        "description": "Returns external agent names and IDs, handy for dropdowns.",
        "x-required-permission": "externalAgents.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "Robin Taylor",
                      "value": 9
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/externalAgents/updateExternalAgentProfilePhoto": {
      "post": {
        "operationId": "externalAgents_updateExternalAgentProfilePhoto",
        "tags": [
          "External agents"
        ],
        "summary": "Upload an external agent photo",
        "description": "Uploads or replaces the profile photo. Send the request as `multipart/form-data`, with the file in a field called `profilePhotoFile`.",
        "x-required-permission": "externalAgents.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "externalAgentId": {
                    "type": "integer",
                    "description": "ID of the external agent."
                  },
                  "profilePhotoFile": {
                    "type": "string",
                    "format": "binary",
                    "description": "The image file."
                  }
                },
                "required": [
                  "externalAgentId",
                  "profilePhotoFile"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/externalAgents/removeExternalAgentProfilePhoto": {
      "post": {
        "operationId": "externalAgents_removeExternalAgentProfilePhoto",
        "tags": [
          "External agents"
        ],
        "summary": "Delete an external agent photo",
        "description": "Removes the profile photo.",
        "x-required-permission": "externalAgents.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "externalAgentId": {
                    "type": "integer",
                    "description": "ID of the external agent."
                  }
                },
                "required": [
                  "externalAgentId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/labels/create": {
      "post": {
        "operationId": "labels_create",
        "tags": [
          "Labels"
        ],
        "summary": "Create a label",
        "description": "Adds a new label to your organization.",
        "x-required-permission": "labels.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Label name."
                  },
                  "nameTranslations": {
                    "type": "object",
                    "description": "Label name per language code, for example `{ \"el\": \"Ετικέτα\" }`."
                  },
                  "color": {
                    "type": "string",
                    "description": "Color, for example #0c68e9."
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "Hot lead",
                "color": "#d4570f"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 12
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/labels/update": {
      "post": {
        "operationId": "labels_update",
        "tags": [
          "Labels"
        ],
        "summary": "Update a label",
        "description": "Changes a label. Send only the fields you want to change.",
        "x-required-permission": "labels.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the label."
                  },
                  "name": {
                    "type": "string",
                    "description": "Label name."
                  },
                  "nameTranslations": {
                    "type": "object",
                    "description": "Label name per language code, for example `{ \"el\": \"Ετικέτα\" }`."
                  },
                  "color": {
                    "type": "string",
                    "description": "Color, for example #0c68e9."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 12,
                "color": "#17803d"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "id"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 12
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/labels/remove": {
      "post": {
        "operationId": "labels_remove",
        "tags": [
          "Labels"
        ],
        "summary": "Delete a label",
        "description": "Permanently deletes a label.",
        "x-required-permission": "labels.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the label to delete."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 12
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "id"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 12
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/labels/search": {
      "post": {
        "operationId": "labels_search",
        "tags": [
          "Labels"
        ],
        "summary": "Search labels",
        "description": "Returns a list of labels, with only the fields you ask for.",
        "x-required-permission": "labels.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fields"
                ],
                "properties": {
                  "fields": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "id",
                        "name",
                        "nameTranslations",
                        "color"
                      ]
                    },
                    "description": "The fields to return. Required."
                  },
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  },
                  "orderBy": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "ASC",
                        "DESC"
                      ]
                    },
                    "description": "Field to sort by. The field must also be listed in `fields`."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "How many records to return. Always set this, because leaving it out can return every record."
                  },
                  "offset": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "How many records to skip."
                  }
                }
              },
              "example": {
                "fields": [
                  "id",
                  "name",
                  "color"
                ],
                "limit": 25
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Label ID."
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Label name."
                          },
                          "nameTranslations": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "description": "Label name per language code, for example `{ \"el\": \"Ετικέτα\" }`."
                          },
                          "color": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Color, for example #0c68e9."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 12,
                      "name": "Hot lead",
                      "color": "#d4570f"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/labels/searchCount": {
      "post": {
        "operationId": "labels_searchCount",
        "tags": [
          "Labels"
        ],
        "summary": "Count labels",
        "description": "Returns how many labels match the filters. Use it together with Search to build pagination.",
        "x-required-permission": "labels.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  }
                }
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": 42
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/labels/getOrgLabelsDisplayList": {
      "post": {
        "operationId": "labels_getOrgLabelsDisplayList",
        "tags": [
          "Labels"
        ],
        "summary": "List labels for a picker",
        "description": "Returns your labels with their names in the language you ask for.",
        "x-required-permission": "labels.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "locale": {
                    "type": "string",
                    "description": "Language code for the label names. Defaults to en."
                  }
                }
              },
              "example": {
                "locale": "en"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "value": {
                            "type": "integer"
                          },
                          "color": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "Hot lead",
                      "value": 12,
                      "color": "#d4570f"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/leadsRegistrations/getClientRegistrationsSources": {
      "post": {
        "operationId": "leadsRegistrations_getClientRegistrationsSources",
        "tags": [
          "Lead registrations"
        ],
        "summary": "List registrations of a client",
        "description": "Returns every campaign a client signed up through, newest first.",
        "x-required-permission": "clients.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "clientId": {
                    "type": "integer",
                    "description": "ID of the client."
                  }
                },
                "required": [
                  "clientId"
                ]
              },
              "example": {
                "clientId": 1042
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Registration ID."
                          },
                          "clientId": {
                            "type": "integer",
                            "description": "ID of the client."
                          },
                          "registeredAt": {
                            "type": "string",
                            "description": "When the client registered."
                          },
                          "campaignCode": {
                            "type": "string",
                            "description": "Code of the campaign."
                          },
                          "campaign": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Campaign name."
                          },
                          "brand": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Brand name."
                          },
                          "firstName": {
                            "type": "string",
                            "description": "First name that was submitted."
                          },
                          "lastName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Last name that was submitted."
                          },
                          "email": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Email that was submitted."
                          },
                          "phone": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Phone number that was submitted."
                          },
                          "utmSource": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "UTM source."
                          },
                          "utmMedium": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "UTM medium."
                          },
                          "utmCampaign": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "UTM campaign."
                          },
                          "utmTerm": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "UTM term."
                          },
                          "utmContent": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "UTM content."
                          },
                          "form": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "description": "Extra answers from the form."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 77,
                      "clientId": 1042,
                      "campaignCode": "SPRING",
                      "campaign": "Spring launch",
                      "registeredAt": "2026-11-09 18:39:46"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/marketingCampaigns/create": {
      "post": {
        "operationId": "marketingCampaigns_create",
        "tags": [
          "Marketing campaigns"
        ],
        "summary": "Create a campaign",
        "description": "Adds a new campaign. A `campaignCode` is generated once the campaign is active.",
        "x-required-permission": "marketingCampaigns.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Campaign name."
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "SOCIAL_MEDIA",
                      "EMAIL",
                      "SMS",
                      "REFERRAL",
                      "SEO",
                      "SEM",
                      "DISPLAY",
                      "AFFILIATE",
                      "INFLUENCER",
                      "EVENT",
                      "OFFLINE",
                      "PUSH_NOTIFICATION",
                      "RETARGETING",
                      "PARTNERSHIP",
                      "PRODUCT_LAUNCH",
                      "BRAND_AWARENESS",
                      "COLD_OUTREACH",
                      "LEAD_MAGNET",
                      "ORGANIC",
                      "OTHER"
                    ],
                    "description": "Kind of campaign."
                  },
                  "platforms": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Where the campaign runs. See List campaign platforms."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "DRAFT",
                      "ACTIVE",
                      "PAUSED",
                      "COMPLETED"
                    ],
                    "description": "Campaign status."
                  },
                  "startedAt": {
                    "type": "string",
                    "description": "When the campaign started."
                  },
                  "languageCode": {
                    "type": "string",
                    "description": "Language code of the campaign."
                  },
                  "country": {
                    "type": "string",
                    "description": "Target country."
                  },
                  "brandId": {
                    "type": "integer",
                    "description": "ID of the brand running the campaign."
                  },
                  "defaultHierarchyAssigneeId": {
                    "type": "integer",
                    "description": "ID of the team that receives new clients from this campaign."
                  },
                  "defaultUserAssigneeId": {
                    "type": "integer",
                    "description": "ID of the agent who receives new clients from this campaign."
                  }
                },
                "required": [
                  "name",
                  "type",
                  "brandId",
                  "defaultHierarchyAssigneeId"
                ]
              },
              "example": {
                "name": "Spring launch",
                "type": "SOCIAL_MEDIA",
                "platforms": [
                  "FACEBOOK"
                ],
                "status": "ACTIVE",
                "brandId": 3,
                "defaultHierarchyAssigneeId": 7
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "campaignCode": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 45,
                    "campaignCode": "x7Kq2p",
                    "status": "ACTIVE"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/marketingCampaigns/update": {
      "post": {
        "operationId": "marketingCampaigns_update",
        "tags": [
          "Marketing campaigns"
        ],
        "summary": "Update a campaign",
        "description": "Changes a campaign. Always send `defaultHierarchyAssigneeId`, even when it does not change.",
        "x-required-permission": "marketingCampaigns.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the campaign."
                  },
                  "name": {
                    "type": "string",
                    "description": "Campaign name."
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "SOCIAL_MEDIA",
                      "EMAIL",
                      "SMS",
                      "REFERRAL",
                      "SEO",
                      "SEM",
                      "DISPLAY",
                      "AFFILIATE",
                      "INFLUENCER",
                      "EVENT",
                      "OFFLINE",
                      "PUSH_NOTIFICATION",
                      "RETARGETING",
                      "PARTNERSHIP",
                      "PRODUCT_LAUNCH",
                      "BRAND_AWARENESS",
                      "COLD_OUTREACH",
                      "LEAD_MAGNET",
                      "ORGANIC",
                      "OTHER"
                    ],
                    "description": "Kind of campaign."
                  },
                  "platforms": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Where the campaign runs. See List campaign platforms."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "DRAFT",
                      "ACTIVE",
                      "PAUSED",
                      "COMPLETED"
                    ],
                    "description": "Campaign status."
                  },
                  "startedAt": {
                    "type": "string",
                    "description": "When the campaign started."
                  },
                  "languageCode": {
                    "type": "string",
                    "description": "Language code of the campaign."
                  },
                  "country": {
                    "type": "string",
                    "description": "Target country."
                  },
                  "brandId": {
                    "type": "integer",
                    "description": "ID of the brand running the campaign."
                  },
                  "defaultHierarchyAssigneeId": {
                    "type": "integer",
                    "description": "ID of the team that receives new clients from this campaign."
                  },
                  "defaultUserAssigneeId": {
                    "type": "integer",
                    "description": "ID of the agent who receives new clients from this campaign."
                  }
                },
                "required": [
                  "id",
                  "defaultHierarchyAssigneeId"
                ]
              },
              "example": {
                "id": 45,
                "status": "PAUSED",
                "defaultHierarchyAssigneeId": 7
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "campaignCode": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 45,
                    "campaignCode": "x7Kq2p",
                    "status": "PAUSED"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/marketingCampaigns/remove": {
      "post": {
        "operationId": "marketingCampaigns_remove",
        "tags": [
          "Marketing campaigns"
        ],
        "summary": "Delete a campaign",
        "description": "Permanently deletes a campaign.",
        "x-required-permission": "marketingCampaigns.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the campaign to delete."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 45
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "id"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 45
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/marketingCampaigns/search": {
      "post": {
        "operationId": "marketingCampaigns_search",
        "tags": [
          "Marketing campaigns"
        ],
        "summary": "Search campaigns",
        "description": "Returns a list of campaigns, with only the fields you ask for.",
        "x-required-permission": "marketingCampaigns.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fields"
                ],
                "properties": {
                  "fields": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "id",
                        "name",
                        "campaignCode",
                        "type",
                        "platforms",
                        "status",
                        "startedAt",
                        "languageCode",
                        "country",
                        "brandId",
                        "brand",
                        "defaultHierarchyAssigneeId",
                        "defaultHierarchyAssignee",
                        "defaultUserAssigneeId",
                        "defaultUserAssigneeFullName",
                        "campaignImageUrl",
                        "leadsCount",
                        "clientsCount"
                      ]
                    },
                    "description": "The fields to return. Required."
                  },
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  },
                  "orderBy": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "ASC",
                        "DESC"
                      ]
                    },
                    "description": "Field to sort by. The field must also be listed in `fields`."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "How many records to return. Always set this, because leaving it out can return every record."
                  },
                  "offset": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "How many records to skip."
                  }
                }
              },
              "example": {
                "fields": [
                  "id",
                  "name",
                  "campaignCode",
                  "status"
                ],
                "limit": 25
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Campaign ID."
                          },
                          "name": {
                            "type": "string",
                            "description": "Campaign name."
                          },
                          "campaignCode": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Unique code. Send it when you create a client, so the client is linked to this campaign. Generated when the campaign becomes active."
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "SOCIAL_MEDIA",
                              "EMAIL",
                              "SMS",
                              "REFERRAL",
                              "SEO",
                              "SEM",
                              "DISPLAY",
                              "AFFILIATE",
                              "INFLUENCER",
                              "EVENT",
                              "OFFLINE",
                              "PUSH_NOTIFICATION",
                              "RETARGETING",
                              "PARTNERSHIP",
                              "PRODUCT_LAUNCH",
                              "BRAND_AWARENESS",
                              "COLD_OUTREACH",
                              "LEAD_MAGNET",
                              "ORGANIC",
                              "OTHER"
                            ],
                            "description": "Kind of campaign."
                          },
                          "platforms": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "string"
                            },
                            "description": "Where the campaign runs. See List campaign platforms."
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "DRAFT",
                              "ACTIVE",
                              "PAUSED",
                              "COMPLETED",
                              null
                            ],
                            "description": "Campaign status."
                          },
                          "startedAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the campaign started."
                          },
                          "languageCode": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Language code of the campaign."
                          },
                          "country": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Target country."
                          },
                          "brandId": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "ID of the brand running the campaign."
                          },
                          "brand": {
                            "type": [
                              "object",
                              "string",
                              "null"
                            ],
                            "description": "The brand."
                          },
                          "defaultHierarchyAssigneeId": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "ID of the team that receives new clients from this campaign."
                          },
                          "defaultHierarchyAssignee": {
                            "type": [
                              "object",
                              "string",
                              "null"
                            ],
                            "description": "The team that receives new clients."
                          },
                          "defaultUserAssigneeId": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "ID of the agent who receives new clients from this campaign."
                          },
                          "defaultUserAssigneeFullName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Name of that agent."
                          },
                          "campaignImageUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Campaign image URL."
                          },
                          "leadsCount": {
                            "type": [
                              "integer",
                              "string",
                              "null"
                            ],
                            "description": "How many sign-ups the campaign has had."
                          },
                          "clientsCount": {
                            "type": [
                              "integer",
                              "string",
                              "null"
                            ],
                            "description": "How many clients came from the campaign."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 45,
                      "name": "Spring launch",
                      "campaignCode": "x7Kq2p",
                      "status": "ACTIVE"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/marketingCampaigns/searchCount": {
      "post": {
        "operationId": "marketingCampaigns_searchCount",
        "tags": [
          "Marketing campaigns"
        ],
        "summary": "Count campaigns",
        "description": "Returns how many campaigns match the filters. Use it together with Search to build pagination.",
        "x-required-permission": "marketingCampaigns.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  }
                }
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": 42
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/marketingCampaigns/updateCampaignImage": {
      "post": {
        "operationId": "marketingCampaigns_updateCampaignImage",
        "tags": [
          "Marketing campaigns"
        ],
        "summary": "Upload a campaign image",
        "description": "Uploads or replaces the image of a campaign. Send the request as `multipart/form-data`, with the file in a field called `imageFile`.",
        "x-required-permission": "marketingCampaigns.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "campaignId": {
                    "type": "integer",
                    "description": "ID of the campaign."
                  },
                  "imageFile": {
                    "type": "string",
                    "format": "binary",
                    "description": "The image file."
                  }
                },
                "required": [
                  "campaignId",
                  "imageFile"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/marketingCampaigns/removeCampaignImage": {
      "post": {
        "operationId": "marketingCampaigns_removeCampaignImage",
        "tags": [
          "Marketing campaigns"
        ],
        "summary": "Delete a campaign image",
        "description": "Removes the image of a campaign.",
        "x-required-permission": "marketingCampaigns.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "campaignId": {
                    "type": "integer",
                    "description": "ID of the campaign."
                  }
                },
                "required": [
                  "campaignId"
                ]
              },
              "example": {
                "campaignId": 45
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/marketingCampaigns/getTypesDisplayList": {
      "get": {
        "operationId": "marketingCampaigns_getTypesDisplayList",
        "tags": [
          "Marketing campaigns"
        ],
        "summary": "List campaign types",
        "description": "Returns the allowed values for `type`.",
        "x-required-permission": "marketingCampaigns.MANAGE",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "SOCIAL_MEDIA",
                      "value": "SOCIAL_MEDIA"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/marketingCampaigns/getPlatformsDisplayList": {
      "get": {
        "operationId": "marketingCampaigns_getPlatformsDisplayList",
        "tags": [
          "Marketing campaigns"
        ],
        "summary": "List campaign platforms",
        "description": "Returns the allowed values for `platforms`.",
        "x-required-permission": "marketingCampaigns.VIEW",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "FACEBOOK",
                      "value": "FACEBOOK"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/marketingCampaigns/getStatusesDisplayList": {
      "get": {
        "operationId": "marketingCampaigns_getStatusesDisplayList",
        "tags": [
          "Marketing campaigns"
        ],
        "summary": "List campaign statuses",
        "description": "Returns the allowed values for `status`.",
        "x-required-permission": "marketingCampaigns.MANAGE",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "ACTIVE",
                      "value": "ACTIVE"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/organizations/getMyOrganization": {
      "post": {
        "operationId": "organizations_getMyOrganization",
        "tags": [
          "Organization"
        ],
        "summary": "Get your organization",
        "description": "Returns the details of your organization.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "Organization ID."
                        },
                        "name": {
                          "type": "string",
                          "description": "Organization name."
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Country."
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "City."
                        },
                        "state": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "State or district."
                        },
                        "address": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Street address."
                        },
                        "zipcode": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "Postal code."
                        },
                        "baseCurrency": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Main currency."
                        },
                        "homepage": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Website."
                        },
                        "phoneCountryCode": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Two-letter country code of the phone number."
                        },
                        "phoneDialCode": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "Dial code without the plus sign."
                        },
                        "phone": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "National phone number, digits only."
                        },
                        "defaultTimezone": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Default time zone."
                        },
                        "defaultLanguage": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Default language code."
                        },
                        "communicationLanguages": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          },
                          "description": "Languages you work in."
                        },
                        "hasMultipleUsers": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "True when more than one person is on the team."
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 7,
                    "name": "Your agency",
                    "country": "Cyprus",
                    "baseCurrency": "EUR"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/organizations/update": {
      "post": {
        "operationId": "organizations_update",
        "tags": [
          "Organization"
        ],
        "summary": "Update your organization",
        "description": "Changes the details of your organization. Send only the fields you want to change.",
        "x-required-permission": "organizations.EDIT_PROFILE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "Your organization ID, from Get your organization. A request can only ever change your own organization."
                  },
                  "name": {
                    "type": "string",
                    "description": "Organization name."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country."
                  },
                  "city": {
                    "type": "string",
                    "description": "City."
                  },
                  "state": {
                    "type": "string",
                    "description": "State or district."
                  },
                  "address": {
                    "type": "string",
                    "description": "Street address."
                  },
                  "zipcode": {
                    "type": "integer",
                    "description": "Postal code."
                  },
                  "homepage": {
                    "type": "string",
                    "description": "Website."
                  },
                  "phoneCountryCode": {
                    "type": "string",
                    "description": "Two-letter country code of the phone number."
                  },
                  "phoneDialCode": {
                    "type": "integer",
                    "description": "Dial code without the plus sign."
                  },
                  "phone": {
                    "type": "integer",
                    "description": "National phone number, digits only."
                  },
                  "defaultTimezone": {
                    "type": "string",
                    "description": "Default time zone."
                  },
                  "defaultLanguage": {
                    "type": "string",
                    "description": "Default language code."
                  },
                  "communicationLanguages": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Languages you work in."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 7,
                "city": "Limassol"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "array",
                        "object"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 7
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/organizations/getOrganizationUsageLimits": {
      "post": {
        "operationId": "organizations_getOrganizationUsageLimits",
        "tags": [
          "Organization"
        ],
        "summary": "Get plan usage and limits",
        "description": "Returns how many seats, brands, clients and properties you use, and the limits of your plan.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "maxBrands": 3,
                    "brandsCount": 1,
                    "maxClients": 1000,
                    "clientsCount": 240,
                    "brandsLimitReached": false,
                    "clientsLimitReached": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/properties/create": {
      "post": {
        "operationId": "properties_create",
        "tags": [
          "Properties"
        ],
        "summary": "Create a property",
        "description": "Adds a new property. Send `photos` and `floorPlansPhotos` as empty lists when you have none yet.",
        "x-required-permission": "properties.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "Listing title."
                  },
                  "description": {
                    "type": "string",
                    "description": "Listing description."
                  },
                  "propertyType": {
                    "type": "string",
                    "enum": [
                      "APARTMENT",
                      "VILLA",
                      "TOWNHOUSE",
                      "DUPLEX",
                      "PENTHOUSE",
                      "LOFT",
                      "STUDIO",
                      "BUNGALOW",
                      "COTTAGE",
                      "FARMHOUSE",
                      "WAREHOUSE",
                      "SHOWROOM",
                      "RESIDENTIAL_BUILDING",
                      "COMMERCIAL_BUILDING",
                      "OFFICE",
                      "RETAIL_SHOP",
                      "RESTAURANT",
                      "PLOT",
                      "HOTEL"
                    ],
                    "description": "Kind of property."
                  },
                  "dealType": {
                    "type": "string",
                    "enum": [
                      "SALE",
                      "RENT",
                      "SALE_AND_RENT"
                    ],
                    "description": "Whether it is for sale, for rent, or both."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "PENDING",
                      "AVAILABLE",
                      "RESERVED",
                      "SOLD",
                      "RENTED",
                      "NOT_AVAILABLE",
                      "ARCHIVED"
                    ],
                    "description": "Availability."
                  },
                  "brandId": {
                    "type": "integer",
                    "description": "ID of the brand that lists the property."
                  },
                  "developerId": {
                    "type": "integer",
                    "description": "ID of the developer."
                  },
                  "externalAgentId": {
                    "type": "integer",
                    "description": "ID of the external agent selling the property."
                  },
                  "sellerClientId": {
                    "type": "integer",
                    "description": "ID of the client selling the property."
                  },
                  "isPublishedToWebsite": {
                    "type": "boolean",
                    "description": "True when the property appears on your website."
                  },
                  "photos": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Photo URLs. Upload them first, see the Upload property files guide."
                  },
                  "floorPlansPhotos": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Floor plan image URLs."
                  },
                  "propertyFiles": {
                    "type": "object",
                    "description": "Documents grouped by folder."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country."
                  },
                  "city": {
                    "type": "string",
                    "description": "City."
                  },
                  "state": {
                    "type": "string",
                    "description": "State or district."
                  },
                  "area": {
                    "type": "string",
                    "description": "Area or neighborhood."
                  },
                  "address": {
                    "type": "string",
                    "description": "Street address."
                  },
                  "zipcode": {
                    "type": "string",
                    "description": "Postal code."
                  },
                  "latitude": {
                    "type": "number",
                    "description": "Latitude."
                  },
                  "longitude": {
                    "type": "number",
                    "description": "Longitude."
                  },
                  "bedrooms": {
                    "type": "integer",
                    "description": "Number of bedrooms."
                  },
                  "bathrooms": {
                    "type": "integer",
                    "description": "Number of bathrooms."
                  },
                  "showers": {
                    "type": "integer",
                    "description": "Number of showers."
                  },
                  "toilets": {
                    "type": "integer",
                    "description": "Number of toilets."
                  },
                  "livingRooms": {
                    "type": "integer",
                    "description": "Number of living rooms."
                  },
                  "kitchens": {
                    "type": "integer",
                    "description": "Number of kitchens."
                  },
                  "parkingSpaces": {
                    "type": "integer",
                    "description": "Number of parking spaces."
                  },
                  "buildingFloor": {
                    "type": "integer",
                    "description": "Floor of the unit."
                  },
                  "houseFloors": {
                    "type": "integer",
                    "description": "Floors in the house."
                  },
                  "unitNumber": {
                    "type": "string",
                    "description": "Unit number."
                  },
                  "features": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Features. See List property features."
                  },
                  "furnished": {
                    "type": "string",
                    "enum": [
                      "FULLY",
                      "PARTIALLY",
                      "UNFURNISHED"
                    ],
                    "description": "How furnished it is."
                  },
                  "orientation": {
                    "type": "string",
                    "description": "Which way it faces. See List orientations."
                  },
                  "constructionStage": {
                    "type": "string",
                    "enum": [
                      "OFF_PLAN",
                      "UNDER_CONSTRUCTION",
                      "UNFINISHED",
                      "COMPLETED",
                      "RESALE"
                    ],
                    "description": "Construction stage."
                  },
                  "estimatedCompletionDate": {
                    "type": "string",
                    "format": "date",
                    "description": "Estimated completion date."
                  },
                  "yearOfConstruction": {
                    "type": "integer",
                    "description": "Year built."
                  },
                  "yearOfRenovation": {
                    "type": "integer",
                    "description": "Year renovated."
                  },
                  "energyEfficiencyRating": {
                    "type": "string",
                    "description": "Energy rating."
                  },
                  "plotSize": {
                    "type": "number",
                    "description": "Plot size in square meters."
                  },
                  "interiorSize": {
                    "type": "number",
                    "description": "Interior size in square meters."
                  },
                  "coveredSize": {
                    "type": "number",
                    "description": "Covered size in square meters."
                  },
                  "gardenSize": {
                    "type": "number",
                    "description": "Garden size in square meters."
                  },
                  "roofGardenSize": {
                    "type": "number",
                    "description": "Roof garden size in square meters."
                  },
                  "basementSize": {
                    "type": "number",
                    "description": "Basement size in square meters."
                  },
                  "coveredVerandaSize": {
                    "type": "number",
                    "description": "Covered veranda size in square meters."
                  },
                  "uncoveredVerandaSize": {
                    "type": "number",
                    "description": "Uncovered veranda size in square meters."
                  },
                  "coveredParkingSize": {
                    "type": "number",
                    "description": "Covered parking size in square meters."
                  },
                  "section": {
                    "type": "string",
                    "description": "Land registry section."
                  },
                  "plotNumber": {
                    "type": "integer",
                    "description": "Land registry plot number."
                  },
                  "sheetPlan": {
                    "type": "string",
                    "description": "Land registry sheet and plan."
                  },
                  "titleDeedId": {
                    "type": "string",
                    "description": "Title deed number."
                  },
                  "price": {
                    "type": "integer",
                    "description": "Price."
                  },
                  "reducedPrice": {
                    "type": "integer",
                    "description": "Reduced price."
                  },
                  "vatRate": {
                    "type": "number",
                    "description": "VAT rate."
                  },
                  "commissionPercentage": {
                    "type": "integer",
                    "description": "Commission percentage."
                  }
                },
                "required": [
                  "title",
                  "propertyType",
                  "dealType",
                  "photos",
                  "floorPlansPhotos"
                ]
              },
              "example": {
                "title": "Sea view apartment",
                "propertyType": "APARTMENT",
                "dealType": "SALE",
                "status": "AVAILABLE",
                "photos": [],
                "floorPlansPhotos": [],
                "propertyFiles": {},
                "bedrooms": 2,
                "price": 320000
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 310
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/clone": {
      "post": {
        "operationId": "properties_clone",
        "tags": [
          "Properties"
        ],
        "summary": "Clone a property",
        "description": "Creates a new property from the details you send, with its own copy of the photos and files.",
        "x-required-permission": "properties.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "Listing title."
                  },
                  "description": {
                    "type": "string",
                    "description": "Listing description."
                  },
                  "propertyType": {
                    "type": "string",
                    "enum": [
                      "APARTMENT",
                      "VILLA",
                      "TOWNHOUSE",
                      "DUPLEX",
                      "PENTHOUSE",
                      "LOFT",
                      "STUDIO",
                      "BUNGALOW",
                      "COTTAGE",
                      "FARMHOUSE",
                      "WAREHOUSE",
                      "SHOWROOM",
                      "RESIDENTIAL_BUILDING",
                      "COMMERCIAL_BUILDING",
                      "OFFICE",
                      "RETAIL_SHOP",
                      "RESTAURANT",
                      "PLOT",
                      "HOTEL"
                    ],
                    "description": "Kind of property."
                  },
                  "dealType": {
                    "type": "string",
                    "enum": [
                      "SALE",
                      "RENT",
                      "SALE_AND_RENT"
                    ],
                    "description": "Whether it is for sale, for rent, or both."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "PENDING",
                      "AVAILABLE",
                      "RESERVED",
                      "SOLD",
                      "RENTED",
                      "NOT_AVAILABLE",
                      "ARCHIVED"
                    ],
                    "description": "Availability."
                  },
                  "brandId": {
                    "type": "integer",
                    "description": "ID of the brand that lists the property."
                  },
                  "developerId": {
                    "type": "integer",
                    "description": "ID of the developer."
                  },
                  "externalAgentId": {
                    "type": "integer",
                    "description": "ID of the external agent selling the property."
                  },
                  "sellerClientId": {
                    "type": "integer",
                    "description": "ID of the client selling the property."
                  },
                  "isPublishedToWebsite": {
                    "type": "boolean",
                    "description": "True when the property appears on your website."
                  },
                  "photos": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Photo URLs. Upload them first, see the Upload property files guide."
                  },
                  "floorPlansPhotos": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Floor plan image URLs."
                  },
                  "propertyFiles": {
                    "type": "object",
                    "description": "Documents grouped by folder."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country."
                  },
                  "city": {
                    "type": "string",
                    "description": "City."
                  },
                  "state": {
                    "type": "string",
                    "description": "State or district."
                  },
                  "area": {
                    "type": "string",
                    "description": "Area or neighborhood."
                  },
                  "address": {
                    "type": "string",
                    "description": "Street address."
                  },
                  "zipcode": {
                    "type": "string",
                    "description": "Postal code."
                  },
                  "latitude": {
                    "type": "number",
                    "description": "Latitude."
                  },
                  "longitude": {
                    "type": "number",
                    "description": "Longitude."
                  },
                  "bedrooms": {
                    "type": "integer",
                    "description": "Number of bedrooms."
                  },
                  "bathrooms": {
                    "type": "integer",
                    "description": "Number of bathrooms."
                  },
                  "showers": {
                    "type": "integer",
                    "description": "Number of showers."
                  },
                  "toilets": {
                    "type": "integer",
                    "description": "Number of toilets."
                  },
                  "livingRooms": {
                    "type": "integer",
                    "description": "Number of living rooms."
                  },
                  "kitchens": {
                    "type": "integer",
                    "description": "Number of kitchens."
                  },
                  "parkingSpaces": {
                    "type": "integer",
                    "description": "Number of parking spaces."
                  },
                  "buildingFloor": {
                    "type": "integer",
                    "description": "Floor of the unit."
                  },
                  "houseFloors": {
                    "type": "integer",
                    "description": "Floors in the house."
                  },
                  "unitNumber": {
                    "type": "string",
                    "description": "Unit number."
                  },
                  "features": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Features. See List property features."
                  },
                  "furnished": {
                    "type": "string",
                    "enum": [
                      "FULLY",
                      "PARTIALLY",
                      "UNFURNISHED"
                    ],
                    "description": "How furnished it is."
                  },
                  "orientation": {
                    "type": "string",
                    "description": "Which way it faces. See List orientations."
                  },
                  "constructionStage": {
                    "type": "string",
                    "enum": [
                      "OFF_PLAN",
                      "UNDER_CONSTRUCTION",
                      "UNFINISHED",
                      "COMPLETED",
                      "RESALE"
                    ],
                    "description": "Construction stage."
                  },
                  "estimatedCompletionDate": {
                    "type": "string",
                    "format": "date",
                    "description": "Estimated completion date."
                  },
                  "yearOfConstruction": {
                    "type": "integer",
                    "description": "Year built."
                  },
                  "yearOfRenovation": {
                    "type": "integer",
                    "description": "Year renovated."
                  },
                  "energyEfficiencyRating": {
                    "type": "string",
                    "description": "Energy rating."
                  },
                  "plotSize": {
                    "type": "number",
                    "description": "Plot size in square meters."
                  },
                  "interiorSize": {
                    "type": "number",
                    "description": "Interior size in square meters."
                  },
                  "coveredSize": {
                    "type": "number",
                    "description": "Covered size in square meters."
                  },
                  "gardenSize": {
                    "type": "number",
                    "description": "Garden size in square meters."
                  },
                  "roofGardenSize": {
                    "type": "number",
                    "description": "Roof garden size in square meters."
                  },
                  "basementSize": {
                    "type": "number",
                    "description": "Basement size in square meters."
                  },
                  "coveredVerandaSize": {
                    "type": "number",
                    "description": "Covered veranda size in square meters."
                  },
                  "uncoveredVerandaSize": {
                    "type": "number",
                    "description": "Uncovered veranda size in square meters."
                  },
                  "coveredParkingSize": {
                    "type": "number",
                    "description": "Covered parking size in square meters."
                  },
                  "section": {
                    "type": "string",
                    "description": "Land registry section."
                  },
                  "plotNumber": {
                    "type": "integer",
                    "description": "Land registry plot number."
                  },
                  "sheetPlan": {
                    "type": "string",
                    "description": "Land registry sheet and plan."
                  },
                  "titleDeedId": {
                    "type": "string",
                    "description": "Title deed number."
                  },
                  "price": {
                    "type": "integer",
                    "description": "Price."
                  },
                  "reducedPrice": {
                    "type": "integer",
                    "description": "Reduced price."
                  },
                  "vatRate": {
                    "type": "number",
                    "description": "VAT rate."
                  },
                  "commissionPercentage": {
                    "type": "integer",
                    "description": "Commission percentage."
                  }
                },
                "required": [
                  "title",
                  "propertyType",
                  "dealType",
                  "photos",
                  "floorPlansPhotos",
                  "propertyFiles"
                ]
              },
              "example": {
                "title": "Sea view apartment",
                "propertyType": "APARTMENT",
                "dealType": "SALE",
                "status": "AVAILABLE",
                "photos": [],
                "floorPlansPhotos": [],
                "propertyFiles": {},
                "bedrooms": 2,
                "price": 320000
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 311
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/update": {
      "post": {
        "operationId": "properties_update",
        "tags": [
          "Properties"
        ],
        "summary": "Update a property",
        "description": "Changes a property. Always send the full `photos` and `floorPlansPhotos` lists, because photos you leave out are deleted.",
        "x-required-permission": "properties.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the property."
                  },
                  "title": {
                    "type": "string",
                    "description": "Listing title."
                  },
                  "description": {
                    "type": "string",
                    "description": "Listing description."
                  },
                  "propertyType": {
                    "type": "string",
                    "enum": [
                      "APARTMENT",
                      "VILLA",
                      "TOWNHOUSE",
                      "DUPLEX",
                      "PENTHOUSE",
                      "LOFT",
                      "STUDIO",
                      "BUNGALOW",
                      "COTTAGE",
                      "FARMHOUSE",
                      "WAREHOUSE",
                      "SHOWROOM",
                      "RESIDENTIAL_BUILDING",
                      "COMMERCIAL_BUILDING",
                      "OFFICE",
                      "RETAIL_SHOP",
                      "RESTAURANT",
                      "PLOT",
                      "HOTEL"
                    ],
                    "description": "Kind of property."
                  },
                  "dealType": {
                    "type": "string",
                    "enum": [
                      "SALE",
                      "RENT",
                      "SALE_AND_RENT"
                    ],
                    "description": "Whether it is for sale, for rent, or both."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "PENDING",
                      "AVAILABLE",
                      "RESERVED",
                      "SOLD",
                      "RENTED",
                      "NOT_AVAILABLE",
                      "ARCHIVED"
                    ],
                    "description": "Availability."
                  },
                  "brandId": {
                    "type": "integer",
                    "description": "ID of the brand that lists the property."
                  },
                  "developerId": {
                    "type": "integer",
                    "description": "ID of the developer."
                  },
                  "externalAgentId": {
                    "type": "integer",
                    "description": "ID of the external agent selling the property."
                  },
                  "sellerClientId": {
                    "type": "integer",
                    "description": "ID of the client selling the property."
                  },
                  "isPublishedToWebsite": {
                    "type": "boolean",
                    "description": "True when the property appears on your website."
                  },
                  "photos": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Photo URLs. Upload them first, see the Upload property files guide."
                  },
                  "floorPlansPhotos": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Floor plan image URLs."
                  },
                  "propertyFiles": {
                    "type": "object",
                    "description": "Documents grouped by folder."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country."
                  },
                  "city": {
                    "type": "string",
                    "description": "City."
                  },
                  "state": {
                    "type": "string",
                    "description": "State or district."
                  },
                  "area": {
                    "type": "string",
                    "description": "Area or neighborhood."
                  },
                  "address": {
                    "type": "string",
                    "description": "Street address."
                  },
                  "zipcode": {
                    "type": "string",
                    "description": "Postal code."
                  },
                  "latitude": {
                    "type": "number",
                    "description": "Latitude."
                  },
                  "longitude": {
                    "type": "number",
                    "description": "Longitude."
                  },
                  "bedrooms": {
                    "type": "integer",
                    "description": "Number of bedrooms."
                  },
                  "bathrooms": {
                    "type": "integer",
                    "description": "Number of bathrooms."
                  },
                  "showers": {
                    "type": "integer",
                    "description": "Number of showers."
                  },
                  "toilets": {
                    "type": "integer",
                    "description": "Number of toilets."
                  },
                  "livingRooms": {
                    "type": "integer",
                    "description": "Number of living rooms."
                  },
                  "kitchens": {
                    "type": "integer",
                    "description": "Number of kitchens."
                  },
                  "parkingSpaces": {
                    "type": "integer",
                    "description": "Number of parking spaces."
                  },
                  "buildingFloor": {
                    "type": "integer",
                    "description": "Floor of the unit."
                  },
                  "houseFloors": {
                    "type": "integer",
                    "description": "Floors in the house."
                  },
                  "unitNumber": {
                    "type": "string",
                    "description": "Unit number."
                  },
                  "features": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Features. See List property features."
                  },
                  "furnished": {
                    "type": "string",
                    "enum": [
                      "FULLY",
                      "PARTIALLY",
                      "UNFURNISHED"
                    ],
                    "description": "How furnished it is."
                  },
                  "orientation": {
                    "type": "string",
                    "description": "Which way it faces. See List orientations."
                  },
                  "constructionStage": {
                    "type": "string",
                    "enum": [
                      "OFF_PLAN",
                      "UNDER_CONSTRUCTION",
                      "UNFINISHED",
                      "COMPLETED",
                      "RESALE"
                    ],
                    "description": "Construction stage."
                  },
                  "estimatedCompletionDate": {
                    "type": "string",
                    "format": "date",
                    "description": "Estimated completion date."
                  },
                  "yearOfConstruction": {
                    "type": "integer",
                    "description": "Year built."
                  },
                  "yearOfRenovation": {
                    "type": "integer",
                    "description": "Year renovated."
                  },
                  "energyEfficiencyRating": {
                    "type": "string",
                    "description": "Energy rating."
                  },
                  "plotSize": {
                    "type": "number",
                    "description": "Plot size in square meters."
                  },
                  "interiorSize": {
                    "type": "number",
                    "description": "Interior size in square meters."
                  },
                  "coveredSize": {
                    "type": "number",
                    "description": "Covered size in square meters."
                  },
                  "gardenSize": {
                    "type": "number",
                    "description": "Garden size in square meters."
                  },
                  "roofGardenSize": {
                    "type": "number",
                    "description": "Roof garden size in square meters."
                  },
                  "basementSize": {
                    "type": "number",
                    "description": "Basement size in square meters."
                  },
                  "coveredVerandaSize": {
                    "type": "number",
                    "description": "Covered veranda size in square meters."
                  },
                  "uncoveredVerandaSize": {
                    "type": "number",
                    "description": "Uncovered veranda size in square meters."
                  },
                  "coveredParkingSize": {
                    "type": "number",
                    "description": "Covered parking size in square meters."
                  },
                  "section": {
                    "type": "string",
                    "description": "Land registry section."
                  },
                  "plotNumber": {
                    "type": "integer",
                    "description": "Land registry plot number."
                  },
                  "sheetPlan": {
                    "type": "string",
                    "description": "Land registry sheet and plan."
                  },
                  "titleDeedId": {
                    "type": "string",
                    "description": "Title deed number."
                  },
                  "price": {
                    "type": "integer",
                    "description": "Price."
                  },
                  "reducedPrice": {
                    "type": "integer",
                    "description": "Reduced price."
                  },
                  "vatRate": {
                    "type": "number",
                    "description": "VAT rate."
                  },
                  "commissionPercentage": {
                    "type": "integer",
                    "description": "Commission percentage."
                  }
                },
                "required": [
                  "id",
                  "photos",
                  "floorPlansPhotos"
                ]
              },
              "example": {
                "id": 310,
                "photos": [],
                "floorPlansPhotos": [],
                "price": 310000
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 310
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/remove": {
      "post": {
        "operationId": "properties_remove",
        "tags": [
          "Properties"
        ],
        "summary": "Delete a property",
        "description": "Permanently deletes a property and its files.",
        "x-required-permission": "properties.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the property to delete."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 310
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 310
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/search": {
      "post": {
        "operationId": "properties_search",
        "tags": [
          "Properties"
        ],
        "summary": "Search properties",
        "description": "Returns a list of properties, with only the fields you ask for.",
        "x-required-permission": "properties.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fields"
                ],
                "properties": {
                  "fields": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "id",
                        "title",
                        "description",
                        "propertyType",
                        "dealType",
                        "status",
                        "brandId",
                        "brand",
                        "developerId",
                        "developer",
                        "externalAgentId",
                        "sellerClientId",
                        "propertySeller",
                        "isPublishedToWebsite",
                        "photos",
                        "floorPlansPhotos",
                        "propertyFiles",
                        "country",
                        "city",
                        "state",
                        "area",
                        "address",
                        "zipcode",
                        "latitude",
                        "longitude",
                        "bedrooms",
                        "bathrooms",
                        "showers",
                        "toilets",
                        "livingRooms",
                        "kitchens",
                        "parkingSpaces",
                        "buildingFloor",
                        "houseFloors",
                        "unitNumber",
                        "features",
                        "furnished",
                        "orientation",
                        "constructionStage",
                        "estimatedCompletionDate",
                        "yearOfConstruction",
                        "yearOfRenovation",
                        "energyEfficiencyRating",
                        "plotSize",
                        "interiorSize",
                        "coveredSize",
                        "gardenSize",
                        "roofGardenSize",
                        "basementSize",
                        "coveredVerandaSize",
                        "uncoveredVerandaSize",
                        "coveredParkingSize",
                        "section",
                        "plotNumber",
                        "sheetPlan",
                        "titleDeedId",
                        "price",
                        "reducedPrice",
                        "finalPrice",
                        "vatRate",
                        "commissionPercentage",
                        "createdAt",
                        "updatedAt"
                      ]
                    },
                    "description": "The fields to return. Required."
                  },
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  },
                  "orderBy": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "ASC",
                        "DESC"
                      ]
                    },
                    "description": "Field to sort by. The field must also be listed in `fields`."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "How many records to return. Always set this, because leaving it out can return every record."
                  },
                  "offset": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "How many records to skip."
                  }
                }
              },
              "example": {
                "fields": [
                  "id",
                  "title",
                  "price",
                  "status"
                ],
                "filters": [
                  {
                    "status": {
                      "mode": "EQEM",
                      "value": [
                        "AVAILABLE"
                      ]
                    }
                  }
                ],
                "orderBy": {
                  "id": "DESC"
                },
                "limit": 25
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Property ID."
                          },
                          "title": {
                            "type": "string",
                            "description": "Listing title."
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Listing description."
                          },
                          "propertyType": {
                            "type": "string",
                            "enum": [
                              "APARTMENT",
                              "VILLA",
                              "TOWNHOUSE",
                              "DUPLEX",
                              "PENTHOUSE",
                              "LOFT",
                              "STUDIO",
                              "BUNGALOW",
                              "COTTAGE",
                              "FARMHOUSE",
                              "WAREHOUSE",
                              "SHOWROOM",
                              "RESIDENTIAL_BUILDING",
                              "COMMERCIAL_BUILDING",
                              "OFFICE",
                              "RETAIL_SHOP",
                              "RESTAURANT",
                              "PLOT",
                              "HOTEL"
                            ],
                            "description": "Kind of property."
                          },
                          "dealType": {
                            "type": "string",
                            "enum": [
                              "SALE",
                              "RENT",
                              "SALE_AND_RENT"
                            ],
                            "description": "Whether it is for sale, for rent, or both."
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "PENDING",
                              "AVAILABLE",
                              "RESERVED",
                              "SOLD",
                              "RENTED",
                              "NOT_AVAILABLE",
                              "ARCHIVED",
                              null
                            ],
                            "description": "Availability."
                          },
                          "brandId": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "ID of the brand that lists the property."
                          },
                          "brand": {
                            "type": [
                              "object",
                              "string",
                              "null"
                            ],
                            "description": "The brand."
                          },
                          "developerId": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "ID of the developer."
                          },
                          "developer": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Developer name."
                          },
                          "externalAgentId": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "ID of the external agent selling the property."
                          },
                          "sellerClientId": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "ID of the client selling the property."
                          },
                          "propertySeller": {
                            "type": [
                              "object",
                              "string",
                              "null"
                            ],
                            "description": "The seller."
                          },
                          "isPublishedToWebsite": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "True when the property appears on your website."
                          },
                          "photos": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "string"
                            },
                            "description": "Photo URLs. Upload them first, see the Upload property files guide."
                          },
                          "floorPlansPhotos": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "string"
                            },
                            "description": "Floor plan image URLs."
                          },
                          "propertyFiles": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "description": "Documents grouped by folder."
                          },
                          "country": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Country."
                          },
                          "city": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "City."
                          },
                          "state": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "State or district."
                          },
                          "area": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Area or neighborhood."
                          },
                          "address": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Street address."
                          },
                          "zipcode": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Postal code."
                          },
                          "latitude": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Latitude."
                          },
                          "longitude": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Longitude."
                          },
                          "bedrooms": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Number of bedrooms."
                          },
                          "bathrooms": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Number of bathrooms."
                          },
                          "showers": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Number of showers."
                          },
                          "toilets": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Number of toilets."
                          },
                          "livingRooms": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Number of living rooms."
                          },
                          "kitchens": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Number of kitchens."
                          },
                          "parkingSpaces": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Number of parking spaces."
                          },
                          "buildingFloor": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Floor of the unit."
                          },
                          "houseFloors": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Floors in the house."
                          },
                          "unitNumber": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Unit number."
                          },
                          "features": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "string"
                            },
                            "description": "Features. See List property features."
                          },
                          "furnished": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "FULLY",
                              "PARTIALLY",
                              "UNFURNISHED",
                              null
                            ],
                            "description": "How furnished it is."
                          },
                          "orientation": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Which way it faces. See List orientations."
                          },
                          "constructionStage": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "OFF_PLAN",
                              "UNDER_CONSTRUCTION",
                              "UNFINISHED",
                              "COMPLETED",
                              "RESALE",
                              null
                            ],
                            "description": "Construction stage."
                          },
                          "estimatedCompletionDate": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date",
                            "description": "Estimated completion date."
                          },
                          "yearOfConstruction": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Year built."
                          },
                          "yearOfRenovation": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Year renovated."
                          },
                          "energyEfficiencyRating": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Energy rating."
                          },
                          "plotSize": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Plot size in square meters."
                          },
                          "interiorSize": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Interior size in square meters."
                          },
                          "coveredSize": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Covered size in square meters."
                          },
                          "gardenSize": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Garden size in square meters."
                          },
                          "roofGardenSize": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Roof garden size in square meters."
                          },
                          "basementSize": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Basement size in square meters."
                          },
                          "coveredVerandaSize": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Covered veranda size in square meters."
                          },
                          "uncoveredVerandaSize": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Uncovered veranda size in square meters."
                          },
                          "coveredParkingSize": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Covered parking size in square meters."
                          },
                          "section": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Land registry section."
                          },
                          "plotNumber": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Land registry plot number."
                          },
                          "sheetPlan": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Land registry sheet and plan."
                          },
                          "titleDeedId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Title deed number."
                          },
                          "price": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Price."
                          },
                          "reducedPrice": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Reduced price."
                          },
                          "finalPrice": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "The price after any reduction."
                          },
                          "vatRate": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "VAT rate."
                          },
                          "commissionPercentage": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Commission percentage."
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the property was created."
                          },
                          "updatedAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the property was last changed."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 310,
                      "title": "Sea view apartment",
                      "price": 320000,
                      "status": "AVAILABLE"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/searchCount": {
      "post": {
        "operationId": "properties_searchCount",
        "tags": [
          "Properties"
        ],
        "summary": "Count properties",
        "description": "Returns how many properties match the filters. Use it together with Search to build pagination.",
        "x-required-permission": "properties.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  }
                }
              },
              "example": {
                "filters": [
                  {
                    "status": {
                      "mode": "EQEM",
                      "value": [
                        "AVAILABLE"
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": 42
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/getPropertiesDisplayList": {
      "post": {
        "operationId": "properties_getPropertiesDisplayList",
        "tags": [
          "Properties"
        ],
        "summary": "List properties for a picker",
        "description": "Returns property titles and IDs, handy for dropdowns.",
        "x-required-permission": "properties.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "searchValue": {
                    "type": "string",
                    "description": "Only return properties whose title matches."
                  },
                  "skip": {
                    "type": "integer",
                    "description": "How many records to skip."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "How many records to return."
                  }
                }
              },
              "example": {
                "skip": 0,
                "limit": 10
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "Sea view apartment",
                      "value": 310
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/getFileUploadUrl": {
      "post": {
        "operationId": "properties_getFileUploadUrl",
        "tags": [
          "Properties"
        ],
        "summary": "Get a file upload URL",
        "description": "Returns a URL to upload one file to. It works for 5 minutes. See the Upload property files guide.",
        "x-required-permission": "properties.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "fileType": {
                    "type": "string",
                    "description": "File MIME type, for example image/jpeg."
                  },
                  "extension": {
                    "type": "string",
                    "description": "File extension, for example jpg."
                  }
                },
                "required": [
                  "fileType",
                  "extension"
                ]
              },
              "example": {
                "fileType": "image/jpeg",
                "extension": "jpg"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "The URL to upload to and the file details to send back afterwards."
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "uploadUrl": "https://storage.example.com/...",
                    "id": 901,
                    "fileUrl": "https://cdn.estactics.com/...",
                    "name": "properties/901.jpg"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/confirmPropertyFilesUploaded": {
      "post": {
        "operationId": "properties_confirmPropertyFilesUploaded",
        "tags": [
          "Properties"
        ],
        "summary": "Confirm uploaded documents",
        "description": "Attaches files you have already uploaded to the document folders of a property.",
        "x-required-permission": "properties.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the property."
                  },
                  "uploadedPropertyFiles": {
                    "type": "array",
                    "description": "The files you uploaded.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "folder": {
                          "type": "string",
                          "enum": [
                            "AGREEMENTS",
                            "ARCHITECTURE_DESIGN",
                            "BROCHURES",
                            "OTHER"
                          ]
                        },
                        "fileId": {
                          "type": "integer"
                        },
                        "fileUrl": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "folder",
                        "fileId",
                        "fileUrl",
                        "name"
                      ]
                    }
                  }
                },
                "required": [
                  "id",
                  "uploadedPropertyFiles"
                ]
              },
              "example": {
                "id": 310,
                "uploadedPropertyFiles": [
                  {
                    "folder": "BROCHURES",
                    "fileId": 901,
                    "fileUrl": "https://cdn.estactics.com/...",
                    "name": "Brochure.pdf"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "propertyFiles": {
                          "type": [
                            "object",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 310,
                    "propertyFiles": {
                      "BROCHURES": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/renamePropertyFileName": {
      "post": {
        "operationId": "properties_renamePropertyFileName",
        "tags": [
          "Properties"
        ],
        "summary": "Rename a document",
        "description": "Changes the name of a document on a property.",
        "x-required-permission": "properties.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the property."
                  },
                  "folder": {
                    "type": "string",
                    "enum": [
                      "AGREEMENTS",
                      "ARCHITECTURE_DESIGN",
                      "BROCHURES",
                      "OTHER"
                    ]
                  },
                  "fileId": {
                    "type": "integer"
                  },
                  "newName": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "folder",
                  "fileId",
                  "newName"
                ]
              },
              "example": {
                "id": 310,
                "folder": "BROCHURES",
                "fileId": 901,
                "newName": "Summer brochure.pdf"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "propertyFiles": {
                          "type": [
                            "object",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 310,
                    "propertyFiles": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/arrangeFilesFolders": {
      "post": {
        "operationId": "properties_arrangeFilesFolders",
        "tags": [
          "Properties"
        ],
        "summary": "Arrange document folders",
        "description": "Saves the full list of documents per folder, which lets you move documents between folders.",
        "x-required-permission": "properties.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the property."
                  },
                  "propertyFiles": {
                    "type": "object",
                    "description": "Documents grouped by folder."
                  }
                },
                "required": [
                  "id",
                  "propertyFiles"
                ]
              },
              "example": {
                "id": 310,
                "propertyFiles": {
                  "BROCHURES": []
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "propertyFiles": {
                          "type": [
                            "object",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 310,
                    "propertyFiles": {
                      "BROCHURES": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/removePropertyFile": {
      "post": {
        "operationId": "properties_removePropertyFile",
        "tags": [
          "Properties"
        ],
        "summary": "Delete a document",
        "description": "Permanently deletes a document from a property.",
        "x-required-permission": "properties.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the property."
                  },
                  "folder": {
                    "type": "string",
                    "enum": [
                      "AGREEMENTS",
                      "ARCHITECTURE_DESIGN",
                      "BROCHURES",
                      "OTHER"
                    ]
                  },
                  "fileId": {
                    "type": "integer"
                  }
                },
                "required": [
                  "id",
                  "folder",
                  "fileId"
                ]
              },
              "example": {
                "id": 310,
                "folder": "BROCHURES",
                "fileId": 901
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "propertyFiles": {
                          "type": [
                            "object",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 310,
                    "propertyFiles": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/getPropertyFileAuthenticatedLink": {
      "post": {
        "operationId": "properties_getPropertyFileAuthenticatedLink",
        "tags": [
          "Properties"
        ],
        "summary": "Get a document download link",
        "description": "Returns a temporary link to download a document.",
        "x-required-permission": "properties.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the property."
                  },
                  "fileId": {
                    "type": "integer"
                  },
                  "promptSaveAs": {
                    "type": "boolean",
                    "description": "Ask the browser to download the file instead of opening it."
                  }
                },
                "required": [
                  "id",
                  "fileId"
                ]
              },
              "example": {
                "id": 310,
                "fileId": 901
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "description": "The temporary download link."
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": "https://storage.example.com/..."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/getPropertiesTypesDisplayList": {
      "get": {
        "operationId": "properties_getPropertiesTypesDisplayList",
        "tags": [
          "Properties"
        ],
        "summary": "List property types",
        "description": "Returns the allowed values for `propertyType`.",
        "x-required-permission": "properties.VIEW",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "APARTMENT",
                      "value": "APARTMENT"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/getDealTypesDisplayList": {
      "get": {
        "operationId": "properties_getDealTypesDisplayList",
        "tags": [
          "Properties"
        ],
        "summary": "List deal types",
        "description": "Returns the allowed values for `dealType`.",
        "x-required-permission": "properties.VIEW",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "SALE",
                      "value": "SALE"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/getStatusesDisplayList": {
      "get": {
        "operationId": "properties_getStatusesDisplayList",
        "tags": [
          "Properties"
        ],
        "summary": "List property statuses",
        "description": "Returns the allowed values for `status`.",
        "x-required-permission": "properties.VIEW",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "AVAILABLE",
                      "value": "AVAILABLE"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/getConstructionStagesDisplayList": {
      "get": {
        "operationId": "properties_getConstructionStagesDisplayList",
        "tags": [
          "Properties"
        ],
        "summary": "List construction stages",
        "description": "Returns the allowed values for `constructionStage`.",
        "x-required-permission": "properties.VIEW",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "COMPLETED",
                      "value": "COMPLETED"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/getPropertyFeaturesDisplayList": {
      "get": {
        "operationId": "properties_getPropertyFeaturesDisplayList",
        "tags": [
          "Properties"
        ],
        "summary": "List property features",
        "description": "Returns the allowed values for `features`.",
        "x-required-permission": "properties.VIEW",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "SEA_VIEW",
                      "value": "SEA_VIEW"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/getFurnishedOptionsDisplayList": {
      "get": {
        "operationId": "properties_getFurnishedOptionsDisplayList",
        "tags": [
          "Properties"
        ],
        "summary": "List furnished options",
        "description": "Returns the allowed values for `furnished`.",
        "x-required-permission": "properties.VIEW",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "FULLY",
                      "value": "FULLY"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/getOrientationOptionsDisplayList": {
      "get": {
        "operationId": "properties_getOrientationOptionsDisplayList",
        "tags": [
          "Properties"
        ],
        "summary": "List orientations",
        "description": "Returns the allowed values for `orientation`.",
        "x-required-permission": "properties.VIEW",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "NORTH",
                      "value": "NORTH"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/getEnergyEfficiencyOptionsDisplayList": {
      "get": {
        "operationId": "properties_getEnergyEfficiencyOptionsDisplayList",
        "tags": [
          "Properties"
        ],
        "summary": "List energy ratings",
        "description": "Returns the allowed values for `energyEfficiencyRating`.",
        "x-required-permission": "properties.VIEW",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "A",
                      "value": "A"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/properties/getPropertyFilesFoldersDisplayList": {
      "get": {
        "operationId": "properties_getPropertyFilesFoldersDisplayList",
        "tags": [
          "Properties"
        ],
        "summary": "List document folders",
        "description": "Returns the folders a document can go in.",
        "x-required-permission": "properties.VIEW",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "BROCHURES",
                      "value": "BROCHURES"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/permissionsRoles/create": {
      "post": {
        "operationId": "permissionsRoles_create",
        "tags": [
          "Roles"
        ],
        "summary": "Create a role",
        "description": "Adds a new role with no permissions. Use Set role permissions to fill it in.",
        "x-required-permission": "permissionsRoles.MANAGE_ORG_ROLES",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Role name."
                  },
                  "description": {
                    "type": "string",
                    "description": "What the role is for."
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "Viewer",
                "description": "Read only access."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 5
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/permissionsRoles/clone": {
      "post": {
        "operationId": "permissionsRoles_clone",
        "tags": [
          "Roles"
        ],
        "summary": "Clone a role",
        "description": "Creates a new role with the same permissions as an existing one.",
        "x-required-permission": "permissionsRoles.MANAGE_ORG_ROLES",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cloneFromId": {
                    "type": "integer",
                    "description": "ID of the role to copy."
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the new role."
                  },
                  "description": {
                    "type": "string",
                    "description": "What the role is for."
                  }
                },
                "required": [
                  "cloneFromId",
                  "name"
                ]
              },
              "example": {
                "cloneFromId": 5,
                "name": "Senior viewer"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 6
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/permissionsRoles/update": {
      "post": {
        "operationId": "permissionsRoles_update",
        "tags": [
          "Roles"
        ],
        "summary": "Update a role",
        "description": "Changes the name or description of a role. Always send `name`.",
        "x-required-permission": "permissionsRoles.MANAGE_ORG_ROLES",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the role."
                  },
                  "name": {
                    "type": "string",
                    "description": "Role name."
                  },
                  "description": {
                    "type": "string",
                    "description": "What the role is for."
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              },
              "example": {
                "id": 5,
                "name": "Viewer",
                "description": "Can read everything."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/permissionsRoles/setRolePermissions": {
      "post": {
        "operationId": "permissionsRoles_setRolePermissions",
        "tags": [
          "Roles"
        ],
        "summary": "Set role permissions",
        "description": "Replaces the permissions of a role. Get Role allowed permissions shows what you can choose from.",
        "x-required-permission": "permissionsRoles.MANAGE_ORG_ROLES",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the role."
                  },
                  "permissions": {
                    "type": "object",
                    "description": "What the role is allowed to do."
                  }
                },
                "required": [
                  "id",
                  "permissions"
                ]
              },
              "example": {
                "id": 5,
                "permissions": {
                  "clients": {
                    "scopes": [
                      "VIEW"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/permissionsRoles/remove": {
      "post": {
        "operationId": "permissionsRoles_remove",
        "tags": [
          "Roles"
        ],
        "summary": "Delete a role",
        "description": "Permanently deletes a role.",
        "x-required-permission": "permissionsRoles.MANAGE_ORG_ROLES",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the role to delete."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 5
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 5
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/permissionsRoles/search": {
      "post": {
        "operationId": "permissionsRoles_search",
        "tags": [
          "Roles"
        ],
        "summary": "Search roles",
        "description": "Returns a list of roles, with only the fields you ask for.",
        "x-required-permission": "permissionsRoles.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fields"
                ],
                "properties": {
                  "fields": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "id",
                        "name",
                        "description",
                        "isEditable",
                        "permissions",
                        "assignedUsersCount",
                        "updatedAt"
                      ]
                    },
                    "description": "The fields to return. Required."
                  },
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  },
                  "orderBy": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "ASC",
                        "DESC"
                      ]
                    },
                    "description": "Field to sort by. The field must also be listed in `fields`."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "How many records to return. Always set this, because leaving it out can return every record."
                  },
                  "offset": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "How many records to skip."
                  }
                }
              },
              "example": {
                "fields": [
                  "id",
                  "name",
                  "description"
                ],
                "limit": 25
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Role ID."
                          },
                          "name": {
                            "type": "string",
                            "description": "Role name."
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "What the role is for."
                          },
                          "isEditable": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "True when the role can be changed."
                          },
                          "permissions": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "description": "What the role is allowed to do."
                          },
                          "assignedUsersCount": {
                            "type": [
                              "integer",
                              "string",
                              "null"
                            ],
                            "description": "How many users have this role."
                          },
                          "updatedAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the role was last changed."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 5,
                      "name": "Viewer",
                      "description": "Read only access."
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/permissionsRoles/searchCount": {
      "post": {
        "operationId": "permissionsRoles_searchCount",
        "tags": [
          "Roles"
        ],
        "summary": "Count roles",
        "description": "Returns how many roles match the filters. Use it together with Search to build pagination.",
        "x-required-permission": "permissionsRoles.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  }
                }
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": 42
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/permissionsRoles/getDisplayList": {
      "post": {
        "operationId": "permissionsRoles_getDisplayList",
        "tags": [
          "Roles"
        ],
        "summary": "List roles for a picker",
        "description": "Returns role names and IDs, handy for dropdowns.",
        "x-required-permission": "users.MANAGE_ORG_USERS",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "Viewer",
                      "value": 5
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/permissionsRoles/getRoleAllowedPermissions": {
      "post": {
        "operationId": "permissionsRoles_getRoleAllowedPermissions",
        "tags": [
          "Roles"
        ],
        "summary": "Get role allowed permissions",
        "description": "Returns the permissions that can be given to this role.",
        "x-required-permission": "permissionsRoles.MANAGE_ORG_ROLES",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the role."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 5
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/stages/create": {
      "post": {
        "operationId": "stages_create",
        "tags": [
          "Stages"
        ],
        "summary": "Create a stage",
        "description": "Adds a stage to your pipeline, at the end of its category. An organization can have up to 10 stages.",
        "x-required-permission": "stages.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Stage name."
                  },
                  "category": {
                    "type": "string",
                    "enum": [
                      "ENTRY",
                      "ACTIVE",
                      "FINAL"
                    ],
                    "description": "The part of the pipeline this stage belongs to."
                  },
                  "categoryOrder": {
                    "type": "integer",
                    "description": "Position of the category in the pipeline."
                  },
                  "icon": {
                    "type": "string",
                    "description": "Icon name."
                  },
                  "color": {
                    "type": "string",
                    "description": "Color, for example #0c68e9."
                  },
                  "nameTranslations": {
                    "type": "object",
                    "description": "Stage name per language code."
                  }
                },
                "required": [
                  "name",
                  "category",
                  "categoryOrder"
                ]
              },
              "example": {
                "name": "Viewing booked",
                "category": "ACTIVE",
                "categoryOrder": 2,
                "color": "#0c68e9"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 21
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/stages/update": {
      "post": {
        "operationId": "stages_update",
        "tags": [
          "Stages"
        ],
        "summary": "Update a stage",
        "description": "Changes a stage. Send only the fields you want to change.",
        "x-required-permission": "stages.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the stage."
                  },
                  "name": {
                    "type": "string",
                    "description": "Stage name."
                  },
                  "icon": {
                    "type": "string",
                    "description": "Icon name."
                  },
                  "color": {
                    "type": "string",
                    "description": "Color, for example #0c68e9."
                  },
                  "nameTranslations": {
                    "type": "object",
                    "description": "Stage name per language code."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 21,
                "name": "Viewing done"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "id"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 21
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/stages/remove": {
      "post": {
        "operationId": "stages_remove",
        "tags": [
          "Stages"
        ],
        "summary": "Delete a stage",
        "description": "Permanently deletes a stage.",
        "x-required-permission": "stages.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the stage to delete."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 21
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "isDefault": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "organizationId": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 21,
                    "isDefault": false,
                    "organizationId": 7
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/stages/updateStagesOrder": {
      "post": {
        "operationId": "stages_updateStagesOrder",
        "tags": [
          "Stages"
        ],
        "summary": "Reorder stages",
        "description": "Saves a new order for your stages. The first stage of the ENTRY category becomes the default stage.",
        "x-required-permission": "stages.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "stages": {
                    "type": "array",
                    "description": "Each stage with its new position.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "Stage ID."
                        },
                        "category": {
                          "type": "string",
                          "enum": [
                            "ENTRY",
                            "ACTIVE",
                            "FINAL"
                          ]
                        },
                        "categoryOrder": {
                          "type": "integer"
                        },
                        "stageOrder": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id",
                        "category",
                        "categoryOrder",
                        "stageOrder"
                      ]
                    }
                  }
                },
                "required": [
                  "stages"
                ]
              },
              "example": {
                "stages": [
                  {
                    "id": 1,
                    "category": "ENTRY",
                    "categoryOrder": 1,
                    "stageOrder": 1
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Stage ID."
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Stage name."
                          },
                          "isDefault": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "True for the stage new clients start in."
                          },
                          "categoryOrder": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Position of the category in the pipeline."
                          },
                          "category": {
                            "type": "string",
                            "enum": [
                              "ENTRY",
                              "ACTIVE",
                              "FINAL"
                            ],
                            "description": "The part of the pipeline this stage belongs to."
                          },
                          "stageOrder": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Position of the stage inside its category."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 1,
                      "name": "New",
                      "isDefault": true,
                      "categoryOrder": 1,
                      "category": "ENTRY",
                      "stageOrder": 1
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/stages/getOrgStages": {
      "post": {
        "operationId": "stages_getOrgStages",
        "tags": [
          "Stages"
        ],
        "summary": "List stages",
        "description": "Returns every stage in your pipeline, in order.",
        "x-required-permission": "stages.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Stage ID."
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Stage name."
                          },
                          "nameTranslations": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "description": "Stage name per language code."
                          },
                          "icon": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Icon name."
                          },
                          "color": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Color, for example #0c68e9."
                          },
                          "category": {
                            "type": "string",
                            "enum": [
                              "ENTRY",
                              "ACTIVE",
                              "FINAL"
                            ],
                            "description": "The part of the pipeline this stage belongs to."
                          },
                          "categoryOrder": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Position of the category in the pipeline."
                          },
                          "stageOrder": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Position of the stage inside its category."
                          },
                          "isDefault": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "True for the stage new clients start in."
                          },
                          "organization": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Organization name."
                          },
                          "organizationId": {
                            "type": "integer",
                            "description": "Organization ID."
                          },
                          "hasAssignedResources": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "True when clients are in this stage."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 1,
                      "name": "New",
                      "category": "ENTRY",
                      "categoryOrder": 1,
                      "stageOrder": 1,
                      "isDefault": true
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/stages/getStagesCategoriesDisplayList": {
      "get": {
        "operationId": "stages_getStagesCategoriesDisplayList",
        "tags": [
          "Stages"
        ],
        "summary": "List stage categories",
        "description": "Returns the allowed values for `category`.",
        "x-required-permission": "stages.VIEW",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "ENTRY",
                      "value": "ENTRY",
                      "order": 1
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/hierarchies/create": {
      "post": {
        "operationId": "hierarchies_create",
        "tags": [
          "Teams"
        ],
        "summary": "Create a team",
        "description": "Adds a team under an existing team.",
        "x-required-permission": "hierarchies.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Team name."
                  },
                  "parentId": {
                    "type": "integer",
                    "description": "ID of the parent team."
                  },
                  "dataScopeId": {
                    "type": "integer",
                    "description": "ID of the team whose data this team can see."
                  }
                },
                "required": [
                  "name",
                  "parentId"
                ]
              },
              "example": {
                "name": "Sales",
                "parentId": 1
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 7
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/hierarchies/update": {
      "post": {
        "operationId": "hierarchies_update",
        "tags": [
          "Teams"
        ],
        "summary": "Update a team",
        "description": "Changes a team. Send only the fields you want to change.",
        "x-required-permission": "hierarchies.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the team."
                  },
                  "name": {
                    "type": "string",
                    "description": "Team name."
                  },
                  "parentId": {
                    "type": "integer",
                    "description": "ID of the parent team."
                  },
                  "dataScopeId": {
                    "type": "integer",
                    "description": "ID of the team whose data this team can see."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 7,
                "name": "Sales Europe"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "id"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 7
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/hierarchies/remove": {
      "post": {
        "operationId": "hierarchies_remove",
        "tags": [
          "Teams"
        ],
        "summary": "Delete a team",
        "description": "Permanently deletes a team.",
        "x-required-permission": "hierarchies.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the team to delete."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 7
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "id"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 7
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/hierarchies/search": {
      "post": {
        "operationId": "hierarchies_search",
        "tags": [
          "Teams"
        ],
        "summary": "Search teams",
        "description": "Returns a list of teams, with only the fields you ask for.",
        "x-required-permission": "hierarchies.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fields"
                ],
                "properties": {
                  "fields": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "id",
                        "name",
                        "parentId",
                        "dataScopeId",
                        "isRoot",
                        "users",
                        "clients"
                      ]
                    },
                    "description": "The fields to return. Required."
                  },
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  },
                  "orderBy": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "ASC",
                        "DESC"
                      ]
                    },
                    "description": "Field to sort by. The field must also be listed in `fields`."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "How many records to return. Always set this, because leaving it out can return every record."
                  },
                  "offset": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "How many records to skip."
                  }
                }
              },
              "example": {
                "fields": [
                  "id",
                  "name",
                  "parentId"
                ],
                "limit": 25
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Team ID."
                          },
                          "name": {
                            "type": "string",
                            "description": "Team name."
                          },
                          "parentId": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "ID of the parent team."
                          },
                          "dataScopeId": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "ID of the team whose data this team can see."
                          },
                          "isRoot": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "True for the top team."
                          },
                          "users": {
                            "type": [
                              "integer",
                              "string",
                              "array",
                              "null"
                            ],
                            "description": "Team members."
                          },
                          "clients": {
                            "type": [
                              "integer",
                              "string",
                              "array",
                              "null"
                            ],
                            "description": "Clients of the team."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 7,
                      "name": "Sales",
                      "parentId": 1
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/hierarchies/getOrgHierarchiesTreeView": {
      "post": {
        "operationId": "hierarchies_getOrgHierarchiesTreeView",
        "tags": [
          "Teams"
        ],
        "summary": "Get the team tree",
        "description": "Returns all your teams as a nested tree.",
        "x-required-permission": "hierarchies.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "array"
                      ],
                      "description": "The nested teams."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/hierarchies/getDisplayList": {
      "post": {
        "operationId": "hierarchies_getDisplayList",
        "tags": [
          "Teams"
        ],
        "summary": "List teams for a picker",
        "description": "Returns team names and IDs, handy for dropdowns.",
        "x-required-permission": "hierarchies.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "Sales",
                      "value": 7
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/hierarchies/getUserNestedHierarchiesDisplayList": {
      "post": {
        "operationId": "hierarchies_getUserNestedHierarchiesDisplayList",
        "tags": [
          "Teams"
        ],
        "summary": "List your teams",
        "description": "Returns the teams the owner of the API key can see, including nested teams.",
        "x-required-permission": "clients.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "Sales",
                      "value": 7
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/hierarchies/getUserHierarchiesChildsDisplayList": {
      "post": {
        "operationId": "hierarchies_getUserHierarchiesChildsDisplayList",
        "tags": [
          "Teams"
        ],
        "summary": "List your child teams",
        "description": "Returns the teams below the team of the API key owner.",
        "x-required-permission": "users.MANAGE_ORG_USERS",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "Sales",
                      "value": 7
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/users/getCurrentUser": {
      "post": {
        "operationId": "users_getCurrentUser",
        "tags": [
          "Users"
        ],
        "summary": "Get the current user",
        "description": "Returns the person who owns the API key. A good first request to check that your key works.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "User ID."
                        },
                        "firstName": {
                          "type": "string",
                          "description": "First name."
                        },
                        "lastName": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Last name."
                        },
                        "fullName": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "First and last name together."
                        },
                        "email": {
                          "type": "string",
                          "description": "Email address."
                        },
                        "occupationRole": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Job title."
                        },
                        "country": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Country name."
                        },
                        "gender": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Gender."
                        },
                        "timezone": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Time zone."
                        },
                        "language": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Language code."
                        },
                        "phoneCountryCode": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Two-letter country code of the phone number."
                        },
                        "phoneDialCode": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "Dial code without the plus sign."
                        },
                        "phone": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "National phone number, digits only."
                        },
                        "hierarchyId": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "ID of the team the user belongs to."
                        },
                        "hierarchy": {
                          "type": [
                            "object",
                            "string",
                            "null"
                          ],
                          "description": "The team."
                        },
                        "hasHierarchyDataAccess": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "True when the user sees all the data of their team."
                        },
                        "permissionsRoleId": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "ID of the role of the user."
                        },
                        "permissionsRole": {
                          "type": [
                            "object",
                            "string",
                            "null"
                          ],
                          "description": "The role."
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Account status."
                        },
                        "active": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "True when the account is active."
                        },
                        "isOrganizationOwner": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "True for the owner of the organization."
                        },
                        "userBrandsIds": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "description": "IDs of the brands the user can access."
                        },
                        "lastLoginDate": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "When the user last signed in."
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 18,
                    "firstName": "Jamie",
                    "lastName": "Parker",
                    "email": "jamie.parker@example.com"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/users/updateCurrentUserProfile": {
      "post": {
        "operationId": "users_updateCurrentUserProfile",
        "tags": [
          "Users"
        ],
        "summary": "Update the current user",
        "description": "Changes the profile of the person who owns the API key.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "firstName": {
                    "type": "string",
                    "description": "First name."
                  },
                  "lastName": {
                    "type": "string",
                    "description": "Last name."
                  },
                  "occupationRole": {
                    "type": "string",
                    "description": "Job title."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country name."
                  },
                  "gender": {
                    "type": "string",
                    "description": "Gender."
                  },
                  "timezone": {
                    "type": "string",
                    "description": "Time zone."
                  },
                  "language": {
                    "type": "string",
                    "description": "Language code."
                  },
                  "phoneCountryCode": {
                    "type": "string",
                    "description": "Two-letter country code of the phone number."
                  },
                  "phoneDialCode": {
                    "type": "integer",
                    "description": "Dial code without the plus sign."
                  },
                  "phone": {
                    "type": "integer",
                    "description": "National phone number, digits only."
                  }
                }
              },
              "example": {
                "occupationRole": "Sales manager"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/users/getCurrentUserSettings": {
      "post": {
        "operationId": "users_getCurrentUserSettings",
        "tags": [
          "Users"
        ],
        "summary": "Get user settings",
        "description": "Returns the saved settings of the person who owns the API key.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/users/setCurrentUserSettings": {
      "post": {
        "operationId": "users_setCurrentUserSettings",
        "tags": [
          "Users"
        ],
        "summary": "Save user settings",
        "description": "Replaces the saved settings of the person who owns the API key.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The settings to save."
              },
              "example": {
                "theme": "light"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/users/inviteUser": {
      "post": {
        "operationId": "users_inviteUser",
        "tags": [
          "Users"
        ],
        "summary": "Invite a user",
        "description": "Adds a person to your team and sends them an invitation email.",
        "x-required-permission": "users.MANAGE_ORG_USERS",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Email address."
                  },
                  "firstName": {
                    "type": "string",
                    "description": "First name."
                  },
                  "lastName": {
                    "type": "string",
                    "description": "Last name."
                  },
                  "occupationRole": {
                    "type": "string",
                    "description": "Job title."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country name."
                  },
                  "gender": {
                    "type": "string",
                    "description": "Gender."
                  },
                  "timezone": {
                    "type": "string",
                    "description": "Time zone."
                  },
                  "language": {
                    "type": "string",
                    "description": "Language code."
                  },
                  "phoneCountryCode": {
                    "type": "string",
                    "description": "Two-letter country code of the phone number."
                  },
                  "phoneDialCode": {
                    "type": "integer",
                    "description": "Dial code without the plus sign."
                  },
                  "phone": {
                    "type": "integer",
                    "description": "National phone number, digits only."
                  },
                  "hierarchyId": {
                    "type": "integer",
                    "description": "ID of the team the user belongs to."
                  },
                  "permissionsRoleId": {
                    "type": "integer",
                    "description": "ID of the role of the user."
                  },
                  "hasHierarchyDataAccess": {
                    "type": "boolean",
                    "description": "True when the user sees all the data of their team."
                  },
                  "password": {
                    "type": "string",
                    "description": "A first password for the account. At least 8 characters, with upper and lower case letters, a number and one of @#$!^()%*?&."
                  },
                  "brandsIds": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "IDs of the brands the user can access."
                  }
                },
                "required": [
                  "email",
                  "password",
                  "firstName",
                  "hierarchyId",
                  "permissionsRoleId",
                  "brandsIds"
                ]
              },
              "example": {
                "email": "jamie.parker@example.com",
                "password": "Example#Pass123",
                "firstName": "Jamie",
                "lastName": "Parker",
                "hierarchyId": 7,
                "permissionsRoleId": 2,
                "brandsIds": [
                  3
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "email": {
                          "type": "string"
                        },
                        "language": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 19,
                    "email": "jamie.parker@example.com",
                    "language": null
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/users/resendUserInviteLink": {
      "post": {
        "operationId": "users_resendUserInviteLink",
        "tags": [
          "Users"
        ],
        "summary": "Resend an invitation",
        "description": "Sends the invitation email again.",
        "x-required-permission": "users.MANAGE_ORG_USERS",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the user."
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 19
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/users/update": {
      "post": {
        "operationId": "users_update",
        "tags": [
          "Users"
        ],
        "summary": "Update a user",
        "description": "Changes the details of a team member.",
        "x-required-permission": "users.MANAGE_ORG_USERS",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the user."
                  },
                  "firstName": {
                    "type": "string",
                    "description": "First name."
                  },
                  "lastName": {
                    "type": "string",
                    "description": "Last name."
                  },
                  "occupationRole": {
                    "type": "string",
                    "description": "Job title."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country name."
                  },
                  "gender": {
                    "type": "string",
                    "description": "Gender."
                  },
                  "timezone": {
                    "type": "string",
                    "description": "Time zone."
                  },
                  "language": {
                    "type": "string",
                    "description": "Language code."
                  },
                  "phoneCountryCode": {
                    "type": "string",
                    "description": "Two-letter country code of the phone number."
                  },
                  "phoneDialCode": {
                    "type": "integer",
                    "description": "Dial code without the plus sign."
                  },
                  "phone": {
                    "type": "integer",
                    "description": "National phone number, digits only."
                  },
                  "hierarchyId": {
                    "type": "integer",
                    "description": "ID of the team the user belongs to."
                  },
                  "permissionsRoleId": {
                    "type": "integer",
                    "description": "ID of the role of the user."
                  },
                  "hasHierarchyDataAccess": {
                    "type": "boolean",
                    "description": "True when the user sees all the data of their team."
                  },
                  "brandsIds": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "IDs of the brands the user can access."
                  }
                },
                "required": [
                  "id",
                  "hierarchyId",
                  "permissionsRoleId",
                  "brandsIds"
                ]
              },
              "example": {
                "id": 19,
                "occupationRole": "Agent",
                "hierarchyId": 7,
                "permissionsRoleId": 2,
                "brandsIds": [
                  3
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 19
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/users/activateUser": {
      "post": {
        "operationId": "users_activateUser",
        "tags": [
          "Users"
        ],
        "summary": "Activate or deactivate a user",
        "description": "Turns an account on or off. When you deactivate someone, you can move their clients to another user.",
        "x-required-permission": "users.MANAGE_ORG_USERS",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userId": {
                    "type": "integer",
                    "description": "ID of the user."
                  },
                  "activate": {
                    "type": "boolean",
                    "description": "True to activate, false to deactivate."
                  },
                  "assignUserClientsToUserId": {
                    "type": "integer",
                    "description": "ID of the user who takes over the clients."
                  }
                },
                "required": [
                  "userId",
                  "activate"
                ]
              },
              "example": {
                "userId": 19,
                "activate": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/users/remove": {
      "post": {
        "operationId": "users_remove",
        "tags": [
          "Users"
        ],
        "summary": "Delete a user",
        "description": "Permanently deletes a team member. You can move their clients to another user.",
        "x-required-permission": "users.MANAGE_ORG_USERS",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userId": {
                    "type": "integer",
                    "description": "ID of the user."
                  },
                  "assignUserClientsToUserId": {
                    "type": "integer",
                    "description": "ID of the user who takes over the clients."
                  }
                },
                "required": [
                  "userId"
                ]
              },
              "example": {
                "userId": 19
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/users/search": {
      "post": {
        "operationId": "users_search",
        "tags": [
          "Users"
        ],
        "summary": "Search users",
        "description": "Returns a list of users, with only the fields you ask for.",
        "x-required-permission": "users.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fields"
                ],
                "properties": {
                  "fields": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "id",
                        "firstName",
                        "lastName",
                        "fullName",
                        "email",
                        "occupationRole",
                        "country",
                        "gender",
                        "timezone",
                        "language",
                        "phoneCountryCode",
                        "phoneDialCode",
                        "phone",
                        "hierarchyId",
                        "hierarchy",
                        "hasHierarchyDataAccess",
                        "permissionsRoleId",
                        "permissionsRole",
                        "status",
                        "active",
                        "isOrganizationOwner",
                        "userBrandsIds",
                        "lastLoginDate"
                      ]
                    },
                    "description": "The fields to return. Required."
                  },
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  },
                  "orderBy": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "ASC",
                        "DESC"
                      ]
                    },
                    "description": "Field to sort by. The field must also be listed in `fields`."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "How many records to return. Always set this, because leaving it out can return every record."
                  },
                  "offset": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "How many records to skip."
                  }
                }
              },
              "example": {
                "fields": [
                  "id",
                  "fullName",
                  "email",
                  "status"
                ],
                "limit": 25
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "User ID."
                          },
                          "firstName": {
                            "type": "string",
                            "description": "First name."
                          },
                          "lastName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Last name."
                          },
                          "fullName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "First and last name together."
                          },
                          "email": {
                            "type": "string",
                            "description": "Email address."
                          },
                          "occupationRole": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Job title."
                          },
                          "country": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Country name."
                          },
                          "gender": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Gender."
                          },
                          "timezone": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Time zone."
                          },
                          "language": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Language code."
                          },
                          "phoneCountryCode": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Two-letter country code of the phone number."
                          },
                          "phoneDialCode": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Dial code without the plus sign."
                          },
                          "phone": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "National phone number, digits only."
                          },
                          "hierarchyId": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "ID of the team the user belongs to."
                          },
                          "hierarchy": {
                            "type": [
                              "object",
                              "string",
                              "null"
                            ],
                            "description": "The team."
                          },
                          "hasHierarchyDataAccess": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "True when the user sees all the data of their team."
                          },
                          "permissionsRoleId": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "ID of the role of the user."
                          },
                          "permissionsRole": {
                            "type": [
                              "object",
                              "string",
                              "null"
                            ],
                            "description": "The role."
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Account status."
                          },
                          "active": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "True when the account is active."
                          },
                          "isOrganizationOwner": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "True for the owner of the organization."
                          },
                          "userBrandsIds": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "description": "IDs of the brands the user can access."
                          },
                          "lastLoginDate": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the user last signed in."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 18,
                      "fullName": "Jamie Parker",
                      "email": "jamie.parker@example.com",
                      "status": "ACTIVE"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/users/searchCount": {
      "post": {
        "operationId": "users_searchCount",
        "tags": [
          "Users"
        ],
        "summary": "Count users",
        "description": "Returns how many users match the filters. Use it together with Search to build pagination.",
        "x-required-permission": "users.VIEW",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filters": {
                    "type": "array",
                    "description": "Conditions to match. Items in the array are combined with OR, and fields inside one item with AND. See the Filtering guide.",
                    "items": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "mode",
                          "value"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "EQ",
                              "EX",
                              "EQEM",
                              "EXEM",
                              "RG",
                              "NRG",
                              "LT",
                              "LTE",
                              "GT",
                              "GTE",
                              "EM",
                              "NEM"
                            ],
                            "description": "How to compare the value."
                          },
                          "value": {
                            "description": "The value to compare, sent as an array."
                          }
                        }
                      }
                    }
                  }
                }
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": 42
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/users/getDisplayList": {
      "post": {
        "operationId": "users_getDisplayList",
        "tags": [
          "Users"
        ],
        "summary": "List users for a picker",
        "description": "Returns user names and IDs, handy for dropdowns.",
        "x-required-permission": "users.MANAGE_ORG_USERS",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filters": {
                    "type": "array",
                    "description": "Optional filters, see the Filtering guide."
                  }
                }
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "text",
                          "value"
                        ]
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "text": "Jamie Parker",
                      "value": 18
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/users/getUsersDisplayListByNames": {
      "post": {
        "operationId": "users_getUsersDisplayListByNames",
        "tags": [
          "Users"
        ],
        "summary": "List users by name",
        "description": "Returns your users by name, optionally only the active ones or those in one brand.",
        "x-required-permission": "marketingCampaigns.MANAGE",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "activeOnly": {
                    "type": "boolean",
                    "description": "Only return active users."
                  },
                  "brandId": {
                    "type": "integer",
                    "description": "Only return users of this brand."
                  }
                }
              },
              "example": {
                "activeOnly": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/users/getUserHierarchyTeammatesDisplayList": {
      "post": {
        "operationId": "users_getUserHierarchyTeammatesDisplayList",
        "tags": [
          "Users"
        ],
        "summary": "List teammates",
        "description": "Returns the teammates of the person who owns the API key.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "excludeCurrentUser": {
                    "type": "boolean",
                    "description": "Leave out the owner of the API key."
                  },
                  "brandId": {
                    "type": "integer",
                    "description": "Only return users of this brand."
                  }
                }
              },
              "example": {
                "excludeCurrentUser": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/users/updateUserProfilePhoto": {
      "post": {
        "operationId": "users_updateUserProfilePhoto",
        "tags": [
          "Users"
        ],
        "summary": "Upload a user photo",
        "description": "Uploads or replaces the profile photo of a team member. Send the request as `multipart/form-data`, with the file in a field called `profilePhotoFile`.",
        "x-required-permission": "users.MANAGE_ORG_USERS",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userId": {
                    "type": "integer",
                    "description": "ID of the user."
                  },
                  "profilePhotoFile": {
                    "type": "string",
                    "format": "binary",
                    "description": "The image file."
                  }
                },
                "required": [
                  "userId",
                  "profilePhotoFile"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/users/removeUserProfilePhoto": {
      "post": {
        "operationId": "users_removeUserProfilePhoto",
        "tags": [
          "Users"
        ],
        "summary": "Delete a user photo",
        "description": "Removes the profile photo of a team member.",
        "x-required-permission": "users.MANAGE_ORG_USERS",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userId": {
                    "type": "integer",
                    "description": "ID of the user."
                  }
                },
                "required": [
                  "userId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/users/updateCurrentUserProfilePhoto": {
      "post": {
        "operationId": "users_updateCurrentUserProfilePhoto",
        "tags": [
          "Users"
        ],
        "summary": "Upload your photo",
        "description": "Uploads or replaces the profile photo of the person who owns the API key. Send the request as `multipart/form-data`, with the file in a field called `profilePhotoFile`.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profilePhotoFile": {
                    "type": "string",
                    "format": "binary",
                    "description": "The image file."
                  }
                },
                "required": [
                  "profilePhotoFile"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/users/removeCurrentUserProfilePhoto": {
      "get": {
        "operationId": "users_removeCurrentUserProfilePhoto",
        "tags": [
          "Users"
        ],
        "summary": "Delete your photo",
        "description": "Removes the profile photo of the person who owns the API key.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "atsec_...",
        "description": "Your Estactics API key, sent as `Authorization: Bearer atsec_...`."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "success",
          "data"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "const": false
          },
          "data": {
            "type": "object",
            "required": [
              "message",
              "errorCode"
            ],
            "properties": {
              "message": {
                "type": "string",
                "description": "What went wrong."
              },
              "errorCode": {
                "type": "string",
                "description": "A stable code you can branch on."
              },
              "errorDetails": {
                "description": "Field-level details, when available."
              }
            }
          }
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "The request is not valid.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "data": {
                "message": "Your request failed on validation.",
                "errorCode": "ValidationError",
                "errorDetails": {}
              }
            }
          }
        }
      },
      "Unauthorized": {
        "description": "The API key is missing, invalid, expired or disabled.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "data": {
                "message": "Provided token is invalid",
                "errorCode": "Unauthorized.TokenNotValid",
                "errorDetails": {}
              }
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "Your plan limit has been reached.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "data": {
                "message": "Plan limit reached.",
                "errorCode": "PlanLimit",
                "errorDetails": {}
              }
            }
          }
        }
      },
      "Forbidden": {
        "description": "The API key does not have the permission this endpoint needs.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "data": {
                "message": "Endpoint is not valid for the user provided token.",
                "errorCode": "Forbidden.AccessNotGrantedForUserToken",
                "errorDetails": {}
              }
            }
          }
        }
      },
      "NotFound": {
        "description": "The record does not exist or belongs to another organization.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "success": false,
              "data": {
                "message": "Record not found.",
                "errorCode": "NotFound",
                "errorDetails": {}
              }
            }
          }
        }
      }
    }
  }
}