{
  "openapi": "3.0.3",
  "info": {
    "title": "Breakcold OpenAPI",
    "version": "3.1.0"
  },
  "servers": [
    {
      "url": "https://api.breakcold.com/rest"
    }
  ],
  "externalDocs": {
    "url": "https://developer.breakcold.com"
  },
  "paths": {
    "/me": {
      "get": {
        "operationId": "user-me",
        "summary": "Get user details",
        "tags": [
          "User"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "full_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "last_seen_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "handle": {
                      "type": "string",
                      "nullable": true
                    },
                    "avatar_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "is_LTD": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "email",
                    "full_name",
                    "created_at",
                    "handle",
                    "avatar_url"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/status": {
      "post": {
        "operationId": "status-create",
        "summary": "Create a status",
        "tags": [
          "Status"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "id_list": {
                    "type": "string"
                  },
                  "color": {
                    "type": "string",
                    "pattern": "^#([0-9A-F]{3}){1,2}$"
                  },
                  "success_rate": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100
                  },
                  "ai_enabled": {
                    "type": "boolean"
                  },
                  "order": {
                    "type": "integer"
                  },
                  "type": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "DEAL_LOST",
                          "DEAL_WON"
                        ]
                      },
                      {
                        "type": "string",
                        "nullable": true
                      }
                    ]
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "nullable": true,
                      "enum": [
                        "DEAL_WON",
                        "DEAL_LOST",
                        null
                      ]
                    },
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string",
                      "nullable": true
                    },
                    "order": {
                      "type": "integer",
                      "nullable": true
                    },
                    "color": {
                      "type": "string",
                      "nullable": true
                    },
                    "success_rate": {
                      "type": "integer",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "updated_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_space": {
                      "type": "string",
                      "nullable": true
                    },
                    "leads_order": {
                      "nullable": true
                    },
                    "ai_instructions": {
                      "nullable": true
                    },
                    "ai_rules": {
                      "nullable": true
                    },
                    "ai_instructions_text": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_rules_text": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_enabled": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "icon": {
                      "type": "string",
                      "nullable": true
                    },
                    "instructions": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_list": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "required": [
                    "type",
                    "id",
                    "name",
                    "order",
                    "color",
                    "success_rate",
                    "created_at",
                    "updated_at",
                    "id_space"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "status-updateMany",
        "summary": "Update many status",
        "tags": [
          "Status"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "order": {
                          "type": "integer"
                        },
                        "leads_order": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "success_rate": {
                          "type": "number",
                          "nullable": true,
                          "minimum": 0,
                          "maximum": 100
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "type": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "DEAL_LOST",
                                "DEAL_WON"
                              ]
                            },
                            {
                              "type": "string",
                              "nullable": true
                            }
                          ]
                        },
                        "color": {
                          "type": "string",
                          "pattern": "^#([0-9A-F]{3}){1,2}$"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "required": [
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/status/{id}": {
      "patch": {
        "operationId": "status-update",
        "summary": "Update a status",
        "tags": [
          "Status"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "id_list": {
                    "type": "string"
                  },
                  "instructions": {
                    "type": "string"
                  },
                  "color": {
                    "type": "string",
                    "pattern": "^#([0-9A-F]{3}){1,2}$"
                  },
                  "success_rate": {
                    "type": "number",
                    "nullable": true,
                    "minimum": 0,
                    "maximum": 100
                  },
                  "order": {
                    "type": "integer"
                  },
                  "type": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "DEAL_LOST",
                          "DEAL_WON"
                        ]
                      },
                      {
                        "type": "string",
                        "nullable": true
                      }
                    ]
                  },
                  "leads_order": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "ai_instructions": {},
                  "ai_rules": {},
                  "ai_instructions_text": {
                    "type": "string"
                  },
                  "ai_rules_text": {
                    "type": "string"
                  },
                  "ai_enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "nullable": true,
                      "enum": [
                        "DEAL_WON",
                        "DEAL_LOST",
                        null
                      ]
                    },
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string",
                      "nullable": true
                    },
                    "order": {
                      "type": "integer",
                      "nullable": true
                    },
                    "color": {
                      "type": "string",
                      "nullable": true
                    },
                    "success_rate": {
                      "type": "integer",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "updated_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_space": {
                      "type": "string",
                      "nullable": true
                    },
                    "leads_order": {
                      "nullable": true
                    },
                    "ai_instructions": {
                      "nullable": true
                    },
                    "ai_rules": {
                      "nullable": true
                    },
                    "ai_instructions_text": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_rules_text": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_enabled": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "icon": {
                      "type": "string",
                      "nullable": true
                    },
                    "instructions": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_list": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "required": [
                    "type",
                    "id",
                    "name",
                    "order",
                    "color",
                    "success_rate",
                    "created_at",
                    "updated_at",
                    "id_space"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "status-delete",
        "summary": "Delete a status",
        "tags": [
          "Status"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/workspaces": {
      "get": {
        "operationId": "workspace-list",
        "summary": "Get user workspaces",
        "tags": [
          "Workspaces"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "full",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "in": "query",
            "name": "role",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string",
                        "nullable": true
                      },
                      "avatar_url": {
                        "type": "string",
                        "nullable": true
                      },
                      "created_at": {
                        "type": "string",
                        "nullable": true
                      },
                      "updated_at": {
                        "type": "string",
                        "nullable": true
                      },
                      "tracking_domain": {
                        "type": "string",
                        "nullable": true
                      },
                      "language": {
                        "type": "string",
                        "nullable": true
                      },
                      "team_size": {
                        "type": "string",
                        "nullable": true
                      },
                      "source": {
                        "type": "string",
                        "nullable": true
                      },
                      "default_currency": {
                        "type": "string"
                      },
                      "default_phone_country": {
                        "type": "string",
                        "nullable": true
                      },
                      "organizationId": {
                        "type": "string"
                      },
                      "organization": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "avatar_url",
                      "created_at",
                      "updated_at",
                      "tracking_domain",
                      "language",
                      "team_size",
                      "source",
                      "default_currency",
                      "default_phone_country",
                      "organizationId"
                    ],
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/members": {
      "get": {
        "operationId": "member-list",
        "summary": "Get members of a workspace",
        "tags": [
          "Members"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "include_invitation",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "id_workspace",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "ADMIN",
                              "MANAGER",
                              "MEMBER",
                              "GUEST"
                            ]
                          },
                          "is_invitation": {
                            "type": "boolean",
                            "enum": [
                              false
                            ]
                          },
                          "user": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "handle": {
                                "type": "string",
                                "nullable": true
                              },
                              "full_name": {
                                "type": "string",
                                "nullable": true
                              },
                              "email": {
                                "type": "string",
                                "nullable": true
                              },
                              "avatar_url": {
                                "type": "string",
                                "nullable": true
                              }
                            },
                            "required": [
                              "id",
                              "handle",
                              "full_name",
                              "email",
                              "avatar_url"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "role",
                          "is_invitation",
                          "user"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "is_invitation": {
                            "type": "boolean",
                            "enum": [
                              true
                            ]
                          },
                          "token_expires_at": {
                            "type": "string",
                            "nullable": true
                          },
                          "status": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "ADMIN",
                              "MANAGER",
                              "MEMBER",
                              "GUEST"
                            ]
                          },
                          "user": {
                            "type": "object",
                            "properties": {
                              "token": {
                                "type": "string",
                                "nullable": true
                              },
                              "email": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "token",
                              "email"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "is_invitation",
                          "token_expires_at",
                          "status",
                          "role",
                          "user"
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/lead": {
      "post": {
        "operationId": "lead-create",
        "summary": "Create a lead",
        "tags": [
          "Leads"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "company": {
                    "type": "string",
                    "nullable": true
                  },
                  "company_role": {
                    "type": "string",
                    "nullable": true
                  },
                  "phone": {
                    "nullable": true,
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number"
                      }
                    ]
                  },
                  "first_name": {
                    "type": "string",
                    "nullable": true
                  },
                  "linkedin_url": {
                    "type": "string",
                    "nullable": true
                  },
                  "linkedin_company_url": {
                    "type": "string",
                    "nullable": true
                  },
                  "facebook_username": {
                    "type": "string"
                  },
                  "telegram_username": {
                    "type": "string"
                  },
                  "whatsapp_username": {
                    "type": "string"
                  },
                  "youtube_username": {
                    "type": "string"
                  },
                  "instagram_username": {
                    "type": "string"
                  },
                  "twitter_name": {
                    "type": "string",
                    "nullable": true
                  },
                  "twitter_company_name": {
                    "type": "string",
                    "nullable": true
                  },
                  "city": {
                    "type": "string",
                    "nullable": true
                  },
                  "last_name": {
                    "type": "string",
                    "nullable": true
                  },
                  "email": {
                    "type": "string",
                    "nullable": true
                  },
                  "is_company": {
                    "type": "boolean",
                    "default": false
                  },
                  "is_contract": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_company_if_not_exists": {
                    "type": "boolean",
                    "default": true
                  },
                  "avatar_url": {
                    "type": "string",
                    "nullable": true
                  },
                  "website_url": {
                    "type": "string",
                    "nullable": true
                  },
                  "lists": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "status": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "tags": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "owners": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "contract_currency": {
                    "type": "string",
                    "enum": [
                      "USD",
                      "EUR",
                      "JPY",
                      "GBP",
                      "AUD",
                      "CAD",
                      "CHF",
                      "CNY",
                      "HKD",
                      "NZD",
                      "INR",
                      "PLN"
                    ]
                  },
                  "contract_name": {
                    "type": "string",
                    "nullable": true
                  },
                  "contract_value": {
                    "nullable": true,
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number"
                      }
                    ]
                  },
                  "id_list": {
                    "type": "string"
                  },
                  "attributes": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "icebreaker": {
                    "type": "string",
                    "nullable": true
                  },
                  "icebreaker_2": {
                    "type": "string",
                    "nullable": true
                  },
                  "icebreaker_3": {
                    "type": "string",
                    "nullable": true
                  },
                  "icebreaker_4": {
                    "type": "string",
                    "nullable": true
                  },
                  "is_draft": {
                    "type": "boolean",
                    "default": false
                  },
                  "auto_assign_owner": {
                    "type": "boolean",
                    "default": true,
                    "description": "Auto assign the owner to the current user"
                  },
                  "company_avatar_url": {
                    "type": "string",
                    "nullable": true
                  },
                  "company_linkedin_url": {
                    "type": "string",
                    "nullable": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "email": {
                      "type": "string",
                      "nullable": true
                    },
                    "company": {
                      "type": "string",
                      "nullable": true
                    },
                    "phone": {
                      "type": "string",
                      "nullable": true
                    },
                    "linkedin_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "linkedin_company_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "facebook_username": {
                      "type": "string",
                      "nullable": true
                    },
                    "youtube_username": {
                      "type": "string",
                      "nullable": true
                    },
                    "instagram_username": {
                      "type": "string",
                      "nullable": true
                    },
                    "telegram_username": {
                      "type": "string",
                      "nullable": true
                    },
                    "whatsapp_username": {
                      "type": "string",
                      "nullable": true
                    },
                    "search_query": {
                      "type": "string",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "first_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "icebreaker": {
                      "type": "string",
                      "nullable": true
                    },
                    "last_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "website_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "timezone": {
                      "type": "string",
                      "nullable": true
                    },
                    "city": {
                      "type": "string",
                      "nullable": true
                    },
                    "company_role": {
                      "type": "string",
                      "nullable": true
                    },
                    "twitter_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "avatar_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "icebreaker_2": {
                      "type": "string",
                      "nullable": true
                    },
                    "icebreaker_3": {
                      "type": "string",
                      "nullable": true
                    },
                    "icebreaker_4": {
                      "type": "string",
                      "nullable": true
                    },
                    "email_bounce_score": {
                      "type": "integer",
                      "nullable": true
                    },
                    "twitter_company_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "is_company": {
                      "type": "boolean"
                    },
                    "is_contract": {
                      "type": "boolean"
                    },
                    "is_tracked": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "is_deleted": {
                      "type": "boolean"
                    },
                    "is_deleted_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "order": {
                      "type": "integer"
                    },
                    "contract_value": {
                      "type": "integer",
                      "nullable": true
                    },
                    "contract_currency": {
                      "type": "string",
                      "nullable": true
                    },
                    "contract_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "score": {
                      "type": "integer",
                      "nullable": true
                    },
                    "ai_enabled": {
                      "type": "boolean"
                    },
                    "ai_enabled_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_summary": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_profile": {
                      "type": "string",
                      "nullable": true
                    },
                    "is_draft": {
                      "type": "boolean"
                    },
                    "last_interaction_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_linkedin_company": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_linkedin": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_space": {
                      "type": "string",
                      "nullable": true
                    },
                    "usersId": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "required": [
                    "id",
                    "email",
                    "company",
                    "phone",
                    "linkedin_url",
                    "linkedin_company_url",
                    "facebook_username",
                    "youtube_username",
                    "instagram_username",
                    "telegram_username",
                    "whatsapp_username",
                    "search_query",
                    "created_at",
                    "updated_at",
                    "first_name",
                    "icebreaker",
                    "last_name",
                    "website_url",
                    "timezone",
                    "city",
                    "company_role",
                    "twitter_name",
                    "avatar_url",
                    "icebreaker_2",
                    "icebreaker_3",
                    "icebreaker_4",
                    "email_bounce_score",
                    "twitter_company_name",
                    "is_company",
                    "is_contract",
                    "is_tracked",
                    "is_deleted",
                    "is_deleted_at",
                    "order",
                    "contract_value",
                    "contract_currency",
                    "contract_name",
                    "score",
                    "ai_enabled",
                    "ai_enabled_at",
                    "ai_summary",
                    "ai_profile",
                    "is_draft",
                    "last_interaction_at",
                    "id_linkedin_company",
                    "id_linkedin",
                    "id_space",
                    "usersId"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/leads/{id}": {
      "delete": {
        "operationId": "lead-delete",
        "summary": "Delete a lead",
        "tags": [
          "Leads"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "delete_relations",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "lead-update",
        "summary": "Update a lead",
        "tags": [
          "Leads"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "company": {
                        "type": "string",
                        "nullable": true
                      },
                      "company_role": {
                        "type": "string",
                        "nullable": true
                      },
                      "facebook_username": {
                        "type": "string",
                        "nullable": true
                      },
                      "youtube_username": {
                        "type": "string",
                        "nullable": true
                      },
                      "instagram_username": {
                        "type": "string",
                        "nullable": true
                      },
                      "telegram_username": {
                        "type": "string",
                        "nullable": true
                      },
                      "whatsapp_username": {
                        "type": "string",
                        "nullable": true
                      },
                      "city": {
                        "type": "string",
                        "nullable": true
                      },
                      "phone": {
                        "nullable": true,
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "number"
                          }
                        ]
                      },
                      "icebreaker": {
                        "type": "string",
                        "nullable": true
                      },
                      "icebreaker_2": {
                        "type": "string",
                        "nullable": true
                      },
                      "icebreaker_3": {
                        "type": "string",
                        "nullable": true
                      },
                      "icebreaker_4": {
                        "type": "string",
                        "nullable": true
                      },
                      "contract_value": {
                        "nullable": true,
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "number"
                          }
                        ]
                      },
                      "id_linkedin": {
                        "type": "string",
                        "nullable": true
                      },
                      "contract_currency": {
                        "type": "string",
                        "enum": [
                          "USD",
                          "EUR",
                          "JPY",
                          "GBP",
                          "AUD",
                          "CAD",
                          "CHF",
                          "CNY",
                          "HKD",
                          "NZD",
                          "INR",
                          "PLN"
                        ]
                      },
                      "contract_name": {
                        "type": "string",
                        "nullable": true
                      },
                      "first_name": {
                        "type": "string",
                        "nullable": true
                      },
                      "linkedin_url": {
                        "type": "string",
                        "nullable": true
                      },
                      "linkedin_company_url": {
                        "type": "string",
                        "nullable": true
                      },
                      "twitter_name": {
                        "type": "string",
                        "nullable": true
                      },
                      "twitter_company_name": {
                        "type": "string",
                        "nullable": true
                      },
                      "email_bounce_score": {
                        "type": "number",
                        "nullable": true
                      },
                      "last_name": {
                        "type": "string",
                        "nullable": true
                      },
                      "id_list": {
                        "type": "string",
                        "nullable": true
                      },
                      "email": {
                        "type": "string",
                        "nullable": true
                      },
                      "is_company": {
                        "type": "boolean",
                        "nullable": true
                      },
                      "is_contract": {
                        "type": "boolean",
                        "nullable": true
                      },
                      "avatar_url": {
                        "type": "string",
                        "nullable": true
                      },
                      "website_url": {
                        "type": "string",
                        "nullable": true
                      },
                      "ai_enabled": {
                        "type": "boolean",
                        "nullable": true
                      },
                      "status_disconnect": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "status_connect": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "tags_disconnect": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "tags_connect": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "owners_disconnect": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "owners_connect": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "lists_connect": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "lists": {
                        "anyOf": [
                          {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          {
                            "type": "string"
                          }
                        ]
                      },
                      "status": {
                        "anyOf": [
                          {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          {
                            "type": "string"
                          }
                        ]
                      },
                      "tags": {
                        "anyOf": [
                          {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          {
                            "type": "string"
                          }
                        ]
                      },
                      "owners": {
                        "anyOf": [
                          {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          {
                            "type": "string"
                          }
                        ]
                      },
                      "attributes": {
                        "type": "object",
                        "additionalProperties": {}
                      },
                      "is_draft": {
                        "type": "boolean"
                      }
                    }
                  }
                },
                "required": [
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "email": {
                      "type": "string",
                      "nullable": true
                    },
                    "company": {
                      "type": "string",
                      "nullable": true
                    },
                    "phone": {
                      "type": "string",
                      "nullable": true
                    },
                    "linkedin_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "linkedin_company_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "facebook_username": {
                      "type": "string",
                      "nullable": true
                    },
                    "youtube_username": {
                      "type": "string",
                      "nullable": true
                    },
                    "instagram_username": {
                      "type": "string",
                      "nullable": true
                    },
                    "telegram_username": {
                      "type": "string",
                      "nullable": true
                    },
                    "whatsapp_username": {
                      "type": "string",
                      "nullable": true
                    },
                    "search_query": {
                      "type": "string",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "first_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "icebreaker": {
                      "type": "string",
                      "nullable": true
                    },
                    "last_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "website_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "timezone": {
                      "type": "string",
                      "nullable": true
                    },
                    "city": {
                      "type": "string",
                      "nullable": true
                    },
                    "company_role": {
                      "type": "string",
                      "nullable": true
                    },
                    "twitter_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "avatar_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "icebreaker_2": {
                      "type": "string",
                      "nullable": true
                    },
                    "icebreaker_3": {
                      "type": "string",
                      "nullable": true
                    },
                    "icebreaker_4": {
                      "type": "string",
                      "nullable": true
                    },
                    "email_bounce_score": {
                      "type": "integer",
                      "nullable": true
                    },
                    "twitter_company_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "is_company": {
                      "type": "boolean"
                    },
                    "is_contract": {
                      "type": "boolean"
                    },
                    "is_tracked": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "is_deleted": {
                      "type": "boolean"
                    },
                    "is_deleted_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "order": {
                      "type": "integer"
                    },
                    "contract_value": {
                      "type": "integer",
                      "nullable": true
                    },
                    "contract_currency": {
                      "type": "string",
                      "nullable": true
                    },
                    "contract_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "score": {
                      "type": "integer",
                      "nullable": true
                    },
                    "ai_enabled": {
                      "type": "boolean"
                    },
                    "ai_enabled_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_summary": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_profile": {
                      "type": "string",
                      "nullable": true
                    },
                    "is_draft": {
                      "type": "boolean"
                    },
                    "last_interaction_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_linkedin_company": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_linkedin": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_space": {
                      "type": "string",
                      "nullable": true
                    },
                    "usersId": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "required": [
                    "id",
                    "email",
                    "company",
                    "phone",
                    "linkedin_url",
                    "linkedin_company_url",
                    "facebook_username",
                    "youtube_username",
                    "instagram_username",
                    "telegram_username",
                    "whatsapp_username",
                    "search_query",
                    "created_at",
                    "updated_at",
                    "first_name",
                    "icebreaker",
                    "last_name",
                    "website_url",
                    "timezone",
                    "city",
                    "company_role",
                    "twitter_name",
                    "avatar_url",
                    "icebreaker_2",
                    "icebreaker_3",
                    "icebreaker_4",
                    "email_bounce_score",
                    "twitter_company_name",
                    "is_company",
                    "is_contract",
                    "is_tracked",
                    "is_deleted",
                    "is_deleted_at",
                    "order",
                    "contract_value",
                    "contract_currency",
                    "contract_name",
                    "score",
                    "ai_enabled",
                    "ai_enabled_at",
                    "ai_summary",
                    "ai_profile",
                    "is_draft",
                    "last_interaction_at",
                    "id_linkedin_company",
                    "id_linkedin",
                    "id_space",
                    "usersId"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "lead-getById",
        "summary": "Get a lead by id",
        "tags": [
          "Leads"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "email": {
                      "type": "string",
                      "nullable": true
                    },
                    "company": {
                      "type": "string",
                      "nullable": true
                    },
                    "phone": {
                      "type": "string",
                      "nullable": true
                    },
                    "linkedin_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "linkedin_company_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "facebook_username": {
                      "type": "string",
                      "nullable": true
                    },
                    "youtube_username": {
                      "type": "string",
                      "nullable": true
                    },
                    "instagram_username": {
                      "type": "string",
                      "nullable": true
                    },
                    "telegram_username": {
                      "type": "string",
                      "nullable": true
                    },
                    "whatsapp_username": {
                      "type": "string",
                      "nullable": true
                    },
                    "search_query": {
                      "type": "string",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "first_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "icebreaker": {
                      "type": "string",
                      "nullable": true
                    },
                    "last_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "website_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "timezone": {
                      "type": "string",
                      "nullable": true
                    },
                    "city": {
                      "type": "string",
                      "nullable": true
                    },
                    "company_role": {
                      "type": "string",
                      "nullable": true
                    },
                    "twitter_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "avatar_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "icebreaker_2": {
                      "type": "string",
                      "nullable": true
                    },
                    "icebreaker_3": {
                      "type": "string",
                      "nullable": true
                    },
                    "icebreaker_4": {
                      "type": "string",
                      "nullable": true
                    },
                    "email_bounce_score": {
                      "type": "integer",
                      "nullable": true
                    },
                    "twitter_company_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "is_company": {
                      "type": "boolean"
                    },
                    "is_contract": {
                      "type": "boolean"
                    },
                    "is_tracked": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "is_deleted": {
                      "type": "boolean"
                    },
                    "is_deleted_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "order": {
                      "type": "integer"
                    },
                    "contract_value": {
                      "type": "integer",
                      "nullable": true
                    },
                    "contract_currency": {
                      "type": "string",
                      "nullable": true
                    },
                    "contract_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "score": {
                      "type": "integer",
                      "nullable": true
                    },
                    "ai_enabled": {
                      "type": "boolean"
                    },
                    "ai_enabled_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_summary": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_profile": {
                      "type": "string",
                      "nullable": true
                    },
                    "is_draft": {
                      "type": "boolean"
                    },
                    "last_interaction_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_linkedin_company": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_linkedin": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_space": {
                      "type": "string",
                      "nullable": true
                    },
                    "usersId": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "required": [
                    "id",
                    "email",
                    "company",
                    "phone",
                    "linkedin_url",
                    "linkedin_company_url",
                    "facebook_username",
                    "youtube_username",
                    "instagram_username",
                    "telegram_username",
                    "whatsapp_username",
                    "search_query",
                    "created_at",
                    "updated_at",
                    "first_name",
                    "icebreaker",
                    "last_name",
                    "website_url",
                    "timezone",
                    "city",
                    "company_role",
                    "twitter_name",
                    "avatar_url",
                    "icebreaker_2",
                    "icebreaker_3",
                    "icebreaker_4",
                    "email_bounce_score",
                    "twitter_company_name",
                    "is_company",
                    "is_contract",
                    "is_tracked",
                    "is_deleted",
                    "is_deleted_at",
                    "order",
                    "contract_value",
                    "contract_currency",
                    "contract_name",
                    "score",
                    "ai_enabled",
                    "ai_enabled_at",
                    "ai_summary",
                    "ai_profile",
                    "is_draft",
                    "last_interaction_at",
                    "id_linkedin_company",
                    "id_linkedin",
                    "id_space",
                    "usersId"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/leads/delete-many": {
      "post": {
        "operationId": "lead-deleteMany",
        "summary": "Delete many leads",
        "tags": [
          "Leads"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filter": {
                    "type": "object",
                    "properties": {
                      "leads": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "not_leads": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "is_company": {
                        "type": "boolean"
                      },
                      "is_contract": {
                        "type": "boolean"
                      },
                      "is_tracked": {
                        "type": "boolean"
                      },
                      "ai_enabled": {
                        "type": "boolean"
                      },
                      "email_status": {
                        "type": "string",
                        "enum": [
                          "all",
                          "bounce",
                          "not-sure-bounce",
                          "valid",
                          "no-email",
                          "has-email"
                        ]
                      },
                      "search": {
                        "type": "string"
                      },
                      "has_icebreaker": {
                        "type": "boolean"
                      },
                      "tags": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "status": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "has_list": {
                        "type": "boolean"
                      },
                      "has_no_list": {
                        "type": "boolean"
                      },
                      "lists": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "has_owner": {
                        "type": "boolean"
                      },
                      "has_no_owner": {
                        "type": "boolean"
                      },
                      "owners": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "score": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "attributes": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "lat": {
                                      "type": "number"
                                    },
                                    "lng": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "lat",
                                    "lng"
                                  ]
                                }
                              ]
                            },
                            "operator": {
                              "type": "string",
                              "enum": [
                                "equals",
                                "not_equals",
                                "contains",
                                "not_contains",
                                "greater_than",
                                "less_than",
                                "greater_than_or_equal",
                                "less_than_or_equal",
                                "between",
                                "in",
                                "not_in",
                                "is_empty",
                                "is_not_empty"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "value",
                            "operator"
                          ]
                        }
                      }
                    }
                  }
                },
                "required": [
                  "filter"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/leads/list": {
      "post": {
        "operationId": "lead-list",
        "summary": "List leads with pagination and filters",
        "tags": [
          "Leads"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cursor": {
                    "type": "number"
                  },
                  "filter": {
                    "type": "object",
                    "properties": {
                      "leads": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "not_leads": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "is_company": {
                        "type": "boolean"
                      },
                      "is_contract": {
                        "type": "boolean"
                      },
                      "is_tracked": {
                        "type": "boolean"
                      },
                      "ai_enabled": {
                        "type": "boolean"
                      },
                      "email_status": {
                        "type": "string",
                        "enum": [
                          "all",
                          "bounce",
                          "not-sure-bounce",
                          "valid",
                          "no-email",
                          "has-email"
                        ]
                      },
                      "search": {
                        "type": "string"
                      },
                      "has_icebreaker": {
                        "type": "boolean"
                      },
                      "tags": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "status": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "has_list": {
                        "type": "boolean"
                      },
                      "has_no_list": {
                        "type": "boolean"
                      },
                      "lists": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "has_owner": {
                        "type": "boolean"
                      },
                      "has_no_owner": {
                        "type": "boolean"
                      },
                      "owners": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "score": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "attributes": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "lat": {
                                      "type": "number"
                                    },
                                    "lng": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "lat",
                                    "lng"
                                  ]
                                }
                              ]
                            },
                            "operator": {
                              "type": "string",
                              "enum": [
                                "equals",
                                "not_equals",
                                "contains",
                                "not_contains",
                                "greater_than",
                                "less_than",
                                "greater_than_or_equal",
                                "less_than_or_equal",
                                "between",
                                "in",
                                "not_in",
                                "is_empty",
                                "is_not_empty"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "value",
                            "operator"
                          ]
                        }
                      }
                    }
                  },
                  "pagination": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "all": {
                                "type": "boolean",
                                "enum": [
                                  true
                                ]
                              }
                            },
                            "required": [
                              "all"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "cursor": {
                                "type": "string"
                              },
                              "take": {
                                "type": "number",
                                "default": 0
                              },
                              "skip": {
                                "type": "number",
                                "default": 0
                              }
                            },
                            "required": [
                              "cursor"
                            ]
                          }
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "page": {
                            "type": "number",
                            "default": 0
                          },
                          "page_size": {
                            "type": "number",
                            "minimum": 10,
                            "maximum": 100,
                            "default": 30
                          }
                        }
                      }
                    ],
                    "default": {
                      "page": 0,
                      "page_size": 30
                    }
                  },
                  "orderBy": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "default": "created_at"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "asc",
                            "desc"
                          ],
                          "default": "desc"
                        }
                      }
                    },
                    "default": [
                      {
                        "field": "created_at",
                        "type": "desc"
                      }
                    ]
                  },
                  "include": {
                    "type": "boolean",
                    "default": true
                  },
                  "id_only": {
                    "type": "boolean"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "default",
                      "pipeline"
                    ],
                    "default": "default"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "leads": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "email": {
                            "type": "string",
                            "nullable": true
                          },
                          "company": {
                            "type": "string",
                            "nullable": true
                          },
                          "phone": {
                            "type": "string",
                            "nullable": true
                          },
                          "linkedin_url": {
                            "type": "string",
                            "nullable": true
                          },
                          "linkedin_company_url": {
                            "type": "string",
                            "nullable": true
                          },
                          "facebook_username": {
                            "type": "string",
                            "nullable": true
                          },
                          "youtube_username": {
                            "type": "string",
                            "nullable": true
                          },
                          "instagram_username": {
                            "type": "string",
                            "nullable": true
                          },
                          "telegram_username": {
                            "type": "string",
                            "nullable": true
                          },
                          "whatsapp_username": {
                            "type": "string",
                            "nullable": true
                          },
                          "search_query": {
                            "type": "string",
                            "nullable": true
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "updated_at": {
                            "type": "string",
                            "nullable": true
                          },
                          "first_name": {
                            "type": "string",
                            "nullable": true
                          },
                          "icebreaker": {
                            "type": "string",
                            "nullable": true
                          },
                          "last_name": {
                            "type": "string",
                            "nullable": true
                          },
                          "website_url": {
                            "type": "string",
                            "nullable": true
                          },
                          "timezone": {
                            "type": "string",
                            "nullable": true
                          },
                          "city": {
                            "type": "string",
                            "nullable": true
                          },
                          "company_role": {
                            "type": "string",
                            "nullable": true
                          },
                          "twitter_name": {
                            "type": "string",
                            "nullable": true
                          },
                          "avatar_url": {
                            "type": "string",
                            "nullable": true
                          },
                          "icebreaker_2": {
                            "type": "string",
                            "nullable": true
                          },
                          "icebreaker_3": {
                            "type": "string",
                            "nullable": true
                          },
                          "icebreaker_4": {
                            "type": "string",
                            "nullable": true
                          },
                          "email_bounce_score": {
                            "type": "integer",
                            "nullable": true
                          },
                          "twitter_company_name": {
                            "type": "string",
                            "nullable": true
                          },
                          "is_company": {
                            "type": "boolean"
                          },
                          "is_contract": {
                            "type": "boolean"
                          },
                          "is_tracked": {
                            "type": "boolean",
                            "nullable": true
                          },
                          "is_deleted": {
                            "type": "boolean"
                          },
                          "is_deleted_at": {
                            "type": "string",
                            "nullable": true
                          },
                          "order": {
                            "type": "integer"
                          },
                          "contract_value": {
                            "type": "integer",
                            "nullable": true
                          },
                          "contract_currency": {
                            "type": "string",
                            "nullable": true
                          },
                          "contract_name": {
                            "type": "string",
                            "nullable": true
                          },
                          "score": {
                            "type": "integer",
                            "nullable": true
                          },
                          "ai_enabled": {
                            "type": "boolean"
                          },
                          "ai_enabled_at": {
                            "type": "string",
                            "nullable": true
                          },
                          "ai_summary": {
                            "type": "string",
                            "nullable": true
                          },
                          "ai_profile": {
                            "type": "string",
                            "nullable": true
                          },
                          "is_draft": {
                            "type": "boolean"
                          },
                          "last_interaction_at": {
                            "type": "string",
                            "nullable": true
                          },
                          "id_linkedin_company": {
                            "type": "string",
                            "nullable": true
                          },
                          "id_linkedin": {
                            "type": "string",
                            "nullable": true
                          },
                          "id_space": {
                            "type": "string",
                            "nullable": true
                          },
                          "usersId": {
                            "type": "string",
                            "nullable": true
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "pagination": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "all": {
                                  "type": "boolean",
                                  "enum": [
                                    true
                                  ]
                                }
                              },
                              "required": [
                                "all"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "cursor": {
                                  "type": "string"
                                },
                                "take": {
                                  "type": "number",
                                  "default": 0
                                },
                                "skip": {
                                  "type": "number",
                                  "default": 0
                                }
                              },
                              "required": [
                                "cursor",
                                "take",
                                "skip"
                              ]
                            }
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "page": {
                              "type": "number",
                              "default": 0
                            },
                            "page_size": {
                              "type": "number",
                              "minimum": 10,
                              "maximum": 100,
                              "default": 30
                            }
                          },
                          "required": [
                            "page",
                            "page_size"
                          ]
                        }
                      ],
                      "default": {
                        "page": 0,
                        "page_size": 30
                      }
                    },
                    "total": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "leads",
                    "pagination",
                    "total"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/leads/{id_lead}/connect": {
      "post": {
        "operationId": "lead-connectToLead",
        "summary": "Connect a lead to a company",
        "description": "id_lead need to be the company ID, id_lead_2 is the lead ID",
        "tags": [
          "Leads"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id_lead",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id_lead_2": {
                    "type": "string"
                  }
                },
                "required": [
                  "id_lead_2"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/leads/{id_lead}/disconnect": {
      "post": {
        "operationId": "lead-disconnectFromLead",
        "summary": "Disconnect a lead from a company",
        "description": "id_lead need to be the company ID, id_lead_2 is the lead ID",
        "tags": [
          "Leads"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id_lead",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id_lead_2": {
                    "type": "string"
                  }
                },
                "required": [
                  "id_lead_2"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/leads/search": {
      "post": {
        "operationId": "lead-search",
        "summary": "Search leads",
        "tags": [
          "Leads"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "linkedin_url": {
                    "type": "string"
                  },
                  "twitter_name": {
                    "type": "string"
                  },
                  "facebook_username": {
                    "type": "string"
                  },
                  "youtube_username": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "instagram_username": {
                    "type": "string"
                  },
                  "telegram_username": {
                    "type": "string"
                  },
                  "whatsapp_username": {
                    "type": "string"
                  },
                  "website_url": {
                    "type": "string"
                  },
                  "is_company": {
                    "type": "boolean"
                  },
                  "linkedin_company_url": {
                    "type": "string"
                  },
                  "company": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "nullable": true,
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "email": {
                      "type": "string",
                      "nullable": true
                    },
                    "company": {
                      "type": "string",
                      "nullable": true
                    },
                    "phone": {
                      "type": "string",
                      "nullable": true
                    },
                    "linkedin_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "linkedin_company_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "facebook_username": {
                      "type": "string",
                      "nullable": true
                    },
                    "youtube_username": {
                      "type": "string",
                      "nullable": true
                    },
                    "instagram_username": {
                      "type": "string",
                      "nullable": true
                    },
                    "telegram_username": {
                      "type": "string",
                      "nullable": true
                    },
                    "whatsapp_username": {
                      "type": "string",
                      "nullable": true
                    },
                    "search_query": {
                      "type": "string",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "first_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "icebreaker": {
                      "type": "string",
                      "nullable": true
                    },
                    "last_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "website_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "timezone": {
                      "type": "string",
                      "nullable": true
                    },
                    "city": {
                      "type": "string",
                      "nullable": true
                    },
                    "company_role": {
                      "type": "string",
                      "nullable": true
                    },
                    "twitter_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "avatar_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "icebreaker_2": {
                      "type": "string",
                      "nullable": true
                    },
                    "icebreaker_3": {
                      "type": "string",
                      "nullable": true
                    },
                    "icebreaker_4": {
                      "type": "string",
                      "nullable": true
                    },
                    "email_bounce_score": {
                      "type": "integer",
                      "nullable": true
                    },
                    "twitter_company_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "is_company": {
                      "type": "boolean"
                    },
                    "is_contract": {
                      "type": "boolean"
                    },
                    "is_tracked": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "is_deleted": {
                      "type": "boolean"
                    },
                    "is_deleted_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "order": {
                      "type": "integer"
                    },
                    "contract_value": {
                      "type": "integer",
                      "nullable": true
                    },
                    "contract_currency": {
                      "type": "string",
                      "nullable": true
                    },
                    "contract_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "score": {
                      "type": "integer",
                      "nullable": true
                    },
                    "ai_enabled": {
                      "type": "boolean"
                    },
                    "ai_enabled_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_summary": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_profile": {
                      "type": "string",
                      "nullable": true
                    },
                    "is_draft": {
                      "type": "boolean"
                    },
                    "last_interaction_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_linkedin_company": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_linkedin": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_space": {
                      "type": "string",
                      "nullable": true
                    },
                    "usersId": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "required": [
                    "id",
                    "email",
                    "company",
                    "phone",
                    "linkedin_url",
                    "linkedin_company_url",
                    "facebook_username",
                    "youtube_username",
                    "instagram_username",
                    "telegram_username",
                    "whatsapp_username",
                    "search_query",
                    "created_at",
                    "updated_at",
                    "first_name",
                    "icebreaker",
                    "last_name",
                    "website_url",
                    "timezone",
                    "city",
                    "company_role",
                    "twitter_name",
                    "avatar_url",
                    "icebreaker_2",
                    "icebreaker_3",
                    "icebreaker_4",
                    "email_bounce_score",
                    "twitter_company_name",
                    "is_company",
                    "is_contract",
                    "is_tracked",
                    "is_deleted",
                    "is_deleted_at",
                    "order",
                    "contract_value",
                    "contract_currency",
                    "contract_name",
                    "score",
                    "ai_enabled",
                    "ai_enabled_at",
                    "ai_summary",
                    "ai_profile",
                    "is_draft",
                    "last_interaction_at",
                    "id_linkedin_company",
                    "id_linkedin",
                    "id_space",
                    "usersId"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/tags/{id}": {
      "get": {
        "operationId": "tag-getById",
        "summary": "Get a tag by id",
        "tags": [
          "Tags"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string",
                      "nullable": true
                    },
                    "order": {
                      "type": "integer",
                      "nullable": true
                    },
                    "show": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "color": {
                      "type": "string",
                      "nullable": true
                    },
                    "icon": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_list": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_space": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_instructions": {
                      "nullable": true
                    },
                    "ai_rules": {
                      "nullable": true
                    },
                    "ai_instructions_text": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_rules_text": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_enabled": {
                      "type": "boolean",
                      "nullable": true
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "order",
                    "show",
                    "created_at",
                    "updated_at",
                    "color",
                    "icon",
                    "id_list",
                    "id_space"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "tag-update",
        "summary": "Update a tag",
        "tags": [
          "Tags"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "color": {
                    "type": "string",
                    "pattern": "^#([0-9A-F]{3}){1,2}$"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string",
                      "nullable": true
                    },
                    "order": {
                      "type": "integer",
                      "nullable": true
                    },
                    "show": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "color": {
                      "type": "string",
                      "nullable": true
                    },
                    "icon": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_list": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_space": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_instructions": {
                      "nullable": true
                    },
                    "ai_rules": {
                      "nullable": true
                    },
                    "ai_instructions_text": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_rules_text": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_enabled": {
                      "type": "boolean",
                      "nullable": true
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "order",
                    "show",
                    "created_at",
                    "updated_at",
                    "color",
                    "icon",
                    "id_list",
                    "id_space"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "tag-delete",
        "summary": "Delete a tag",
        "tags": [
          "Tags"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/tags": {
      "get": {
        "operationId": "tag-list",
        "summary": "List tags",
        "tags": [
          "Tags"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "id_lead",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "name": {
                        "type": "string",
                        "nullable": true
                      },
                      "order": {
                        "type": "integer",
                        "nullable": true
                      },
                      "show": {
                        "type": "boolean",
                        "nullable": true
                      },
                      "created_at": {
                        "type": "string"
                      },
                      "updated_at": {
                        "type": "string",
                        "nullable": true
                      },
                      "color": {
                        "type": "string",
                        "nullable": true
                      },
                      "icon": {
                        "type": "string",
                        "nullable": true
                      },
                      "id_list": {
                        "type": "string",
                        "nullable": true
                      },
                      "id_space": {
                        "type": "string",
                        "nullable": true
                      },
                      "ai_instructions": {
                        "nullable": true
                      },
                      "ai_rules": {
                        "nullable": true
                      },
                      "ai_instructions_text": {
                        "type": "string",
                        "nullable": true
                      },
                      "ai_rules_text": {
                        "type": "string",
                        "nullable": true
                      },
                      "ai_enabled": {
                        "type": "boolean",
                        "nullable": true
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "order",
                      "show",
                      "created_at",
                      "updated_at",
                      "color",
                      "icon",
                      "id_list",
                      "id_space"
                    ],
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "tag-create",
        "summary": "Create a tag",
        "tags": [
          "Tags"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "color": {
                    "type": "string",
                    "pattern": "^#([0-9A-F]{3}){1,2}$"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string",
                      "nullable": true
                    },
                    "order": {
                      "type": "integer",
                      "nullable": true
                    },
                    "show": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "color": {
                      "type": "string",
                      "nullable": true
                    },
                    "icon": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_list": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_space": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_instructions": {
                      "nullable": true
                    },
                    "ai_rules": {
                      "nullable": true
                    },
                    "ai_instructions_text": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_rules_text": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_enabled": {
                      "type": "boolean",
                      "nullable": true
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "order",
                    "show",
                    "created_at",
                    "updated_at",
                    "color",
                    "icon",
                    "id_list",
                    "id_space"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/lists/{id}/add-leads": {
      "post": {
        "operationId": "list-addLeads",
        "summary": "Add many leads to a list",
        "description": "Add your leads to a list based on filters",
        "tags": [
          "Lists",
          "Leads"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filter": {
                    "type": "object",
                    "properties": {
                      "leads": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "not_leads": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "is_company": {
                        "type": "boolean"
                      },
                      "is_contract": {
                        "type": "boolean"
                      },
                      "is_tracked": {
                        "type": "boolean"
                      },
                      "ai_enabled": {
                        "type": "boolean"
                      },
                      "email_status": {
                        "type": "string",
                        "enum": [
                          "all",
                          "bounce",
                          "not-sure-bounce",
                          "valid",
                          "no-email",
                          "has-email"
                        ]
                      },
                      "search": {
                        "type": "string"
                      },
                      "has_icebreaker": {
                        "type": "boolean"
                      },
                      "tags": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "status": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "has_list": {
                        "type": "boolean"
                      },
                      "has_no_list": {
                        "type": "boolean"
                      },
                      "lists": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "has_owner": {
                        "type": "boolean"
                      },
                      "has_no_owner": {
                        "type": "boolean"
                      },
                      "owners": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "score": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "attributes": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "lat": {
                                      "type": "number"
                                    },
                                    "lng": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "lat",
                                    "lng"
                                  ]
                                }
                              ]
                            },
                            "operator": {
                              "type": "string",
                              "enum": [
                                "equals",
                                "not_equals",
                                "contains",
                                "not_contains",
                                "greater_than",
                                "less_than",
                                "greater_than_or_equal",
                                "less_than_or_equal",
                                "between",
                                "in",
                                "not_in",
                                "is_empty",
                                "is_not_empty"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "value",
                            "operator"
                          ]
                        }
                      }
                    }
                  }
                },
                "required": [
                  "filter"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/lists/{id}/move-leads": {
      "post": {
        "operationId": "list-moveLeads",
        "summary": "Move many leads to a list",
        "description": "Move your leads to a list based on filters",
        "tags": [
          "Lists",
          "Leads"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id_source": {
                    "type": "string"
                  },
                  "filter": {
                    "type": "object",
                    "properties": {
                      "leads": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "not_leads": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "is_company": {
                        "type": "boolean"
                      },
                      "is_contract": {
                        "type": "boolean"
                      },
                      "is_tracked": {
                        "type": "boolean"
                      },
                      "ai_enabled": {
                        "type": "boolean"
                      },
                      "email_status": {
                        "type": "string",
                        "enum": [
                          "all",
                          "bounce",
                          "not-sure-bounce",
                          "valid",
                          "no-email",
                          "has-email"
                        ]
                      },
                      "search": {
                        "type": "string"
                      },
                      "has_icebreaker": {
                        "type": "boolean"
                      },
                      "tags": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "status": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "has_list": {
                        "type": "boolean"
                      },
                      "has_no_list": {
                        "type": "boolean"
                      },
                      "lists": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "has_owner": {
                        "type": "boolean"
                      },
                      "has_no_owner": {
                        "type": "boolean"
                      },
                      "owners": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "score": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "attributes": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "lat": {
                                      "type": "number"
                                    },
                                    "lng": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "lat",
                                    "lng"
                                  ]
                                }
                              ]
                            },
                            "operator": {
                              "type": "string",
                              "enum": [
                                "equals",
                                "not_equals",
                                "contains",
                                "not_contains",
                                "greater_than",
                                "less_than",
                                "greater_than_or_equal",
                                "less_than_or_equal",
                                "between",
                                "in",
                                "not_in",
                                "is_empty",
                                "is_not_empty"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "value",
                            "operator"
                          ]
                        }
                      }
                    }
                  }
                },
                "required": [
                  "id_source",
                  "filter"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/lists/{id}/remove-leads": {
      "post": {
        "operationId": "list-removeLeads",
        "summary": "Remove many leads from a list",
        "description": "Remove your leads from a list based on filters",
        "tags": [
          "Lists",
          "Leads"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filter": {
                    "type": "object",
                    "properties": {
                      "leads": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "not_leads": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "is_company": {
                        "type": "boolean"
                      },
                      "is_contract": {
                        "type": "boolean"
                      },
                      "is_tracked": {
                        "type": "boolean"
                      },
                      "ai_enabled": {
                        "type": "boolean"
                      },
                      "email_status": {
                        "type": "string",
                        "enum": [
                          "all",
                          "bounce",
                          "not-sure-bounce",
                          "valid",
                          "no-email",
                          "has-email"
                        ]
                      },
                      "search": {
                        "type": "string"
                      },
                      "has_icebreaker": {
                        "type": "boolean"
                      },
                      "tags": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "status": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "has_list": {
                        "type": "boolean"
                      },
                      "has_no_list": {
                        "type": "boolean"
                      },
                      "lists": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "has_owner": {
                        "type": "boolean"
                      },
                      "has_no_owner": {
                        "type": "boolean"
                      },
                      "owners": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "score": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "attributes": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "lat": {
                                      "type": "number"
                                    },
                                    "lng": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "lat",
                                    "lng"
                                  ]
                                }
                              ]
                            },
                            "operator": {
                              "type": "string",
                              "enum": [
                                "equals",
                                "not_equals",
                                "contains",
                                "not_contains",
                                "greater_than",
                                "less_than",
                                "greater_than_or_equal",
                                "less_than_or_equal",
                                "between",
                                "in",
                                "not_in",
                                "is_empty",
                                "is_not_empty"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "value",
                            "operator"
                          ]
                        }
                      }
                    }
                  }
                },
                "required": [
                  "filter"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/lists": {
      "post": {
        "operationId": "list-create",
        "summary": "Create a list",
        "tags": [
          "Lists"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "emoji": {
                    "type": "string",
                    "nullable": true,
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string",
                      "nullable": true
                    },
                    "order": {
                      "type": "integer",
                      "nullable": true
                    },
                    "emoji": {
                      "type": "string",
                      "nullable": true
                    },
                    "description": {
                      "type": "string",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "can_be_delete": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "deleted_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "is_deleted": {
                      "type": "boolean"
                    },
                    "favorite": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "id_space": {
                      "type": "string",
                      "nullable": true
                    },
                    "attribute_definitions_order": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "ai_instructions": {
                      "nullable": true
                    },
                    "ai_rules": {
                      "nullable": true
                    },
                    "ai_instructions_text": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_rules_text": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_enabled": {
                      "type": "boolean",
                      "nullable": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "list-list",
        "summary": "Get all lists",
        "tags": [
          "Lists"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "name": {
                        "type": "string",
                        "nullable": true
                      },
                      "order": {
                        "type": "integer",
                        "nullable": true
                      },
                      "emoji": {
                        "type": "string",
                        "nullable": true
                      },
                      "description": {
                        "type": "string",
                        "nullable": true
                      },
                      "created_at": {
                        "type": "string"
                      },
                      "updated_at": {
                        "type": "string",
                        "nullable": true
                      },
                      "can_be_delete": {
                        "type": "boolean",
                        "nullable": true
                      },
                      "deleted_at": {
                        "type": "string",
                        "nullable": true
                      },
                      "is_deleted": {
                        "type": "boolean"
                      },
                      "favorite": {
                        "type": "boolean",
                        "nullable": true
                      },
                      "id_space": {
                        "type": "string",
                        "nullable": true
                      },
                      "attribute_definitions_order": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "ai_instructions": {
                        "nullable": true
                      },
                      "ai_rules": {
                        "nullable": true
                      },
                      "ai_instructions_text": {
                        "type": "string",
                        "nullable": true
                      },
                      "ai_rules_text": {
                        "type": "string",
                        "nullable": true
                      },
                      "ai_enabled": {
                        "type": "boolean",
                        "nullable": true
                      }
                    },
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/lists/{id}": {
      "patch": {
        "operationId": "list-update",
        "summary": "Update a list",
        "tags": [
          "Lists"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 255
                  },
                  "emoji": {
                    "type": "string",
                    "nullable": true,
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "schema": {},
                  "attribute_definitions_order": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "ai_instructions": {},
                  "ai_instructions_text": {
                    "type": "string"
                  },
                  "ai_rules": {},
                  "ai_rules_text": {
                    "type": "string"
                  },
                  "ai_enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string",
                      "nullable": true
                    },
                    "order": {
                      "type": "integer",
                      "nullable": true
                    },
                    "emoji": {
                      "type": "string",
                      "nullable": true
                    },
                    "description": {
                      "type": "string",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "can_be_delete": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "deleted_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "is_deleted": {
                      "type": "boolean"
                    },
                    "favorite": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "id_space": {
                      "type": "string",
                      "nullable": true
                    },
                    "attribute_definitions_order": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "ai_instructions": {
                      "nullable": true
                    },
                    "ai_rules": {
                      "nullable": true
                    },
                    "ai_instructions_text": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_rules_text": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_enabled": {
                      "type": "boolean",
                      "nullable": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "list-delete",
        "summary": "Delete a list",
        "tags": [
          "Lists"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "delete_leads",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/lists/{id}/duplicate": {
      "post": {
        "operationId": "list-duplicate",
        "summary": "Duplicate a list",
        "tags": [
          "Lists"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string",
                      "nullable": true
                    },
                    "order": {
                      "type": "integer",
                      "nullable": true
                    },
                    "emoji": {
                      "type": "string",
                      "nullable": true
                    },
                    "description": {
                      "type": "string",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "can_be_delete": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "deleted_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "is_deleted": {
                      "type": "boolean"
                    },
                    "favorite": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "id_space": {
                      "type": "string",
                      "nullable": true
                    },
                    "attribute_definitions_order": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "ai_instructions": {
                      "nullable": true
                    },
                    "ai_rules": {
                      "nullable": true
                    },
                    "ai_instructions_text": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_rules_text": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_enabled": {
                      "type": "boolean",
                      "nullable": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/notes/list": {
      "post": {
        "operationId": "note-list",
        "summary": "List notes",
        "tags": [
          "Notes"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id_lead": {
                    "type": "string"
                  },
                  "thread_id": {
                    "type": "string"
                  },
                  "pagination": {
                    "type": "object",
                    "properties": {
                      "page_size": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100,
                        "default": 50
                      },
                      "page": {
                        "type": "number",
                        "minimum": 0,
                        "default": 0
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "content": {
                        "type": "string",
                        "nullable": true
                      },
                      "created_at": {
                        "type": "string"
                      },
                      "updated_at": {
                        "type": "string",
                        "nullable": true
                      },
                      "is_deleted": {
                        "type": "boolean"
                      },
                      "is_edited": {
                        "type": "boolean"
                      },
                      "is_pinned": {
                        "type": "boolean"
                      },
                      "is_edited_at": {
                        "type": "string",
                        "nullable": true
                      },
                      "is_pinned_at": {
                        "type": "string",
                        "nullable": true
                      },
                      "thread_id": {
                        "type": "string",
                        "nullable": true
                      },
                      "message_id": {
                        "type": "string",
                        "nullable": true
                      },
                      "id_parent": {
                        "type": "string",
                        "nullable": true
                      },
                      "id_lead": {
                        "type": "string",
                        "nullable": true
                      },
                      "id_space": {
                        "type": "string",
                        "nullable": true
                      }
                    },
                    "required": [
                      "id",
                      "content",
                      "created_at",
                      "updated_at",
                      "is_deleted",
                      "is_edited",
                      "is_pinned",
                      "is_edited_at",
                      "is_pinned_at",
                      "thread_id",
                      "message_id",
                      "id_parent",
                      "id_lead",
                      "id_space"
                    ],
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/notes": {
      "post": {
        "operationId": "note-create",
        "summary": "Create a note",
        "tags": [
          "Notes"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id_lead": {
                    "type": "string"
                  },
                  "content": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 5000
                  },
                  "id_parent": {
                    "type": "string"
                  },
                  "thread_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "content"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "content": {
                      "type": "string",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "is_deleted": {
                      "type": "boolean"
                    },
                    "is_edited": {
                      "type": "boolean"
                    },
                    "is_pinned": {
                      "type": "boolean"
                    },
                    "is_edited_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "is_pinned_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "thread_id": {
                      "type": "string",
                      "nullable": true
                    },
                    "message_id": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_parent": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_lead": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_space": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "required": [
                    "id",
                    "content",
                    "created_at",
                    "updated_at",
                    "is_deleted",
                    "is_edited",
                    "is_pinned",
                    "is_edited_at",
                    "is_pinned_at",
                    "thread_id",
                    "message_id",
                    "id_parent",
                    "id_lead",
                    "id_space"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/notes/{id}": {
      "patch": {
        "operationId": "note-update",
        "summary": "Update a note",
        "tags": [
          "Notes"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "content": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 5000
                  }
                },
                "required": [
                  "content"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "content": {
                      "type": "string",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "is_deleted": {
                      "type": "boolean"
                    },
                    "is_edited": {
                      "type": "boolean"
                    },
                    "is_pinned": {
                      "type": "boolean"
                    },
                    "is_edited_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "is_pinned_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "thread_id": {
                      "type": "string",
                      "nullable": true
                    },
                    "message_id": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_parent": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_lead": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_space": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "required": [
                    "id",
                    "content",
                    "created_at",
                    "updated_at",
                    "is_deleted",
                    "is_edited",
                    "is_pinned",
                    "is_edited_at",
                    "is_pinned_at",
                    "thread_id",
                    "message_id",
                    "id_parent",
                    "id_lead",
                    "id_space"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "note-delete",
        "summary": "Delete a note",
        "tags": [
          "Notes"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "note-getById",
        "summary": "Get a note",
        "tags": [
          "Notes"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "content": {
                      "type": "string",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "is_deleted": {
                      "type": "boolean"
                    },
                    "is_edited": {
                      "type": "boolean"
                    },
                    "is_pinned": {
                      "type": "boolean"
                    },
                    "is_edited_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "is_pinned_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "thread_id": {
                      "type": "string",
                      "nullable": true
                    },
                    "message_id": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_parent": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_lead": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_space": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "required": [
                    "id",
                    "content",
                    "created_at",
                    "updated_at",
                    "is_deleted",
                    "is_edited",
                    "is_pinned",
                    "is_edited_at",
                    "is_pinned_at",
                    "thread_id",
                    "message_id",
                    "id_parent",
                    "id_lead",
                    "id_space"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/reminders/list": {
      "post": {
        "operationId": "reminder-list",
        "summary": "List reminders with filters and pagination",
        "tags": [
          "Reminders"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cursor": {
                    "type": "number",
                    "nullable": true
                  },
                  "filter": {
                    "type": "object",
                    "properties": {
                      "leads_filter": {
                        "type": "object",
                        "properties": {
                          "leads": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "not_leads": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "is_company": {
                            "type": "boolean"
                          },
                          "is_contract": {
                            "type": "boolean"
                          },
                          "is_tracked": {
                            "type": "boolean"
                          },
                          "ai_enabled": {
                            "type": "boolean"
                          },
                          "email_status": {
                            "type": "string",
                            "enum": [
                              "all",
                              "bounce",
                              "not-sure-bounce",
                              "valid",
                              "no-email",
                              "has-email"
                            ]
                          },
                          "search": {
                            "type": "string"
                          },
                          "has_icebreaker": {
                            "type": "boolean"
                          },
                          "tags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "status": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "has_list": {
                            "type": "boolean"
                          },
                          "has_no_list": {
                            "type": "boolean"
                          },
                          "lists": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "has_owner": {
                            "type": "boolean"
                          },
                          "has_no_owner": {
                            "type": "boolean"
                          },
                          "owners": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "score": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "attributes": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "lat": {
                                          "type": "number"
                                        },
                                        "lng": {
                                          "type": "number"
                                        }
                                      },
                                      "required": [
                                        "lat",
                                        "lng"
                                      ]
                                    }
                                  ]
                                },
                                "operator": {
                                  "type": "string",
                                  "enum": [
                                    "equals",
                                    "not_equals",
                                    "contains",
                                    "not_contains",
                                    "greater_than",
                                    "less_than",
                                    "greater_than_or_equal",
                                    "less_than_or_equal",
                                    "between",
                                    "in",
                                    "not_in",
                                    "is_empty",
                                    "is_not_empty"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "value",
                                "operator"
                              ]
                            }
                          }
                        }
                      },
                      "id_lead": {
                        "type": "string"
                      },
                      "id_list": {
                        "type": "string"
                      },
                      "is_done": {
                        "type": "boolean"
                      },
                      "id_status": {
                        "type": "string"
                      },
                      "users": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "search": {
                        "type": "string"
                      },
                      "late_tasks": {
                        "type": "boolean"
                      },
                      "ai_generated": {
                        "type": "boolean"
                      },
                      "ai_action_channel": {
                        "type": "string"
                      },
                      "ai_action_priority": {
                        "type": "string"
                      },
                      "date_from": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "date_to": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "no_date": {
                        "type": "boolean"
                      }
                    }
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "orderBy": {
                    "type": "object",
                    "properties": {
                      "field": {
                        "type": "string",
                        "enum": [
                          "name",
                          "created_at",
                          "updated_at"
                        ],
                        "default": "created_at"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "asc",
                          "desc"
                        ],
                        "default": "desc"
                      }
                    }
                  },
                  "pagination": {
                    "type": "object",
                    "properties": {
                      "page": {
                        "type": "number",
                        "minimum": 0
                      },
                      "page_size": {
                        "type": "number",
                        "minimum": 1,
                        "maximum": 100
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "date": {
                            "type": "string",
                            "nullable": true
                          },
                          "name": {
                            "type": "string",
                            "nullable": true
                          },
                          "cron": {
                            "type": "string",
                            "nullable": true
                          },
                          "cron_id": {
                            "type": "string",
                            "nullable": true
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "updated_at": {
                            "type": "string",
                            "nullable": true
                          },
                          "is_deleted": {
                            "type": "boolean"
                          },
                          "is_done": {
                            "type": "boolean"
                          },
                          "ressource_link": {
                            "type": "string",
                            "nullable": true
                          },
                          "ai_generated": {
                            "type": "boolean",
                            "nullable": true
                          },
                          "ai_action_channel": {
                            "type": "string",
                            "nullable": true
                          },
                          "ai_action_description": {
                            "type": "string",
                            "nullable": true
                          },
                          "ai_action_priority": {
                            "type": "string",
                            "nullable": true
                          },
                          "ai_action_reasoning": {
                            "type": "string",
                            "nullable": true
                          },
                          "ai_time_precision": {
                            "type": "string",
                            "nullable": true
                          },
                          "ai_followup_strategy": {
                            "type": "string",
                            "nullable": true
                          },
                          "ai_action_rationale": {
                            "type": "string",
                            "nullable": true
                          },
                          "ai_draft_subject": {
                            "type": "string",
                            "nullable": true
                          },
                          "ai_draft_message": {
                            "type": "string",
                            "nullable": true
                          },
                          "ai_draft_metadata": {
                            "type": "string",
                            "nullable": true
                          },
                          "id_lead": {
                            "type": "string",
                            "nullable": true
                          },
                          "id_space": {
                            "type": "string",
                            "nullable": true
                          }
                        },
                        "required": [
                          "id",
                          "date",
                          "name",
                          "cron",
                          "cron_id",
                          "created_at",
                          "updated_at",
                          "is_deleted",
                          "is_done",
                          "ressource_link",
                          "ai_generated",
                          "ai_action_channel",
                          "ai_action_description",
                          "ai_action_priority",
                          "ai_action_reasoning",
                          "ai_time_precision",
                          "ai_followup_strategy",
                          "ai_action_rationale",
                          "ai_draft_subject",
                          "ai_draft_message",
                          "ai_draft_metadata",
                          "id_lead",
                          "id_space"
                        ],
                        "additionalProperties": true
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "number"
                        },
                        "page_size": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "page",
                        "page_size"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/reminders/{id}": {
      "patch": {
        "operationId": "reminder-update",
        "summary": "Update a reminder",
        "tags": [
          "Reminders"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id_lead": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "date": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "cron": {
                    "anyOf": [
                      {
                        "type": "string",
                        "nullable": true
                      },
                      {
                        "type": "string",
                        "pattern": "^(\\*|([0-5]?[0-9])) (\\*|([01]?[0-9]|2[0-3])) (\\*|([01]?[0-9]|2[0-3]|3[01])) (\\*|([1-9]|1[012])) (\\*|([0-6]))(\\s?(\\*|([0-5]?[0-9]))){0,2}$"
                      }
                    ]
                  },
                  "is_done": {
                    "type": "boolean"
                  },
                  "users": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "date": {
                      "type": "string",
                      "nullable": true
                    },
                    "name": {
                      "type": "string",
                      "nullable": true
                    },
                    "cron": {
                      "type": "string",
                      "nullable": true
                    },
                    "cron_id": {
                      "type": "string",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "is_deleted": {
                      "type": "boolean"
                    },
                    "is_done": {
                      "type": "boolean"
                    },
                    "ressource_link": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_generated": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "ai_action_channel": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_action_description": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_action_priority": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_action_reasoning": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_time_precision": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_followup_strategy": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_action_rationale": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_draft_subject": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_draft_message": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_draft_metadata": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_lead": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_space": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "required": [
                    "id",
                    "date",
                    "name",
                    "cron",
                    "cron_id",
                    "created_at",
                    "updated_at",
                    "is_deleted",
                    "is_done",
                    "ressource_link",
                    "ai_generated",
                    "ai_action_channel",
                    "ai_action_description",
                    "ai_action_priority",
                    "ai_action_reasoning",
                    "ai_time_precision",
                    "ai_followup_strategy",
                    "ai_action_rationale",
                    "ai_draft_subject",
                    "ai_draft_message",
                    "ai_draft_metadata",
                    "id_lead",
                    "id_space"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "reminder-delete",
        "summary": "Delete a reminder",
        "tags": [
          "Reminders"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/reminders": {
      "post": {
        "operationId": "reminder-create",
        "summary": "Create a reminder",
        "tags": [
          "Reminders"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id_lead": {
                    "type": "string"
                  },
                  "ressource_link": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "date": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "cron": {
                    "type": "string",
                    "pattern": "^(\\*|([0-5]?[0-9])) (\\*|([01]?[0-9]|2[0-3])) (\\*|([01]?[0-9]|2[0-3]|3[01])) (\\*|([1-9]|1[012])) (\\*|([0-6]))(\\s?(\\*|([0-5]?[0-9]))){0,2}$"
                  },
                  "users": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "date": {
                      "type": "string",
                      "nullable": true
                    },
                    "name": {
                      "type": "string",
                      "nullable": true
                    },
                    "cron": {
                      "type": "string",
                      "nullable": true
                    },
                    "cron_id": {
                      "type": "string",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "is_deleted": {
                      "type": "boolean"
                    },
                    "is_done": {
                      "type": "boolean"
                    },
                    "ressource_link": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_generated": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "ai_action_channel": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_action_description": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_action_priority": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_action_reasoning": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_time_precision": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_followup_strategy": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_action_rationale": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_draft_subject": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_draft_message": {
                      "type": "string",
                      "nullable": true
                    },
                    "ai_draft_metadata": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_lead": {
                      "type": "string",
                      "nullable": true
                    },
                    "id_space": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "required": [
                    "id",
                    "date",
                    "name",
                    "cron",
                    "cron_id",
                    "created_at",
                    "updated_at",
                    "is_deleted",
                    "is_done",
                    "ressource_link",
                    "ai_generated",
                    "ai_action_channel",
                    "ai_action_description",
                    "ai_action_priority",
                    "ai_action_reasoning",
                    "ai_time_precision",
                    "ai_followup_strategy",
                    "ai_action_rationale",
                    "ai_draft_subject",
                    "ai_draft_message",
                    "ai_draft_metadata",
                    "id_lead",
                    "id_space"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/attributes": {
      "get": {
        "operationId": "attribute-list",
        "summary": "List attributes",
        "tags": [
          "Attributes"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "object",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "id_list",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "all",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/attribute": {
      "post": {
        "operationId": "attribute-create",
        "summary": "Create an attributes",
        "tags": [
          "Attributes"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id_object": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "maxLength": 255
                  },
                  "currency": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "TEXT",
                      "TEXTAREA",
                      "NUMBER",
                      "EMAIL",
                      "CHECKBOX",
                      "DATE",
                      "TIMESTAMP",
                      "SELECT",
                      "CURRENCY",
                      "LOCATION",
                      "PHONENUMBER",
                      "RELATION"
                    ]
                  },
                  "isMultiSelect": {
                    "type": "boolean"
                  },
                  "select_options": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "color": {
                          "type": "string",
                          "pattern": "^#([0-9A-F]{3}){1,2}$"
                        }
                      },
                      "required": [
                        "name"
                      ]
                    }
                  }
                },
                "required": [
                  "id_object",
                  "name",
                  "slug",
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "TEXT",
                        "TEXTAREA",
                        "NUMBER",
                        "EMAIL",
                        "CHECKBOX",
                        "DATE",
                        "TIMESTAMP",
                        "SELECT",
                        "CURRENCY",
                        "LOCATION",
                        "PHONENUMBER",
                        "RELATION"
                      ]
                    },
                    "id": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string",
                      "nullable": true
                    },
                    "isMultiSelect": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "isSystem": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    },
                    "id_space": {
                      "type": "string",
                      "nullable": true
                    },
                    "attribute_definitions_select_options_order": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "object_definitionsId": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "required": [
                    "type",
                    "id",
                    "slug",
                    "name",
                    "description",
                    "isMultiSelect",
                    "isSystem",
                    "created_at",
                    "updated_at",
                    "id_space",
                    "attribute_definitions_select_options_order",
                    "object_definitionsId"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/attributes/{id}": {
      "patch": {
        "operationId": "attribute-update",
        "summary": "Update an attribute",
        "tags": [
          "Attributes"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "maxLength": 255
                  },
                  "currency": {
                    "type": "string"
                  },
                  "select_options": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "color": {
                          "type": "string",
                          "pattern": "^#([0-9A-F]{3}){1,2}$"
                        }
                      },
                      "required": [
                        "name"
                      ]
                    }
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "TEXT",
                        "TEXTAREA",
                        "NUMBER",
                        "EMAIL",
                        "CHECKBOX",
                        "DATE",
                        "TIMESTAMP",
                        "SELECT",
                        "CURRENCY",
                        "LOCATION",
                        "PHONENUMBER",
                        "RELATION"
                      ]
                    },
                    "id": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string",
                      "nullable": true
                    },
                    "isMultiSelect": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "isSystem": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    },
                    "id_space": {
                      "type": "string",
                      "nullable": true
                    },
                    "attribute_definitions_select_options_order": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "object_definitionsId": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "required": [
                    "type",
                    "id",
                    "slug",
                    "name",
                    "description",
                    "isMultiSelect",
                    "isSystem",
                    "created_at",
                    "updated_at",
                    "id_space",
                    "attribute_definitions_select_options_order",
                    "object_definitionsId"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "attribute-delete",
        "summary": "Delete an attribute",
        "tags": [
          "Attributes"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "Authorization": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-KEY"
      }
    },
    "schemas": {
      "error.BAD_REQUEST": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The error message",
            "example": "Invalid input data"
          },
          "code": {
            "type": "string",
            "description": "The error code",
            "example": "BAD_REQUEST"
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ]
            },
            "description": "An array of issues that were responsible for the error",
            "example": []
          }
        },
        "required": [
          "message",
          "code"
        ],
        "title": "Invalid input data error (400)",
        "description": "The error information",
        "example": {
          "code": "BAD_REQUEST",
          "message": "Invalid input data",
          "issues": []
        }
      },
      "error.UNAUTHORIZED": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The error message",
            "example": "Authorization not provided"
          },
          "code": {
            "type": "string",
            "description": "The error code",
            "example": "UNAUTHORIZED"
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ]
            },
            "description": "An array of issues that were responsible for the error",
            "example": []
          }
        },
        "required": [
          "message",
          "code"
        ],
        "title": "Authorization not provided error (401)",
        "description": "The error information",
        "example": {
          "code": "UNAUTHORIZED",
          "message": "Authorization not provided",
          "issues": []
        }
      },
      "error.FORBIDDEN": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The error message",
            "example": "Insufficient access"
          },
          "code": {
            "type": "string",
            "description": "The error code",
            "example": "FORBIDDEN"
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ]
            },
            "description": "An array of issues that were responsible for the error",
            "example": []
          }
        },
        "required": [
          "message",
          "code"
        ],
        "title": "Insufficient access error (403)",
        "description": "The error information",
        "example": {
          "code": "FORBIDDEN",
          "message": "Insufficient access",
          "issues": []
        }
      },
      "error.NOT_FOUND": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The error message",
            "example": "Not found"
          },
          "code": {
            "type": "string",
            "description": "The error code",
            "example": "NOT_FOUND"
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ]
            },
            "description": "An array of issues that were responsible for the error",
            "example": []
          }
        },
        "required": [
          "message",
          "code"
        ],
        "title": "Not found error (404)",
        "description": "The error information",
        "example": {
          "code": "NOT_FOUND",
          "message": "Not found",
          "issues": []
        }
      },
      "error.INTERNAL_SERVER_ERROR": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The error message",
            "example": "Internal server error"
          },
          "code": {
            "type": "string",
            "description": "The error code",
            "example": "INTERNAL_SERVER_ERROR"
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ]
            },
            "description": "An array of issues that were responsible for the error",
            "example": []
          }
        },
        "required": [
          "message",
          "code"
        ],
        "title": "Internal server error error (500)",
        "description": "The error information",
        "example": {
          "code": "INTERNAL_SERVER_ERROR",
          "message": "Internal server error",
          "issues": []
        }
      }
    }
  }
}