{
  "openapi": "3.1.0",
  "info": {
    "title": "Whatsaper API",
    "version": "1.0.0",
    "description": "Tenant-facing Whatsaper API. Publishes only endpoints verified as available."
  },
  "servers": [
    {
      "url": "https://api.whatsaper.com"
    }
  ],
  "tags": [
    {
      "name": "Messaging & Conversations",
      "description": "69 verified endpoints."
    },
    {
      "name": "Templates",
      "description": "11 verified endpoints."
    },
    {
      "name": "Contacts & CRM",
      "description": "74 verified endpoints."
    },
    {
      "name": "Campaigns & Automation",
      "description": "50 verified endpoints."
    },
    {
      "name": "Commerce",
      "description": "31 verified endpoints."
    },
    {
      "name": "Channels & Ads",
      "description": "10 verified endpoints."
    },
    {
      "name": "AI",
      "description": "15 verified endpoints."
    },
    {
      "name": "Workspaces & Team",
      "description": "45 verified endpoints."
    }
  ],
  "paths": {
    "/api/chat/add-note": {
      "post": {
        "operationId": "POST_api_chat_add_note",
        "summary": "Add Note · Chat",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contact_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Legacy Contact ID. When this action accepts thread_id, use thread_id for the conversation."
                  },
                  "note": {
                    "type": "string",
                    "minLength": 1
                  },
                  "thread_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Thread ID for the conversation."
                  },
                  "whatsapp_phone_number_id": {
                    "type": "string",
                    "description": "Whatsaper phone number record ID for the sending Line."
                  }
                },
                "required": [
                  "note"
                ],
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "required": [
                          "thread_id"
                        ]
                      },
                      {
                        "required": [
                          "contact_id"
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "contactId": {},
                        "threadId": {},
                        "whatsappPhoneNumberId": {},
                        "note": {},
                        "createdAt": {}
                      },
                      "required": [
                        "id",
                        "contactId",
                        "threadId",
                        "whatsappPhoneNumberId",
                        "note",
                        "createdAt"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/chat/add-tag": {
      "post": {
        "operationId": "POST_api_chat_add_tag",
        "summary": "Add Tag · Chat",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contact_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Legacy Contact ID. When this action accepts thread_id, use thread_id for the conversation."
                  },
                  "tag_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "thread_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Thread ID for the conversation."
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "required": [
                  "tag_id"
                ],
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "required": [
                          "thread_id"
                        ]
                      },
                      {
                        "required": [
                          "contact_id"
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "threadId": {},
                            "tagId": {}
                          },
                          "required": [
                            "threadId",
                            "tagId"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "contactId": {},
                            "tagId": {},
                            "createdAt": {}
                          },
                          "required": [
                            "id",
                            "contactId",
                            "tagId",
                            "createdAt"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/chat/assign": {
      "post": {
        "operationId": "POST_api_chat_assign",
        "summary": "Assign · Chat",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agent_id": {
                    "type": "string"
                  },
                  "chatbot_duration_hours": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "chatbot_id": {
                    "type": "string"
                  },
                  "contact_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Legacy Contact ID. When this action accepts thread_id, use thread_id for the conversation."
                  },
                  "thread_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Thread ID for the conversation."
                  },
                  "whatsapp_phone_number_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Whatsaper phone number record ID for the sending Line."
                  }
                },
                "required": [
                  "whatsapp_phone_number_id"
                ],
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "required": [
                          "thread_id"
                        ]
                      },
                      {
                        "required": [
                          "contact_id"
                        ]
                      }
                    ]
                  },
                  {
                    "anyOf": [
                      {
                        "required": [
                          "agent_id"
                        ]
                      },
                      {
                        "required": [
                          "chatbot_id"
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "thread": {
                          "anyOf": [
                            {
                              "type": "object"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "assignment": {
                          "type": "null"
                        }
                      },
                      "required": [
                        "thread",
                        "assignment"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "thread": {
                          "anyOf": [
                            {
                              "type": "object"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "assignment": {
                          "type": "null"
                        }
                      },
                      "required": [
                        "thread",
                        "assignment"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/chat/delete-note": {
      "delete": {
        "operationId": "DELETE_api_chat_delete_note",
        "summary": "Delete Note · Chat",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedCount": {},
                        "deletedIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "deletedCount",
                        "deletedIds"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/chat/delete-tag": {
      "delete": {
        "operationId": "DELETE_api_chat_delete_tag",
        "summary": "Delete Tag · Chat",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contactId": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  },
                  "tagId": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  },
                  "thread_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Thread ID for the conversation."
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "required": [
                  "tagId"
                ],
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "required": [
                          "thread_id"
                        ]
                      },
                      {
                        "required": [
                          "contactId"
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "threadId": {},
                            "tagId": {}
                          },
                          "required": [
                            "threadId",
                            "tagId"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "contactId": {},
                            "tagId": {}
                          },
                          "required": [
                            "contactId",
                            "tagId"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/chat/status": {
      "post": {
        "operationId": "POST_api_chat_status",
        "summary": "Status · Chat",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contact_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Legacy Contact ID. When this action accepts thread_id, use thread_id for the conversation."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "open",
                      "resolved"
                    ]
                  },
                  "thread_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Thread ID for the conversation."
                  },
                  "whatsapp_phone_number_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Whatsaper phone number record ID for the sending Line."
                  }
                },
                "required": [
                  "status",
                  "whatsapp_phone_number_id"
                ],
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "required": [
                          "thread_id"
                        ]
                      },
                      {
                        "required": [
                          "contact_id"
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "thread": {
                          "type": "object"
                        }
                      },
                      "required": [
                        "thread"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/chat/unassign": {
      "post": {
        "operationId": "POST_api_chat_unassign",
        "summary": "Unassign · Chat",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "chatbot_only": {
                    "type": "boolean",
                    "default": false
                  },
                  "contact_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Legacy Contact ID. When this action accepts thread_id, use thread_id for the conversation."
                  },
                  "thread_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Thread ID for the conversation."
                  },
                  "whatsapp_phone_number_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Whatsaper phone number record ID for the sending Line."
                  }
                },
                "required": [
                  "whatsapp_phone_number_id"
                ],
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "required": [
                          "thread_id"
                        ]
                      },
                      {
                        "required": [
                          "contact_id"
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "thread": {
                              "type": "object"
                            },
                            "assignment": {
                              "type": "object"
                            }
                          },
                          "required": [
                            "thread",
                            "assignment"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "thread": {
                              "type": "object"
                            }
                          },
                          "required": [
                            "thread"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/conversations": {
      "get": {
        "operationId": "GET_api_conversations",
        "summary": "List Conversations",
        "description": "Pass workspace_id or X-Workspace-ID. This operation requires a Workspace.",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "description": "Start date for the result range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "description": "End date for the result range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 20,
              "maximum": 100
            }
          },
          {
            "name": "line_id",
            "in": "query",
            "required": false,
            "description": "Line ID used to filter results.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "phone_number",
            "in": "query",
            "required": false,
            "description": "Filter results by phone number.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "session_status",
            "in": "query",
            "required": false,
            "description": "Filter by conversation session status.",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "expired"
              ]
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "Filter by acquisition or channel source.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "conversations": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "_id": {
                                "type": "string",
                                "pattern": "^[0-9a-fA-F]{24}$"
                              },
                              "phone_number": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "wa_profile_name": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "source": {
                                "type": "string"
                              },
                              "contact_name": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "channel_name": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "channel_display_number": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "last_message": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "last_message_at": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "session_active": {
                                "type": "boolean"
                              },
                              "chat_status": {
                                "type": "string",
                                "enum": [
                                  "open",
                                  "resolved"
                                ]
                              },
                              "updated_at": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "created_at": {
                                "type": "string",
                                "format": "date-time"
                              }
                            }
                          }
                        },
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "currentPage": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            },
                            "totalItems": {
                              "type": "integer"
                            },
                            "itemsPerPage": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "currentPage",
                            "totalPages",
                            "totalItems",
                            "itemsPerPage"
                          ]
                        }
                      },
                      "required": [
                        "conversations",
                        "pagination"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                },
                "example": {
                  "success": false,
                  "message": "workspace_id is required"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/conversations/channels": {
      "get": {
        "operationId": "GET_api_conversations_channels",
        "summary": "Channels · Conversations",
        "description": "Pass workspace_id or X-Workspace-ID. This operation requires a Workspace.",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "line_id": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{24}$"
                          },
                          "source": {
                            "type": "string"
                          },
                          "conversation_count": {
                            "type": "integer"
                          },
                          "channel_name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "channel_display_number": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "line_id",
                          "source",
                          "conversation_count",
                          "channel_name",
                          "channel_display_number"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/message-status/{messageId}/delivery": {
      "patch": {
        "operationId": "PATCH_api_message_status_messageId_delivery",
        "summary": "Delivery · Message Status",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The message id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "sent",
                      "delivered",
                      "failed"
                    ]
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/message-status/{messageId}/read": {
      "patch": {
        "operationId": "PATCH_api_message_status_messageId_read",
        "summary": "Read · Message Status",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The message id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "read",
                      "read_by_multiple"
                    ]
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/message-status/bulk/delivery": {
      "patch": {
        "operationId": "PATCH_api_message_status_bulk_delivery",
        "summary": "Delivery · Message Status",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "messageIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "messageIds"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "matchedCount": {},
                        "modifiedCount": {}
                      },
                      "required": [
                        "matchedCount",
                        "modifiedCount"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/message-status/bulk/read": {
      "patch": {
        "operationId": "PATCH_api_message_status_bulk_read",
        "summary": "Read · Message Status",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "messageIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "messageIds"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "matchedCount": {},
                        "modifiedCount": {}
                      },
                      "required": [
                        "matchedCount",
                        "modifiedCount"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/message-status/conversation/read": {
      "patch": {
        "operationId": "PATCH_api_message_status_conversation_read",
        "summary": "Read · Message Status",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contact_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Legacy Contact ID. When this action accepts thread_id, use thread_id for the conversation."
                  },
                  "thread_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Thread ID for the conversation."
                  },
                  "whatsapp_phone_number_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Whatsaper phone number record ID for the sending Line."
                  }
                },
                "required": [
                  "whatsapp_phone_number_id"
                ],
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "required": [
                          "thread_id"
                        ]
                      },
                      {
                        "required": [
                          "contact_id"
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "modifiedCount": {}
                      },
                      "required": [
                        "modifiedCount"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/message-status/status": {
      "post": {
        "operationId": "POST_api_message_status_status",
        "summary": "Status · Message Status",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "messageIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "messageIds"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/message-status/user/{userId}/status": {
      "get": {
        "operationId": "GET_api_message_status_user_userId_status",
        "summary": "Status · Message Status",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the authenticated tenant owner."
          },
          {
            "name": "contactId",
            "in": "query",
            "required": false,
            "description": "Contact ID used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "description": "End of the result range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "description": "Start of the result range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "delivery": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "integer"
                          }
                        },
                        "read": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "integer"
                          }
                        }
                      },
                      "required": [
                        "total",
                        "delivery",
                        "read"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/message-status/whatsapp/status": {
      "post": {
        "operationId": "POST_api_message_status_whatsapp_status",
        "summary": "Status · Message Status",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "sent",
                      "delivered",
                      "read",
                      "failed"
                    ]
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "waMessageId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "waMessageId",
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/quick-replies": {
      "get": {
        "operationId": "GET_api_quick_replies",
        "summary": "List Quick Replies",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 50
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string",
              "default": "createdAt"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "count": {},
                    "page": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "totalPages": {
                      "type": "integer"
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "count",
                    "page",
                    "limit",
                    "totalPages",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_quick_replies",
        "summary": "Create Quick Replies",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "content": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Reply content."
                  },
                  "is_admin_reply": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "content"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/quick-replies/{id}": {
      "put": {
        "operationId": "PUT_api_quick_replies_id",
        "summary": "Update Quick Replies",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "content": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Reply content."
                  }
                },
                "required": [
                  "content"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/quick-replies/{id}/favorite": {
      "post": {
        "operationId": "POST_api_quick_replies_id_favorite",
        "summary": "Favorite · Quick Replies",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "is_favorite": {
                          "const": false
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "is_favorite"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "is_favorite": {
                          "const": true
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "is_favorite"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/quick-replies/admin": {
      "get": {
        "operationId": "GET_api_quick_replies_admin",
        "summary": "Admin · Quick Replies",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 50
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string",
              "default": "createdAt"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "count": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "totalPages": {
                      "type": "integer"
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "count",
                    "page",
                    "limit",
                    "totalPages",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/quick-replies/delete": {
      "delete": {
        "operationId": "DELETE_api_quick_replies_delete",
        "summary": "Delete · Quick Replies",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/reply-materials": {
      "get": {
        "operationId": "GET_api_reply_materials",
        "summary": "List Reply Materials",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 10
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "waba_id",
            "in": "query",
            "required": true,
            "description": "Whatsaper WhatsApp account ID. Use the _id from GET /api/whatsapp/waba-list.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$",
              "examples": [
                "507f1f77bcf86cd799439011"
              ]
            },
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_reply_materials",
        "summary": "Create Reply Materials",
        "description": "Create reply material. Text and flow materials accept JSON. Upload a file as multipart/form-data for other material types.",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "button_text": {
                    "type": "string"
                  },
                  "content": {
                    "type": "string",
                    "description": "Reply content."
                  },
                  "flow_id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "text",
                      "flow"
                    ]
                  },
                  "waba_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Whatsaper WhatsApp account ID. Use the _id from GET /api/whatsapp/waba-list."
                  }
                },
                "required": [
                  "waba_id",
                  "name",
                  "type"
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "button_text": {
                    "type": "string"
                  },
                  "content": {
                    "type": "string",
                    "description": "Reply content."
                  },
                  "flow_id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "text",
                      "flow",
                      "image",
                      "video",
                      "audio",
                      "document",
                      "sticker",
                      "appointment_flow"
                    ]
                  },
                  "waba_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Whatsaper WhatsApp account ID. Use the _id from GET /api/whatsapp/waba-list."
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "File to upload."
                  }
                },
                "required": [
                  "waba_id",
                  "name",
                  "type"
                ],
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "type": {
                          "not": {
                            "enum": [
                              "text",
                              "flow"
                            ]
                          }
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "file"
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "file_url": {}
                      },
                      "required": [
                        "file_url"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/reply-materials/{id}": {
      "delete": {
        "operationId": "DELETE_api_reply_materials_id",
        "summary": "Delete Reply Materials",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "GET_api_reply_materials_id",
        "summary": "Get Reply Materials",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "file_url": {}
                      },
                      "required": [
                        "file_url"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "PUT_api_reply_materials_id",
        "summary": "Update Reply Materials",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "button_text": {
                    "type": "string"
                  },
                  "content": {
                    "type": "string",
                    "description": "Reply content."
                  },
                  "flow_id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "button_text": {
                    "type": "string"
                  },
                  "content": {
                    "type": "string",
                    "description": "Reply content."
                  },
                  "flow_id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "File to upload."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "file_url": {}
                      },
                      "required": [
                        "file_url"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/reply-materials/bulk-delete": {
      "post": {
        "operationId": "POST_api_reply_materials_bulk_delete",
        "summary": "Bulk Delete · Reply Materials",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedCount": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "deletedIds": {
                          "type": "array",
                          "items": {}
                        }
                      },
                      "required": [
                        "deletedCount",
                        "deletedIds"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/{wabaId}/phone-numbers": {
      "post": {
        "operationId": "POST_api_whatsapp_wabaId_phone_numbers",
        "summary": "Phone Numbers · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "wabaId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The waba id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "phone_number_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "registred_phone_number": {
                    "type": "string",
                    "minLength": 1
                  },
                  "verified_name": {
                    "type": "string"
                  }
                },
                "required": [
                  "phone_number_id",
                  "registred_phone_number"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {},
                        "phone_number_id": {},
                        "display_phone_number": {},
                        "is_primary": {}
                      },
                      "required": [
                        "id",
                        "phone_number_id",
                        "display_phone_number",
                        "is_primary"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/{wabaId}/sync-phone-numbers": {
      "post": {
        "operationId": "POST_api_whatsapp_wabaId_sync_phone_numbers",
        "summary": "Sync Phone Numbers · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "wabaId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The waba id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "added": {
                          "type": "integer"
                        },
                        "updated": {
                          "type": "integer"
                        },
                        "total_from_meta": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "added",
                        "updated",
                        "total_from_meta"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/assign-chat": {
      "post": {
        "operationId": "POST_api_whatsapp_assign_chat",
        "summary": "Assign Chat · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agent_id": {
                    "type": "string"
                  },
                  "chatbot_duration_hours": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "chatbot_id": {
                    "type": "string"
                  },
                  "contact_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Legacy Contact ID. When this action accepts thread_id, use thread_id for the conversation."
                  },
                  "thread_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Thread ID for the conversation."
                  },
                  "whatsapp_phone_number_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Whatsaper phone number record ID for the sending Line."
                  }
                },
                "required": [
                  "whatsapp_phone_number_id"
                ],
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "required": [
                          "thread_id"
                        ]
                      },
                      {
                        "required": [
                          "contact_id"
                        ]
                      }
                    ]
                  },
                  {
                    "anyOf": [
                      {
                        "required": [
                          "agent_id"
                        ]
                      },
                      {
                        "required": [
                          "chatbot_id"
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "thread": {
                          "anyOf": [
                            {
                              "type": "object"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "assignment": {
                          "type": "null"
                        }
                      },
                      "required": [
                        "thread",
                        "assignment"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "thread": {
                          "anyOf": [
                            {
                              "type": "object"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "assignment": {
                          "type": "null"
                        }
                      },
                      "required": [
                        "thread",
                        "assignment"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/baileys/qrcode/{wabaId}": {
      "get": {
        "operationId": "GET_api_whatsapp_baileys_qrcode_wabaId",
        "summary": "Qrcode · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "wabaId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The waba id in the resource URL."
          },
          {
            "name": "sync_chat",
            "in": "query",
            "required": false,
            "description": "Request chat synchronization when creating the Baileys QR code.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "success": {
                              "const": true
                            },
                            "qr_code": {
                              "type": "null"
                            },
                            "status": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "success",
                            "qr_code",
                            "status"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "data": {}
                      },
                      "required": [
                        "success",
                        "data"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/calling/agents": {
      "delete": {
        "operationId": "DELETE_api_whatsapp_calling_agents",
        "summary": "Agents · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "deleted_ids": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "deleted_ids"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "GET_api_whatsapp_calling_agents",
        "summary": "Agents · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 10
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string",
              "default": "created_at"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {},
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "totalItems": {
                          "type": "integer"
                        },
                        "page": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "totalPages": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "totalItems",
                        "page",
                        "limit",
                        "totalPages"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_whatsapp_calling_agents",
        "summary": "Agents · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "nodes": {
                    "type": "array",
                    "items": {}
                  },
                  "is_active": {
                    "type": "boolean"
                  },
                  "welcome_message": {
                    "type": "string"
                  },
                  "ai_config": {
                    "type": "object",
                    "properties": {
                      "prompt": {
                        "type": "string"
                      },
                      "api_key": {
                        "type": "string"
                      },
                      "model_id": {
                        "type": "string"
                      },
                      "training_url": {
                        "type": "string"
                      },
                      "include_concise_instruction": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "model_id",
                      "api_key"
                    ]
                  },
                  "available_functions": {
                    "type": "array",
                    "items": {}
                  },
                  "voice_config": {
                    "type": "object",
                    "properties": {
                      "api_key": {
                        "type": "string"
                      },
                      "voice_id": {
                        "type": "string"
                      },
                      "stt_provider": {
                        "enum": [
                          "openai",
                          "google",
                          "elevenlabs"
                        ],
                        "type": "string"
                      },
                      "tts_provider": {
                        "enum": [
                          "openai",
                          "google",
                          "elevenlabs"
                        ],
                        "type": "string"
                      }
                    }
                  },
                  "hangup_config": {
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "type": "boolean"
                      },
                      "trigger_keywords": {
                        "type": "array",
                        "items": {}
                      },
                      "farewell_message": {
                        "type": "string"
                      }
                    }
                  },
                  "recording_config": {
                    "type": "object",
                    "properties": {
                      "enable_transcription": {
                        "type": "boolean"
                      },
                      "enable_user_recording": {
                        "type": "boolean"
                      },
                      "enable_agent_recording": {
                        "type": "boolean"
                      }
                    }
                  }
                },
                "required": [
                  "name",
                  "ai_config"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "welcome_message": {
                      "type": "string"
                    },
                    "ai_config": {
                      "type": "object",
                      "properties": {
                        "model_id": {
                          "type": "string"
                        },
                        "prompt": {
                          "type": "string"
                        }
                      }
                    },
                    "voice_config": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/calling/agents/{id}": {
      "get": {
        "operationId": "GET_api_whatsapp_calling_agents_id",
        "summary": "Agents · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "welcome_message": {
                      "type": "string"
                    },
                    "ai_config": {
                      "type": "object",
                      "properties": {
                        "model_id": {
                          "type": "string"
                        },
                        "prompt": {
                          "type": "string"
                        }
                      }
                    },
                    "voice_config": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "PUT_api_whatsapp_calling_agents_id",
        "summary": "Agents · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "nodes": {
                    "type": "array",
                    "items": {}
                  },
                  "is_active": {
                    "type": "boolean"
                  },
                  "welcome_message": {
                    "type": "string"
                  },
                  "ai_config": {
                    "type": "object",
                    "properties": {
                      "prompt": {
                        "type": "string"
                      },
                      "api_key": {
                        "type": "string"
                      },
                      "model_id": {
                        "type": "string"
                      },
                      "training_url": {
                        "type": "string"
                      },
                      "include_concise_instruction": {
                        "type": "boolean"
                      }
                    }
                  },
                  "available_functions": {
                    "type": "array",
                    "items": {}
                  },
                  "voice_config": {
                    "type": "object",
                    "properties": {
                      "api_key": {
                        "type": "string"
                      },
                      "voice_id": {
                        "type": "string"
                      },
                      "stt_provider": {
                        "enum": [
                          "openai",
                          "google",
                          "elevenlabs"
                        ],
                        "type": "string"
                      },
                      "tts_provider": {
                        "enum": [
                          "openai",
                          "google",
                          "elevenlabs"
                        ],
                        "type": "string"
                      }
                    }
                  },
                  "hangup_config": {
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "type": "boolean"
                      },
                      "trigger_keywords": {
                        "type": "array",
                        "items": {}
                      },
                      "farewell_message": {
                        "type": "string"
                      }
                    }
                  },
                  "recording_config": {
                    "type": "object",
                    "properties": {
                      "enable_transcription": {
                        "type": "boolean"
                      },
                      "enable_user_recording": {
                        "type": "boolean"
                      },
                      "enable_agent_recording": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "welcome_message": {
                      "type": "string"
                    },
                    "ai_config": {
                      "type": "object",
                      "properties": {
                        "model_id": {
                          "type": "string"
                        },
                        "prompt": {
                          "type": "string"
                        }
                      }
                    },
                    "voice_config": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/calling/assign-agent": {
      "post": {
        "operationId": "POST_api_whatsapp_calling_assign_agent",
        "summary": "Assign Agent · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agent_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "contact_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Legacy Contact ID. When this action accepts thread_id, use thread_id for the conversation."
                  }
                },
                "required": [
                  "agent_id",
                  "contact_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/calling/assign-agent-bulk": {
      "post": {
        "operationId": "POST_api_whatsapp_calling_assign_agent_bulk",
        "summary": "Assign Agent Bulk · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agent_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "contact_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "tag_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  }
                },
                "required": [
                  "agent_id"
                ],
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "required": [
                          "contact_ids"
                        ]
                      },
                      {
                        "required": [
                          "tag_ids"
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "updated_count": {
                          "type": "integer"
                        },
                        "agent_id": {},
                        "agent_name": {}
                      },
                      "required": [
                        "updated_count",
                        "agent_id",
                        "agent_name"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/calling/logs": {
      "get": {
        "operationId": "GET_api_whatsapp_calling_logs",
        "summary": "Logs · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "required": false,
            "description": "Filter results by agent ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contact_id",
            "in": "query",
            "required": false,
            "description": "Contact ID used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 10
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "phone_number_id",
            "in": "query",
            "required": false,
            "description": "Phone number record ID used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {},
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "totalItems": {
                          "type": "integer"
                        },
                        "page": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "totalPages": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "totalItems",
                        "page",
                        "limit",
                        "totalPages"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/calling/logs/{id}": {
      "get": {
        "operationId": "GET_api_whatsapp_calling_logs_id",
        "summary": "Logs · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/calling/logs/{id}/transcription": {
      "get": {
        "operationId": "GET_api_whatsapp_calling_logs_id_transcription",
        "summary": "Transcription · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transcription": {},
                    "recording_url": {}
                  },
                  "required": [
                    "transcription",
                    "recording_url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/calling/logs/bulk-delete": {
      "delete": {
        "operationId": "DELETE_api_whatsapp_calling_logs_bulk_delete",
        "summary": "Bulk Delete · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deleted_count": {},
                        "deleted_ids": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "deleted_count",
                        "deleted_ids"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/calling/remove-agent-bulk": {
      "post": {
        "operationId": "POST_api_whatsapp_calling_remove_agent_bulk",
        "summary": "Remove Agent Bulk · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contact_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "tag_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  }
                },
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "required": [
                          "contact_ids"
                        ]
                      },
                      {
                        "required": [
                          "tag_ids"
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "removed_count": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "removed_count"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/calling/remove-agent/{contact_id}": {
      "delete": {
        "operationId": "DELETE_api_whatsapp_calling_remove_agent_contact_id",
        "summary": "Remove Agent · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The contact id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "contact": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "contact"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/calling/settings": {
      "get": {
        "operationId": "GET_api_whatsapp_calling_settings",
        "summary": "Settings · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "phone_number_id",
            "in": "query",
            "required": true,
            "description": "Phone number record ID used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_whatsapp_calling_settings",
        "summary": "Settings · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "calling_status": {
                    "enum": [
                      "ENABLED",
                      "DISABLED"
                    ],
                    "type": "string"
                  },
                  "phone_number_id": {
                    "type": "string"
                  },
                  "call_hours": {
                    "type": "object",
                    "properties": {
                      "status": {
                        "enum": [
                          "ENABLED",
                          "DISABLED"
                        ],
                        "type": "string"
                      },
                      "timezone_id": {
                        "type": "string"
                      },
                      "holiday_schedule": {
                        "type": "array",
                        "items": {}
                      },
                      "weekly_operating_hours": {
                        "type": "array",
                        "items": {}
                      }
                    }
                  },
                  "sip_config": {
                    "type": "object",
                    "properties": {
                      "status": {
                        "enum": [
                          "ENABLED",
                          "DISABLED"
                        ],
                        "type": "string"
                      },
                      "servers": {
                        "type": "array",
                        "items": {}
                      }
                    }
                  },
                  "fallback_agent_id": {
                    "type": "string",
                    "description": "ObjectId (ref: WhatsappCallAgent)"
                  },
                  "call_icon_visibility": {
                    "enum": [
                      "DEFAULT",
                      "DISABLE_ALL"
                    ],
                    "type": "string"
                  },
                  "call_icons": {
                    "type": "object",
                    "properties": {
                      "restrict_to_user_countries": {
                        "type": "array",
                        "items": {}
                      }
                    }
                  }
                },
                "required": [
                  "phone_number_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/chats": {
      "get": {
        "operationId": "GET_api_whatsapp_chats",
        "summary": "Chats · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "query",
            "required": false,
            "description": "Filter results by agent ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "chat_status",
            "in": "query",
            "required": false,
            "description": "Filter results by chat status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "description": "End date for the result range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "has_notes",
            "in": "query",
            "required": false,
            "description": "Filter results by has notes.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "has_unread",
            "in": "query",
            "required": false,
            "description": "Filter results by has unread.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "is_assigned",
            "in": "query",
            "required": false,
            "description": "Filter results by is assigned.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "last_message_read",
            "in": "query",
            "required": false,
            "description": "Filter results by last message read.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "description": "Filter by channel platform.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "description": "Filter by connection provider.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "description": "Start date for the result range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tags",
            "in": "query",
            "required": false,
            "description": "Filter by tag IDs.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "whatsapp_phone_number_id",
            "in": "query",
            "required": false,
            "description": "WhatsApp phone number record ID used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "data": {},
                        "pagination": {}
                      },
                      "required": [
                        "success",
                        "data",
                        "pagination"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "data": {
                          "type": "array",
                          "items": {}
                        }
                      },
                      "required": [
                        "success",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "data": {
                          "type": "array",
                          "items": {}
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "data",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/check-number": {
      "post": {
        "operationId": "POST_api_whatsapp_check_number",
        "summary": "Check Number · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connectionId": {
                    "type": "string"
                  },
                  "numbers": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1
                        },
                        "minItems": 1
                      }
                    ]
                  },
                  "providerType": {
                    "type": "string"
                  },
                  "whatsapp_phone_number_id": {
                    "type": "string",
                    "description": "Whatsaper phone number record ID for the sending Line."
                  }
                },
                "required": [
                  "numbers"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/clear-chat": {
      "post": {
        "operationId": "POST_api_whatsapp_clear_chat",
        "summary": "Clear Chat · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connection_id": {
                    "type": "string"
                  },
                  "contact_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Legacy Contact ID. When this action accepts thread_id, use thread_id for the conversation."
                  },
                  "thread_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Thread ID for the conversation."
                  }
                },
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "required": [
                          "thread_id"
                        ]
                      },
                      {
                        "required": [
                          "contact_id"
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/connect": {
      "post": {
        "operationId": "POST_api_whatsapp_connect",
        "summary": "Connect · Whatsapp",
        "description": "Connect a WhatsApp account. The required fields depend on the provider.",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "access_token": {
                    "type": "string",
                    "format": "password",
                    "writeOnly": true
                  },
                  "app_id": {
                    "type": "string"
                  },
                  "business_id": {
                    "type": "string"
                  },
                  "instance_name": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "phone_number_id": {
                    "type": "string"
                  },
                  "provider": {
                    "type": "string",
                    "enum": [
                      "business_api",
                      "baileys"
                    ],
                    "default": "business_api"
                  },
                  "registred_phone_number": {
                    "type": "string"
                  },
                  "whatsapp_business_account_id": {
                    "type": "string"
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "provider": {
                          "const": "business_api"
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "workspace_id",
                        "phone_number_id",
                        "access_token",
                        "whatsapp_business_account_id",
                        "app_id"
                      ]
                    },
                    "else": {
                      "anyOf": [
                        {
                          "required": [
                            "name"
                          ]
                        },
                        {
                          "required": [
                            "instance_name"
                          ]
                        }
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "waba_id": {},
                            "waba_name": {},
                            "whatsapp_business_account_id": {},
                            "phone_id": {},
                            "phone_number_id": {},
                            "display_phone_number": {},
                            "verified_name": {},
                            "warnings": {},
                            "is_new_waba": {},
                            "is_new_phone": {}
                          },
                          "required": [
                            "waba_id",
                            "waba_name",
                            "whatsapp_business_account_id",
                            "phone_id",
                            "phone_number_id",
                            "display_phone_number",
                            "verified_name",
                            "warnings",
                            "is_new_waba",
                            "is_new_phone"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "waba_id": {},
                            "instance_name": {},
                            "status": {},
                            "provider": {}
                          },
                          "required": [
                            "waba_id",
                            "instance_name",
                            "status",
                            "provider"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/connect/{id}": {
      "put": {
        "operationId": "PUT_api_whatsapp_connect_id",
        "summary": "Connect · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "is_active": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {},
                            "whatsapp_business_account_id": {},
                            "is_active": {}
                          },
                          "required": [
                            "id",
                            "name",
                            "whatsapp_business_account_id",
                            "is_active"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "phone_number_id": {},
                            "display_phone_number": {},
                            "verified_name": {},
                            "is_active": {}
                          },
                          "required": [
                            "id",
                            "phone_number_id",
                            "display_phone_number",
                            "verified_name",
                            "is_active"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/delete": {
      "post": {
        "operationId": "POST_api_whatsapp_delete",
        "summary": "Delete · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedCount": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "deletedIds": {
                          "type": "array",
                          "items": {}
                        },
                        "notFoundIds": {
                          "type": "array",
                          "items": {}
                        }
                      },
                      "required": [
                        "deletedCount",
                        "deletedIds",
                        "notFoundIds"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/delete-thread": {
      "post": {
        "operationId": "POST_api_whatsapp_delete_thread",
        "summary": "Delete Thread · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "thread_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Thread ID for the conversation."
                  }
                },
                "required": [
                  "thread_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "thread_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "thread_id"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/disconnect": {
      "post": {
        "operationId": "POST_api_whatsapp_disconnect",
        "summary": "Disconnect · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string"
                  },
                  "waba_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Whatsaper WhatsApp account ID. Use the _id from GET /api/whatsapp/waba-list."
                  }
                },
                "required": [
                  "waba_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/embedded-signup/connection": {
      "post": {
        "operationId": "POST_api_whatsapp_embedded_signup_connection",
        "summary": "Connection · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "minLength": 1
                  },
                  "signupData": {
                    "type": "object",
                    "properties": {
                      "waba_id": {
                        "type": "string"
                      },
                      "phone_number_id": {
                        "type": "string"
                      },
                      "business_id": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "waba_id",
                      "phone_number_id",
                      "business_id"
                    ]
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "required": [
                  "code",
                  "signupData"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "waba_id": {},
                        "waba_name": {},
                        "whatsapp_business_account_id": {},
                        "phone_id": {},
                        "phone_number_id": {},
                        "display_phone_number": {},
                        "verified_name": {},
                        "quality_rating": {},
                        "is_on_biz_app": {},
                        "platform_type": {},
                        "is_coexistence": {},
                        "webhook_subscribed": {
                          "const": true
                        },
                        "warnings": {},
                        "is_new_waba": {},
                        "is_new_phone": {}
                      },
                      "required": [
                        "waba_id",
                        "waba_name",
                        "whatsapp_business_account_id",
                        "phone_id",
                        "phone_number_id",
                        "display_phone_number",
                        "verified_name",
                        "quality_rating",
                        "is_on_biz_app",
                        "platform_type",
                        "is_coexistence",
                        "webhook_subscribed",
                        "warnings",
                        "is_new_waba",
                        "is_new_phone"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Other error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "subcode": {}
                  },
                  "required": [
                    "success",
                    "error",
                    "subcode"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/logs": {
      "get": {
        "operationId": "GET_api_whatsapp_logs",
        "summary": "Logs · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "description": "Filter by channel platform.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "timeFilter",
            "in": "query",
            "required": false,
            "description": "Time range filter for message logs.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "logs": {
                          "type": "array",
                          "items": {}
                        },
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "currentPage": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            },
                            "totalItems": {
                              "type": "integer"
                            },
                            "itemsPerPage": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "currentPage",
                            "totalPages",
                            "totalItems",
                            "itemsPerPage"
                          ]
                        }
                      },
                      "required": [
                        "logs",
                        "pagination"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/messages": {
      "get": {
        "operationId": "GET_api_whatsapp_messages",
        "summary": "Messages · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "connection_id",
            "in": "query",
            "required": false,
            "description": "Filter results by connection ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contact_id",
            "in": "query",
            "required": false,
            "description": "Contact ID used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "description": "End date for the result range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "description": "Filter by connection provider.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "description": "Start date for the result range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "thread_id",
            "in": "query",
            "required": false,
            "description": "Filter results by thread ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "whatsapp_phone_number_id",
            "in": "query",
            "required": false,
            "description": "WhatsApp phone number record ID used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "messages": {},
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "total": {
                              "type": "integer"
                            },
                            "page": {
                              "type": "integer"
                            },
                            "limit": {
                              "type": "integer"
                            },
                            "hasMore": {}
                          },
                          "required": [
                            "total",
                            "page",
                            "limit",
                            "hasMore"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "messages",
                        "pagination"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "messages": {},
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "total": {
                              "type": "integer"
                            },
                            "page": {},
                            "limit": {},
                            "hasMore": {}
                          },
                          "required": [
                            "total",
                            "page",
                            "limit",
                            "hasMore"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "messages",
                        "pagination"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/phone-numbers/{phoneNumberId}/set-primary": {
      "put": {
        "operationId": "PUT_api_whatsapp_phone_numbers_phoneNumberId_set_primary",
        "summary": "Set Primary · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "phoneNumberId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The phone number id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "display_phone_number": {},
                        "is_primary": {}
                      },
                      "required": [
                        "display_phone_number",
                        "is_primary"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/pin-chat": {
      "post": {
        "operationId": "POST_api_whatsapp_pin_chat",
        "summary": "Pin Chat · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contact_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Legacy Contact ID. When this action accepts thread_id, use thread_id for the conversation."
                  },
                  "phone_number": {
                    "type": "string"
                  },
                  "thread_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Thread ID for the conversation."
                  }
                },
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "required": [
                          "thread_id"
                        ]
                      },
                      {
                        "required": [
                          "contact_id"
                        ]
                      },
                      {
                        "required": [
                          "phone_number"
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "thread_id": {
                          "type": "string"
                        },
                        "is_pinned": {}
                      },
                      "required": [
                        "id",
                        "thread_id",
                        "is_pinned"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/send": {
      "post": {
        "operationId": "POST_api_whatsapp_send",
        "summary": "Send · Whatsapp",
        "description": "Send a message or broadcast to a segment. Required recipient, sender and content inputs depend on the platform and message type.",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number"
                  },
                  "buttonParams": {
                    "type": "object"
                  },
                  "buttons": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "carouselCardsData": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "carouselProducts": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "connection_id": {
                    "type": "string"
                  },
                  "contact_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Legacy Contact ID. When this action accepts thread_id, use thread_id for the conversation."
                  },
                  "contact_no": {
                    "type": "string"
                  },
                  "coupon_code": {
                    "type": "string"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "flow_cta": {
                    "type": "string"
                  },
                  "form_id": {
                    "type": "string"
                  },
                  "gateway_id": {
                    "type": "string"
                  },
                  "interactiveType": {
                    "type": "string"
                  },
                  "languageCode": {
                    "type": "string"
                  },
                  "listParams": {
                    "type": "object"
                  },
                  "location": {
                    "type": "object"
                  },
                  "mediaUrl": {
                    "type": "string"
                  },
                  "mediaUrls": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "message": {
                    "type": "string"
                  },
                  "messageText": {
                    "type": "string"
                  },
                  "messageType": {
                    "type": "string"
                  },
                  "message_type": {
                    "type": "string"
                  },
                  "platform": {
                    "type": "string"
                  },
                  "provider": {
                    "type": "string"
                  },
                  "reactionEmoji": {
                    "type": "string"
                  },
                  "reactionMessageId": {
                    "type": "string"
                  },
                  "recipient_id": {
                    "type": "string"
                  },
                  "replyMessageId": {
                    "type": "string"
                  },
                  "segment_id": {
                    "type": "string"
                  },
                  "templateComponents": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "templateName": {
                    "type": "string"
                  },
                  "templateVariables": {
                    "anyOf": [
                      {
                        "type": "object"
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  },
                  "template_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  },
                  "text": {
                    "type": "string"
                  },
                  "thread_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Thread ID for the conversation."
                  },
                  "type": {
                    "type": "string"
                  },
                  "whatsapp_phone_number": {
                    "type": "string"
                  },
                  "whatsapp_phone_number_id": {
                    "type": "string",
                    "description": "Whatsaper phone number record ID for the sending Line."
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number"
                  },
                  "buttonParams": {
                    "type": "string",
                    "description": "JSON-encoded button params."
                  },
                  "buttons": {
                    "type": "string",
                    "description": "JSON-encoded buttons."
                  },
                  "carouselCardsData": {
                    "type": "string",
                    "description": "JSON-encoded carousel cards data."
                  },
                  "carouselProducts": {
                    "type": "string",
                    "description": "JSON-encoded carousel products."
                  },
                  "connection_id": {
                    "type": "string"
                  },
                  "contact_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Legacy Contact ID. When this action accepts thread_id, use thread_id for the conversation."
                  },
                  "contact_no": {
                    "type": "string"
                  },
                  "coupon_code": {
                    "type": "string"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "flow_cta": {
                    "type": "string"
                  },
                  "form_id": {
                    "type": "string"
                  },
                  "gateway_id": {
                    "type": "string"
                  },
                  "interactiveType": {
                    "type": "string"
                  },
                  "languageCode": {
                    "type": "string"
                  },
                  "listParams": {
                    "type": "string",
                    "description": "JSON-encoded list params."
                  },
                  "location": {
                    "type": "string",
                    "description": "JSON-encoded location."
                  },
                  "mediaUrl": {
                    "type": "string"
                  },
                  "mediaUrls": {
                    "type": "string",
                    "description": "JSON-encoded media urls."
                  },
                  "message": {
                    "type": "string"
                  },
                  "messageText": {
                    "type": "string"
                  },
                  "messageType": {
                    "type": "string"
                  },
                  "message_type": {
                    "type": "string"
                  },
                  "platform": {
                    "type": "string"
                  },
                  "provider": {
                    "type": "string"
                  },
                  "reactionEmoji": {
                    "type": "string"
                  },
                  "reactionMessageId": {
                    "type": "string"
                  },
                  "recipient_id": {
                    "type": "string"
                  },
                  "replyMessageId": {
                    "type": "string"
                  },
                  "segment_id": {
                    "type": "string"
                  },
                  "templateComponents": {
                    "type": "string",
                    "description": "JSON-encoded template components."
                  },
                  "templateName": {
                    "type": "string"
                  },
                  "templateVariables": {
                    "type": "string",
                    "description": "JSON-encoded template variables."
                  },
                  "template_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  },
                  "text": {
                    "type": "string"
                  },
                  "thread_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Thread ID for the conversation."
                  },
                  "type": {
                    "type": "string"
                  },
                  "whatsapp_phone_number": {
                    "type": "string"
                  },
                  "whatsapp_phone_number_id": {
                    "type": "string",
                    "description": "Whatsaper phone number record ID for the sending Line."
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  },
                  "file_url": {
                    "type": "string",
                    "format": "binary",
                    "description": "File to upload."
                  },
                  "carousel_files": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary",
                      "description": "File to upload."
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "totalEligible": {
                              "type": "integer",
                              "minimum": 0
                            }
                          },
                          "required": [
                            "totalEligible"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "totalUrls": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "sentMessages": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "failedUrls": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "sent": {
                              "type": "array",
                              "items": {}
                            },
                            "failed": {
                              "type": "array",
                              "items": {}
                            }
                          },
                          "required": [
                            "totalUrls",
                            "sentMessages",
                            "failedUrls",
                            "sent",
                            "failed"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "payment_link": {},
                            "transaction_id": {}
                          },
                          "required": [
                            "payment_link",
                            "transaction_id"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {}
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "sender_number": {},
                            "recipient_number": {},
                            "content": {},
                            "message_type": {},
                            "file_url": {},
                            "file_type": {},
                            "wa_jid": {},
                            "from_me": {},
                            "direction": {},
                            "wa_message_id": {},
                            "wa_timestamp": {},
                            "is_delivered": {},
                            "is_seen": {},
                            "provider": {},
                            "reply_message_id": {},
                            "reaction_message_id": {},
                            "reaction_emoji": {},
                            "interactive_data": {},
                            "created_at": {},
                            "updated_at": {}
                          },
                          "required": [
                            "id",
                            "sender_number",
                            "recipient_number",
                            "content",
                            "message_type",
                            "file_url",
                            "file_type",
                            "wa_jid",
                            "from_me",
                            "direction",
                            "wa_message_id",
                            "wa_timestamp",
                            "is_delivered",
                            "is_seen",
                            "provider",
                            "reply_message_id",
                            "reaction_message_id",
                            "reaction_emoji",
                            "interactive_data",
                            "created_at",
                            "updated_at"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "failed": {
                          "type": "array",
                          "items": {}
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "failed"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "code",
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "thread_id": {},
                    "cycle_key": {},
                    "remediation_options": {}
                  },
                  "required": [
                    "success",
                    "code",
                    "message",
                    "thread_id",
                    "cycle_key",
                    "remediation_options"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/send-order": {
      "post": {
        "operationId": "POST_api_whatsapp_send_order",
        "summary": "Send Order · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "checkout_url": {
                    "type": "string"
                  },
                  "order_description": {
                    "type": "string"
                  },
                  "order_title": {
                    "type": "string"
                  },
                  "product_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  },
                  "thread_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Thread ID for the conversation."
                  },
                  "whatsapp_phone_number_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Whatsaper phone number record ID for the sending Line."
                  }
                },
                "required": [
                  "product_id",
                  "thread_id",
                  "whatsapp_phone_number_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "totalEligible": {
                              "type": "integer",
                              "minimum": 0
                            }
                          },
                          "required": [
                            "totalEligible"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "totalUrls": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "sentMessages": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "failedUrls": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "sent": {
                              "type": "array",
                              "items": {}
                            },
                            "failed": {
                              "type": "array",
                              "items": {}
                            }
                          },
                          "required": [
                            "totalUrls",
                            "sentMessages",
                            "failedUrls",
                            "sent",
                            "failed"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "payment_link": {},
                            "transaction_id": {}
                          },
                          "required": [
                            "payment_link",
                            "transaction_id"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {}
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "sender_number": {},
                            "recipient_number": {},
                            "content": {},
                            "message_type": {},
                            "file_url": {},
                            "file_type": {},
                            "wa_jid": {},
                            "from_me": {},
                            "direction": {},
                            "wa_message_id": {},
                            "wa_timestamp": {},
                            "is_delivered": {},
                            "is_seen": {},
                            "provider": {},
                            "reply_message_id": {},
                            "reaction_message_id": {},
                            "reaction_emoji": {},
                            "interactive_data": {},
                            "created_at": {},
                            "updated_at": {}
                          },
                          "required": [
                            "id",
                            "sender_number",
                            "recipient_number",
                            "content",
                            "message_type",
                            "file_url",
                            "file_type",
                            "wa_jid",
                            "from_me",
                            "direction",
                            "wa_message_id",
                            "wa_timestamp",
                            "is_delivered",
                            "is_seen",
                            "provider",
                            "reply_message_id",
                            "reaction_message_id",
                            "reaction_emoji",
                            "interactive_data",
                            "created_at",
                            "updated_at"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/send-product": {
      "post": {
        "operationId": "POST_api_whatsapp_send_product",
        "summary": "Send Product · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "checkout_url": {
                    "type": "string"
                  },
                  "order_description": {
                    "type": "string"
                  },
                  "order_title": {
                    "type": "string"
                  },
                  "product_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  },
                  "thread_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Thread ID for the conversation."
                  },
                  "whatsapp_phone_number_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Whatsaper phone number record ID for the sending Line."
                  }
                },
                "required": [
                  "product_id",
                  "thread_id",
                  "whatsapp_phone_number_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "totalEligible": {
                              "type": "integer",
                              "minimum": 0
                            }
                          },
                          "required": [
                            "totalEligible"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "totalUrls": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "sentMessages": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "failedUrls": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "sent": {
                              "type": "array",
                              "items": {}
                            },
                            "failed": {
                              "type": "array",
                              "items": {}
                            }
                          },
                          "required": [
                            "totalUrls",
                            "sentMessages",
                            "failedUrls",
                            "sent",
                            "failed"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "payment_link": {},
                            "transaction_id": {}
                          },
                          "required": [
                            "payment_link",
                            "transaction_id"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {}
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "sender_number": {},
                            "recipient_number": {},
                            "content": {},
                            "message_type": {},
                            "file_url": {},
                            "file_type": {},
                            "wa_jid": {},
                            "from_me": {},
                            "direction": {},
                            "wa_message_id": {},
                            "wa_timestamp": {},
                            "is_delivered": {},
                            "is_seen": {},
                            "provider": {},
                            "reply_message_id": {},
                            "reaction_message_id": {},
                            "reaction_emoji": {},
                            "interactive_data": {},
                            "created_at": {},
                            "updated_at": {}
                          },
                          "required": [
                            "id",
                            "sender_number",
                            "recipient_number",
                            "content",
                            "message_type",
                            "file_url",
                            "file_type",
                            "wa_jid",
                            "from_me",
                            "direction",
                            "wa_message_id",
                            "wa_timestamp",
                            "is_delivered",
                            "is_seen",
                            "provider",
                            "reply_message_id",
                            "reaction_message_id",
                            "reaction_emoji",
                            "interactive_data",
                            "created_at",
                            "updated_at"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/status": {
      "get": {
        "operationId": "GET_api_whatsapp_status",
        "summary": "Status · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "description": "Filter by connection provider.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "whatsapp_phone_number_id",
            "in": "query",
            "required": false,
            "description": "WhatsApp phone number record ID used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "connected": {
                          "const": false
                        }
                      },
                      "required": [
                        "success",
                        "connected"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "connected": {
                          "const": true
                        }
                      },
                      "required": [
                        "success",
                        "connected"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/threads/{id}/snooze": {
      "patch": {
        "operationId": "PATCH_api_whatsapp_threads_id_snooze",
        "summary": "Snooze · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "snooze_count_limit": {
                    "type": "number"
                  },
                  "snooze_time_minutes": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string"
                      }
                    ]
                  }
                },
                "required": [
                  "enabled"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "thread_id": {
                          "type": "string"
                        },
                        "is_snoozed": {},
                        "snooze_count": {},
                        "snooze_time_minutes": {},
                        "snooze_count_limit": {}
                      },
                      "required": [
                        "thread_id",
                        "is_snoozed",
                        "snooze_count",
                        "snooze_time_minutes",
                        "snooze_count_limit"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/threads/initiate": {
      "post": {
        "operationId": "POST_api_whatsapp_threads_initiate",
        "summary": "Initiate · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "languageCode": {
                    "type": "string"
                  },
                  "messageText": {
                    "type": "string"
                  },
                  "messageType": {
                    "type": "string"
                  },
                  "phone_number": {
                    "type": "string",
                    "minLength": 1
                  },
                  "providerType": {
                    "type": "string"
                  },
                  "templateComponents": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "templateId": {
                    "type": "string",
                    "description": "Approved template ID. Supply this or templateName."
                  },
                  "templateName": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Approved template name. Supply this or templateId."
                  },
                  "templateVariables": {
                    "anyOf": [
                      {
                        "type": "object"
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  },
                  "whatsapp_phone_number_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Whatsaper phone number record ID for the sending Line."
                  }
                },
                "required": [
                  "phone_number",
                  "whatsapp_phone_number_id"
                ],
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "required": [
                          "templateName"
                        ]
                      },
                      {
                        "required": [
                          "templateId"
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "thread_id": {
                          "type": "string"
                        },
                        "contact_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "message_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "recipient_number": {}
                      },
                      "required": [
                        "thread_id",
                        "contact_id",
                        "message_id",
                        "recipient_number"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "code",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "code",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "thread_id": {},
                    "cycle_key": {},
                    "remediation_options": {}
                  },
                  "required": [
                    "success",
                    "code",
                    "message",
                    "thread_id",
                    "cycle_key",
                    "remediation_options"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/unassign-chat": {
      "post": {
        "operationId": "POST_api_whatsapp_unassign_chat",
        "summary": "Unassign Chat · Whatsapp",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "chatbot_only": {
                    "type": "boolean",
                    "default": false
                  },
                  "contact_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Legacy Contact ID. When this action accepts thread_id, use thread_id for the conversation."
                  },
                  "thread_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Thread ID for the conversation."
                  },
                  "whatsapp_phone_number_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Whatsaper phone number record ID for the sending Line."
                  }
                },
                "required": [
                  "whatsapp_phone_number_id"
                ],
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "required": [
                          "thread_id"
                        ]
                      },
                      {
                        "required": [
                          "contact_id"
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "thread": {
                              "type": "object"
                            },
                            "assignment": {
                              "type": "object"
                            }
                          },
                          "required": [
                            "thread",
                            "assignment"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "thread": {
                              "type": "object"
                            }
                          },
                          "required": [
                            "thread"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/whatsapp/waba-list": {
      "get": {
        "operationId": "GET_api_whatsapp_waba_list",
        "summary": "List WhatsApp Business Accounts",
        "description": "List WhatsApp accounts visible to this API credential. Use each record’s _id as waba_id in the template API. whatsapp_business_account_id is the corresponding ID from Meta.",
        "tags": [
          "Messaging & Conversations"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{24}$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "whatsapp_business_account_id": {
                            "type": "string"
                          },
                          "provider": {
                            "type": "string"
                          },
                          "workspace_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "_id"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "_id": "507f1f77bcf86cd799439011",
                      "name": "Order updates",
                      "whatsapp_business_account_id": "123456789012345",
                      "provider": "business_api",
                      "workspace_id": "507f1f77bcf86cd799439013"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/template": {
      "get": {
        "operationId": "GET_api_template",
        "summary": "List Templates",
        "description": "List templates for a WhatsApp account. When platform is omitted or is whatsapp, supply waba_id from List WhatsApp Business Accounts. Use platform=all to list templates across platforms.",
        "tags": [
          "Templates"
        ],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Filter by template category.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "description": "Filter by channel platform.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "whatsapp",
                "telegram",
                "facebook",
                "instagram",
                "twitter"
              ],
              "default": "whatsapp"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "waba_id",
            "in": "query",
            "required": false,
            "description": "Required when platform is whatsapp or omitted. Use the _id from GET /api/whatsapp/waba-list.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$",
              "examples": [
                "507f1f77bcf86cd799439011"
              ]
            },
            "example": "507f1f77bcf86cd799439011",
            "x-required-when": {
              "platform": [
                "whatsapp",
                "omitted"
              ]
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "count": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{24}$"
                          },
                          "template_name": {
                            "type": "string"
                          },
                          "waba_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "language": {
                            "type": "string"
                          },
                          "category": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "platform": {
                            "type": "string"
                          },
                          "message_body": {
                            "type": "string"
                          },
                          "template_type": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "_id",
                          "template_name"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "count",
                    "data"
                  ]
                },
                "example": {
                  "success": true,
                  "count": 1,
                  "data": [
                    {
                      "_id": "507f1f77bcf86cd799439012",
                      "waba_id": "507f1f77bcf86cd799439011",
                      "template_name": "order_update",
                      "language": "en_US",
                      "category": "UTILITY",
                      "platform": "whatsapp",
                      "status": "approved"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                },
                "example": {
                  "error": "WABA ID is required"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/template/{id}": {
      "delete": {
        "operationId": "DELETE_api_template_id",
        "summary": "Delete Template",
        "tags": [
          "Templates"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "delete_from_meta": {
                    "type": "boolean",
                    "default": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "template_id": {},
                        "template_name": {},
                        "deleted_from_database": {
                          "const": false
                        },
                        "deleted_from_meta": {
                          "const": false
                        },
                        "meta_deletion_method": {
                          "type": "null"
                        }
                      },
                      "required": [
                        "template_id",
                        "template_name",
                        "deleted_from_database",
                        "deleted_from_meta",
                        "meta_deletion_method"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "GET_api_template_id",
        "summary": "Get Template",
        "tags": [
          "Templates"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "_id": {
                          "type": "string",
                          "pattern": "^[0-9a-fA-F]{24}$"
                        },
                        "template_name": {
                          "type": "string"
                        },
                        "waba_id": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "language": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "platform": {
                          "type": "string"
                        },
                        "message_body": {
                          "type": "string"
                        },
                        "template_type": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "_id",
                        "template_name"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "PUT_api_template_id",
        "summary": "Update Template",
        "description": "Update an existing template. Upload header or carousel media using multipart/form-data.",
        "tags": [
          "Templates"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "add_security_recommendation": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ]
                  },
                  "buttons": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "carousel_cards": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "category": {
                    "type": "string"
                  },
                  "code_expiration_minutes": {
                    "type": "number"
                  },
                  "footer_text": {
                    "type": "string"
                  },
                  "header_text": {
                    "type": "string"
                  },
                  "language": {
                    "type": "string"
                  },
                  "message_body": {
                    "type": "string"
                  },
                  "otp_buttons": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "otp_code_length": {
                    "type": "number"
                  },
                  "should_update_on_meta": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ]
                  },
                  "template_name": {
                    "type": "string"
                  },
                  "template_type": {
                    "type": "string"
                  },
                  "variable_examples": {
                    "anyOf": [
                      {
                        "type": "object"
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  },
                  "variables_example": {
                    "anyOf": [
                      {
                        "type": "object"
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "add_security_recommendation": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ]
                  },
                  "buttons": {
                    "type": "string",
                    "description": "JSON-encoded buttons."
                  },
                  "carousel_cards": {
                    "type": "string",
                    "description": "JSON-encoded carousel cards."
                  },
                  "category": {
                    "type": "string"
                  },
                  "code_expiration_minutes": {
                    "type": "number"
                  },
                  "footer_text": {
                    "type": "string"
                  },
                  "header_text": {
                    "type": "string"
                  },
                  "language": {
                    "type": "string"
                  },
                  "message_body": {
                    "type": "string"
                  },
                  "otp_buttons": {
                    "type": "string",
                    "description": "JSON-encoded otp buttons."
                  },
                  "otp_code_length": {
                    "type": "number"
                  },
                  "should_update_on_meta": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ]
                  },
                  "template_name": {
                    "type": "string"
                  },
                  "template_type": {
                    "type": "string"
                  },
                  "variable_examples": {
                    "type": "string",
                    "description": "JSON-encoded variable examples."
                  },
                  "variables_example": {
                    "type": "string",
                    "description": "JSON-encoded variables example."
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "File to upload."
                  },
                  "card_media": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary",
                      "description": "File to upload."
                    },
                    "maxItems": 10
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "_id": {
                          "type": "string",
                          "pattern": "^[0-9a-fA-F]{24}$"
                        },
                        "template_name": {
                          "type": "string"
                        },
                        "waba_id": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "language": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "platform": {
                          "type": "string"
                        },
                        "message_body": {
                          "type": "string"
                        },
                        "template_type": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "_id",
                        "template_name"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        },
                        "error_details": {},
                        "local_template_updated": {
                          "const": true
                        },
                        "data": {
                          "type": "object"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error",
                        "error_details",
                        "local_template_updated",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {}
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/template/admin-templates/list": {
      "get": {
        "operationId": "GET_api_template_admin_templates_list",
        "summary": "List · Template",
        "tags": [
          "Templates"
        ],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Filter by template category.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "description": "Filter by channel platform.",
            "schema": {
              "type": "string",
              "default": "whatsapp"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sector",
            "in": "query",
            "required": false,
            "description": "Filter results by sector.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "template_category",
            "in": "query",
            "required": false,
            "description": "Filter results by template category.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "count": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "data": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "success",
                    "count",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/template/create": {
      "post": {
        "operationId": "POST_api_template_create",
        "summary": "Create · Template",
        "description": "Create a template. WhatsApp is the default platform and requires waba_id. Upload header or carousel media using multipart/form-data.",
        "tags": [
          "Templates"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "add_security_recommendation": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ]
                  },
                  "buttons": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "call_permission": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ]
                  },
                  "carousel_cards": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "category": {
                    "type": "string",
                    "description": "UTILITY, MARKETING, or AUTHENTICATION. The server uppercases the supplied category.",
                    "default": "UTILITY"
                  },
                  "code_expiration_minutes": {
                    "type": "number"
                  },
                  "footer_text": {
                    "type": "string"
                  },
                  "has_expiration": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ]
                  },
                  "header_text": {
                    "type": "string"
                  },
                  "is_limited_time_offer": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ]
                  },
                  "language": {
                    "type": "string",
                    "default": "en_US"
                  },
                  "message_body": {
                    "type": "string",
                    "description": "Body text with any template variables."
                  },
                  "offer_text": {
                    "type": "string"
                  },
                  "otp_buttons": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "otp_code_length": {
                    "type": "number"
                  },
                  "platform": {
                    "type": "string",
                    "enum": [
                      "whatsapp",
                      "telegram",
                      "facebook",
                      "instagram",
                      "twitter"
                    ],
                    "default": "whatsapp"
                  },
                  "template_name": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Template name as registered with the channel provider.",
                    "examples": [
                      "order_update"
                    ]
                  },
                  "template_type": {
                    "type": "string",
                    "default": "standard"
                  },
                  "variable_examples": {
                    "anyOf": [
                      {
                        "type": "object"
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  },
                  "variables_example": {
                    "anyOf": [
                      {
                        "type": "object"
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  },
                  "waba_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Required for WhatsApp templates (the default platform). Use the _id from GET /api/whatsapp/waba-list.",
                    "examples": [
                      "507f1f77bcf86cd799439011"
                    ]
                  }
                },
                "required": [
                  "template_name"
                ],
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "platform": {
                          "const": "whatsapp"
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "waba_id"
                      ]
                    }
                  }
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "add_security_recommendation": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ]
                  },
                  "buttons": {
                    "type": "string",
                    "description": "JSON-encoded buttons."
                  },
                  "call_permission": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ]
                  },
                  "carousel_cards": {
                    "type": "string",
                    "description": "JSON-encoded carousel cards."
                  },
                  "category": {
                    "type": "string",
                    "description": "UTILITY, MARKETING, or AUTHENTICATION. The server uppercases the supplied category.",
                    "default": "UTILITY"
                  },
                  "code_expiration_minutes": {
                    "type": "number"
                  },
                  "footer_text": {
                    "type": "string"
                  },
                  "has_expiration": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ]
                  },
                  "header_text": {
                    "type": "string"
                  },
                  "is_limited_time_offer": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ]
                  },
                  "language": {
                    "type": "string",
                    "default": "en_US"
                  },
                  "message_body": {
                    "type": "string",
                    "description": "Body text with any template variables."
                  },
                  "offer_text": {
                    "type": "string"
                  },
                  "otp_buttons": {
                    "type": "string",
                    "description": "JSON-encoded otp buttons."
                  },
                  "otp_code_length": {
                    "type": "number"
                  },
                  "platform": {
                    "type": "string",
                    "enum": [
                      "whatsapp",
                      "telegram",
                      "facebook",
                      "instagram",
                      "twitter"
                    ],
                    "default": "whatsapp"
                  },
                  "template_name": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Template name as registered with the channel provider.",
                    "examples": [
                      "order_update"
                    ]
                  },
                  "template_type": {
                    "type": "string",
                    "default": "standard"
                  },
                  "variable_examples": {
                    "type": "string",
                    "description": "JSON-encoded variable examples."
                  },
                  "variables_example": {
                    "type": "string",
                    "description": "JSON-encoded variables example."
                  },
                  "waba_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Required for WhatsApp templates (the default platform). Use the _id from GET /api/whatsapp/waba-list.",
                    "examples": [
                      "507f1f77bcf86cd799439011"
                    ]
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "File to upload."
                  },
                  "card_media": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary",
                      "description": "File to upload."
                    },
                    "maxItems": 10
                  }
                },
                "required": [
                  "template_name"
                ],
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "platform": {
                          "const": "whatsapp"
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "waba_id"
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "template_id": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "required": [
                    "message",
                    "template_id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                },
                "example": {
                  "error": "WABA ID is required"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {}
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/template/meta-list": {
      "get": {
        "operationId": "GET_api_template_meta_list",
        "summary": "Meta List · Template",
        "description": "Fetch templates from Meta for the selected Whatsaper WhatsApp account.",
        "tags": [
          "Templates"
        ],
        "parameters": [
          {
            "name": "waba_id",
            "in": "query",
            "required": true,
            "description": "Whatsaper WhatsApp account ID. Use the _id from GET /api/whatsapp/waba-list.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$",
              "examples": [
                "507f1f77bcf86cd799439011"
              ]
            },
            "example": "507f1f77bcf86cd799439011"
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "language": {
                            "type": "string"
                          },
                          "category": {
                            "type": "string"
                          },
                          "components": {
                            "type": "array",
                            "items": {
                              "type": "object"
                            }
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "count"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                },
                "example": {
                  "success": false,
                  "error": "waba_id is required (query or body)"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/template/migrate": {
      "post": {
        "operationId": "POST_api_template_migrate",
        "summary": "Migrate · Template",
        "tags": [
          "Templates"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "destination_waba_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "template_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "required": [
                  "destination_waba_id",
                  "template_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "new_template_id": {},
                        "source_template_id": {},
                        "template_name": {},
                        "source_waba_id": {},
                        "destination_waba_id": {}
                      },
                      "required": [
                        "new_template_id",
                        "source_template_id",
                        "template_name",
                        "source_waba_id",
                        "destination_waba_id"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        },
                        "meta_error": {}
                      },
                      "required": [
                        "success",
                        "error",
                        "details",
                        "meta_error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {}
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/template/suggest": {
      "post": {
        "operationId": "POST_api_template_suggest",
        "summary": "Suggest · Template",
        "tags": [
          "Templates"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "minLength": 1
                  },
                  "additionalDetails": {
                    "type": "string"
                  },
                  "businessName": {
                    "type": "string",
                    "minLength": 1
                  },
                  "industry": {
                    "type": "string",
                    "minLength": 1
                  },
                  "language": {
                    "type": "string",
                    "minLength": 1
                  },
                  "occasion": {
                    "type": "string",
                    "minLength": 1
                  },
                  "purpose": {
                    "type": "string",
                    "minLength": 1
                  },
                  "tone": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "action",
                  "businessName",
                  "industry",
                  "language",
                  "occasion",
                  "purpose",
                  "tone"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "modelUsed": {},
                          "modelId": {}
                        },
                        "required": [
                          "modelUsed",
                          "modelId"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/template/sync": {
      "post": {
        "operationId": "POST_api_template_sync",
        "summary": "Sync · Template",
        "tags": [
          "Templates"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "meta_template_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1
                  },
                  "waba_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Whatsaper WhatsApp account ID. Use the _id from GET /api/whatsapp/waba-list."
                  }
                },
                "required": [
                  "waba_id",
                  "meta_template_ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "stats": {
                      "type": "object",
                      "properties": {
                        "requested": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "found_on_meta": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "not_found_on_meta": {
                          "type": "array",
                          "items": {}
                        },
                        "newly_synced": {
                          "type": "integer"
                        },
                        "updated": {
                          "type": "integer"
                        },
                        "errors": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "requested",
                        "found_on_meta",
                        "not_found_on_meta",
                        "newly_synced",
                        "updated",
                        "errors"
                      ]
                    },
                    "errors": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "stats",
                    "errors"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/template/sync-status": {
      "post": {
        "operationId": "POST_api_template_sync_status",
        "summary": "Sync Status · Template",
        "tags": [
          "Templates"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "template_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "waba_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Whatsaper WhatsApp account ID. Use the _id from GET /api/whatsapp/waba-list."
                  }
                },
                "required": [
                  "waba_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "stats": {
                          "type": "object",
                          "properties": {
                            "updated": {
                              "type": "integer"
                            },
                            "not_found_on_meta": {
                              "type": "integer"
                            },
                            "errors": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "updated",
                            "not_found_on_meta",
                            "errors"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "stats"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "stats": {
                          "type": "object",
                          "properties": {
                            "total_checked": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "updated": {
                              "type": "integer"
                            },
                            "not_found_on_meta": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "errors": {
                              "type": "integer",
                              "minimum": 0
                            }
                          },
                          "required": [
                            "total_checked",
                            "updated",
                            "not_found_on_meta",
                            "errors"
                          ]
                        },
                        "not_found_on_meta": {},
                        "errors": {}
                      },
                      "required": [
                        "success",
                        "message",
                        "stats",
                        "not_found_on_meta",
                        "errors"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/appointments/bookings": {
      "get": {
        "operationId": "GET_api_appointments_bookings",
        "summary": "Bookings · Appointments",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "config_id",
            "in": "query",
            "required": false,
            "description": "Filter results by config ID.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "description": "Start date for the result range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "description": "End date for the result range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 20
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "payment_status",
            "in": "query",
            "required": false,
            "description": "Filter results by payment status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "bookings": {},
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "currentPage": {
                          "type": "integer"
                        },
                        "totalPages": {
                          "type": "integer"
                        },
                        "totalItems": {
                          "type": "integer"
                        },
                        "itemsPerPage": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "currentPage",
                        "totalPages",
                        "totalItems",
                        "itemsPerPage"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "bookings",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_appointments_bookings",
        "summary": "Bookings · Appointments",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Caller-generated key used to deduplicate retries of the same booking.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "answers": {
                    "anyOf": [
                      {
                        "type": "object"
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  },
                  "configId": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  },
                  "contactId": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  },
                  "endTime": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Alternative to the Idempotency-Key header."
                  },
                  "startTime": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "whatsappPhoneNumberId": {
                    "type": "string"
                  }
                },
                "required": [
                  "configId",
                  "contactId",
                  "startTime",
                  "endTime"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "booking": {}
                  },
                  "required": [
                    "success",
                    "booking"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/appointments/bookings/{id}": {
      "get": {
        "operationId": "GET_api_appointments_bookings_id",
        "summary": "Bookings · Appointments",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "booking": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "booking"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/appointments/bookings/{id}/send-payment-link": {
      "post": {
        "operationId": "POST_api_appointments_bookings_id_send_payment_link",
        "summary": "Send Payment Link · Appointments",
        "description": "Send the appointment payment link. Supply gateway_config_id when the appointment configuration has no payment gateway.",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "gateway_config_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Required when no payment gateway is configured on the appointment."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "payment_link": {},
                    "transaction_id": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "payment_link",
                    "transaction_id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/appointments/bookings/{id}/status": {
      "put": {
        "operationId": "PUT_api_appointments_bookings_id_status",
        "summary": "Status · Appointments",
        "description": "Update the booking status. Rescheduling requires both startTime and endTime.",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "endTime": {
                    "type": "string",
                    "format": "date-time",
                    "description": "New end time when rescheduling."
                  },
                  "startTime": {
                    "type": "string",
                    "format": "date-time",
                    "description": "New start time when rescheduling."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "confirmed",
                      "canceled",
                      "rescheduled"
                    ]
                  }
                },
                "required": [
                  "status"
                ],
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "status": {
                          "const": "rescheduled"
                        }
                      },
                      "required": [
                        "status"
                      ]
                    },
                    "then": {
                      "required": [
                        "startTime",
                        "endTime"
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "booking": {}
                      },
                      "required": [
                        "success",
                        "booking"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "booking": {
                          "type": "object"
                        }
                      },
                      "required": [
                        "success",
                        "booking"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/appointments/bookings/bulk-delete": {
      "delete": {
        "operationId": "DELETE_api_appointments_bookings_bulk_delete",
        "summary": "Bulk Delete · Appointments",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "deleted_count": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "deleted_count"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/appointments/capacity": {
      "get": {
        "operationId": "GET_api_appointments_capacity",
        "summary": "Capacity · Appointments",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/appointments/configs": {
      "get": {
        "operationId": "GET_api_appointments_configs",
        "summary": "Configs · Appointments",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 10
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "waba_id",
            "in": "query",
            "required": false,
            "description": "Whatsaper WhatsApp account ID. Use the _id from GET /api/whatsapp/waba-list.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "configs": {},
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "currentPage": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            },
                            "totalItems": {
                              "type": "integer"
                            },
                            "itemsPerPage": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "currentPage",
                            "totalPages",
                            "totalItems",
                            "itemsPerPage"
                          ]
                        }
                      },
                      "required": [
                        "configs",
                        "pagination"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_appointments_configs",
        "summary": "Configs · Appointments",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "slots": {
                    "type": "array",
                    "items": {}
                  },
                  "status": {
                    "enum": [
                      "active",
                      "deactivating",
                      "inactive"
                    ],
                    "type": "string"
                  },
                  "waba_id": {
                    "type": "string",
                    "description": "ObjectId (ref: WhatsappWaba)"
                  },
                  "location": {
                    "type": "string"
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "sheet_id": {
                    "type": "string"
                  },
                  "sheet_name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "calendar_id": {
                    "type": "string"
                  },
                  "allow_overlap": {
                    "type": "boolean"
                  },
                  "pre_paid_fees": {
                    "type": "number"
                  },
                  "intro_message": {
                    "type": "string"
                  },
                  "reminder_hours": {
                    "type": "number"
                  },
                  "tax_percentage": {
                    "type": "number"
                  },
                  "duration_minutes": {
                    "type": "number"
                  },
                  "appointment_fees": {
                    "type": "number"
                  },
                  "whatsapp_flow_id": {
                    "type": "string"
                  },
                  "variable_mappings": {},
                  "google_account_id": {
                    "type": "string",
                    "description": "ObjectId (ref: GoogleAccount)"
                  },
                  "cancel_template_id": {
                    "type": "string",
                    "description": "ObjectId (ref: Template)"
                  },
                  "payment_gateway_id": {
                    "type": "string",
                    "description": "ObjectId (ref: PaymentGatewayConfig)"
                  },
                  "create_google_meet": {
                    "type": "boolean"
                  },
                  "success_template_id": {
                    "type": "string",
                    "description": "ObjectId (ref: Template)"
                  },
                  "confirm_template_id": {
                    "type": "string",
                    "description": "ObjectId (ref: Template)"
                  },
                  "series_of_questions": {
                    "type": "array",
                    "items": {}
                  },
                  "reminder_template_id": {
                    "type": "string",
                    "description": "ObjectId (ref: Template)"
                  },
                  "custom_fields_mapping": {
                    "type": "array",
                    "items": {}
                  },
                  "max_daily_appointments": {
                    "type": "number"
                  },
                  "reschedule_template_id": {
                    "type": "string",
                    "description": "ObjectId (ref: Template)"
                  },
                  "total_appointment_fees": {
                    "type": "number"
                  },
                  "accept_partial_payment": {
                    "type": "boolean"
                  },
                  "partial_payment_amount": {
                    "type": "number"
                  },
                  "max_advance_booking_days": {
                    "type": "number"
                  },
                  "payment_link_template_id": {
                    "type": "string",
                    "description": "ObjectId (ref: Template)"
                  },
                  "send_confirmation_message": {
                    "type": "boolean"
                  },
                  "payment_link_variable_mappings": {},
                  "send_payment_link_automatically": {
                    "type": "boolean"
                  },
                  "break_between_appointments_minutes": {
                    "type": "number"
                  }
                },
                "required": [
                  "waba_id",
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "config": {}
                  },
                  "required": [
                    "success",
                    "config"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/appointments/configs/{id}": {
      "delete": {
        "operationId": "DELETE_api_appointments_configs_id",
        "summary": "Configs · Appointments",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "GET_api_appointments_configs_id",
        "summary": "Configs · Appointments",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "config": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "config"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "PATCH_api_appointments_configs_id",
        "summary": "Configs · Appointments",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "slots": {
                    "type": "array",
                    "items": {}
                  },
                  "status": {
                    "enum": [
                      "active",
                      "deactivating",
                      "inactive"
                    ],
                    "type": "string"
                  },
                  "waba_id": {
                    "type": "string",
                    "description": "ObjectId (ref: WhatsappWaba)"
                  },
                  "location": {
                    "type": "string"
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "sheet_id": {
                    "type": "string"
                  },
                  "sheet_name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "calendar_id": {
                    "type": "string"
                  },
                  "allow_overlap": {
                    "type": "boolean"
                  },
                  "pre_paid_fees": {
                    "type": "number"
                  },
                  "intro_message": {
                    "type": "string"
                  },
                  "reminder_hours": {
                    "type": "number"
                  },
                  "tax_percentage": {
                    "type": "number"
                  },
                  "duration_minutes": {
                    "type": "number"
                  },
                  "appointment_fees": {
                    "type": "number"
                  },
                  "whatsapp_flow_id": {
                    "type": "string"
                  },
                  "variable_mappings": {},
                  "google_account_id": {
                    "type": "string",
                    "description": "ObjectId (ref: GoogleAccount)"
                  },
                  "cancel_template_id": {
                    "type": "string",
                    "description": "ObjectId (ref: Template)"
                  },
                  "payment_gateway_id": {
                    "type": "string",
                    "description": "ObjectId (ref: PaymentGatewayConfig)"
                  },
                  "create_google_meet": {
                    "type": "boolean"
                  },
                  "success_template_id": {
                    "type": "string",
                    "description": "ObjectId (ref: Template)"
                  },
                  "confirm_template_id": {
                    "type": "string",
                    "description": "ObjectId (ref: Template)"
                  },
                  "series_of_questions": {
                    "type": "array",
                    "items": {}
                  },
                  "reminder_template_id": {
                    "type": "string",
                    "description": "ObjectId (ref: Template)"
                  },
                  "custom_fields_mapping": {
                    "type": "array",
                    "items": {}
                  },
                  "max_daily_appointments": {
                    "type": "number"
                  },
                  "reschedule_template_id": {
                    "type": "string",
                    "description": "ObjectId (ref: Template)"
                  },
                  "total_appointment_fees": {
                    "type": "number"
                  },
                  "accept_partial_payment": {
                    "type": "boolean"
                  },
                  "partial_payment_amount": {
                    "type": "number"
                  },
                  "max_advance_booking_days": {
                    "type": "number"
                  },
                  "payment_link_template_id": {
                    "type": "string",
                    "description": "ObjectId (ref: Template)"
                  },
                  "send_confirmation_message": {
                    "type": "boolean"
                  },
                  "payment_link_variable_mappings": {},
                  "send_payment_link_automatically": {
                    "type": "boolean"
                  },
                  "break_between_appointments_minutes": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "config": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "config"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/appointments/configs/{id}/bookings": {
      "get": {
        "operationId": "GET_api_appointments_configs_id_bookings",
        "summary": "Bookings · Appointments",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "config_id",
            "in": "query",
            "required": false,
            "description": "Filter results by config ID.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "description": "Start date for the result range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "description": "End date for the result range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 20
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "payment_status",
            "in": "query",
            "required": false,
            "description": "Filter results by payment status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "bookings": {},
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "currentPage": {
                          "type": "integer"
                        },
                        "totalPages": {
                          "type": "integer"
                        },
                        "totalItems": {
                          "type": "integer"
                        },
                        "itemsPerPage": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "currentPage",
                        "totalPages",
                        "totalItems",
                        "itemsPerPage"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "bookings",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/appointments/configs/{id}/templates": {
      "patch": {
        "operationId": "PATCH_api_appointments_configs_id_templates",
        "summary": "Templates · Appointments",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cancel_template_id": {
                    "type": "string"
                  },
                  "payment_link_template_id": {
                    "type": "string"
                  },
                  "reminder_hours": {
                    "type": "number"
                  },
                  "reminder_template_id": {
                    "type": "string"
                  },
                  "reschedule_template_id": {
                    "type": "string"
                  },
                  "status_update_template_id": {
                    "type": "string"
                  },
                  "success_template_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "config": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "config"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/appointments/dates/{configId}": {
      "get": {
        "operationId": "GET_api_appointments_dates_configId",
        "summary": "Dates · Appointments",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "configId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The config id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "dates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string",
                            "format": "date"
                          },
                          "formatted": {
                            "type": "string"
                          },
                          "slots_count": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "date",
                          "formatted",
                          "slots_count"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "dates"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/appointments/slots/{configId}": {
      "get": {
        "operationId": "GET_api_appointments_slots_configId",
        "summary": "Slots · Appointments",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "configId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the appointment configuration."
          },
          {
            "name": "date",
            "in": "query",
            "required": true,
            "description": "Date for which to return appointment slots, in YYYY-MM-DD format.",
            "schema": {
              "type": "string",
              "format": "date",
              "examples": [
                "2026-12-01"
              ]
            },
            "example": "2026-12-01"
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "slots": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "start": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "end": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "display": {
                            "type": "string"
                          },
                          "duration": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "start",
                          "end",
                          "display",
                          "duration"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "slots"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/contacts": {
      "get": {
        "operationId": "GET_api_contacts",
        "summary": "List Contacts",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "is_unsubscribed",
            "in": "query",
            "required": false,
            "description": "Filter by subscription status. Send true or false.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 10
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "description": "Filter by channel platform.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string",
              "default": "created_at"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "Filter by acquisition or channel source.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tags",
            "in": "query",
            "required": false,
            "description": "Comma-separated tag IDs.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "contacts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "_id": {
                                "type": "string",
                                "pattern": "^[0-9a-fA-F]{24}$"
                              },
                              "name": {
                                "type": "string"
                              },
                              "phone_number": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "email": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "workspace_id": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "tags": {
                                "type": "array",
                                "items": {
                                  "type": "object"
                                }
                              },
                              "segments": {
                                "type": "array",
                                "items": {
                                  "type": "object"
                                }
                              }
                            }
                          }
                        },
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "currentPage": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            },
                            "totalItems": {
                              "type": "integer"
                            },
                            "itemsPerPage": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "currentPage",
                            "totalPages",
                            "totalItems",
                            "itemsPerPage"
                          ]
                        }
                      },
                      "required": [
                        "contacts",
                        "pagination"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_contacts",
        "summary": "Create Contacts",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "custom_fields": {
                    "anyOf": [
                      {
                        "type": "object"
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  },
                  "email": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "phone_number": {
                    "type": "string",
                    "minLength": 1
                  },
                  "segments": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "source": {
                    "type": "string",
                    "default": "whatsapp"
                  },
                  "status": {
                    "type": "string"
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "required": [
                  "name",
                  "phone_number"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "errors": {}
                      },
                      "required": [
                        "success",
                        "message",
                        "errors"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/contacts/{id}": {
      "delete": {
        "operationId": "DELETE_api_contacts_id",
        "summary": "Delete Contacts",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "remediation_options": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "remediation_options"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "GET_api_contacts_id",
        "summary": "Get Contacts",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "PUT_api_contacts_id",
        "summary": "Update Contacts",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "assigned_to": {
                    "type": "string"
                  },
                  "custom_fields": {
                    "anyOf": [
                      {
                        "type": "object"
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  },
                  "email": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "phone_number": {
                    "type": "string"
                  },
                  "segments": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "source": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string"
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "errors": {}
                      },
                      "required": [
                        "success",
                        "message",
                        "errors"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/contacts/{id}/deletion-preview": {
      "get": {
        "operationId": "GET_api_contacts_id_deletion_preview",
        "summary": "Deletion Preview · Contacts",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/contacts/{id}/funnel-status": {
      "get": {
        "operationId": "GET_api_contacts_id_funnel_status",
        "summary": "Funnel Status · Contacts",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/contacts/add-to-segments": {
      "post": {
        "operationId": "POST_api_contacts_add_to_segments",
        "summary": "Add To Segments · Contacts",
        "description": "Pass workspace_id or X-Workspace-ID. This operation requires a Workspace.",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contactIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "segmentIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "required": [
                  "contactIds",
                  "segmentIds"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "totalMappings": {}
                      },
                      "required": [
                        "totalMappings"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/contacts/delete": {
      "delete": {
        "operationId": "DELETE_api_contacts_delete",
        "summary": "Delete · Contacts",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedCount": {},
                        "deletedIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "notFoundIds": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{24}$"
                          }
                        }
                      },
                      "required": [
                        "deletedCount",
                        "deletedIds"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/contacts/export": {
      "post": {
        "operationId": "POST_api_contacts_export",
        "summary": "Export · Contacts",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "format": {
                    "type": "string",
                    "enum": [
                      "csv",
                      "xlsx"
                    ],
                    "default": "csv"
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "jobId": {},
                    "contactCount": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "jobId",
                    "contactCount"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/contacts/export/download/{filename}": {
      "get": {
        "operationId": "GET_api_contacts_export_download_filename",
        "summary": "Download · Contacts",
        "description": "Download the completed export file. Use the filename from the export job result.",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "filename",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Filename returned by the completed export job."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            },
            "headers": {
              "Content-Disposition": {
                "description": "Attachment filename.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/contacts/export/status/{jobId}": {
      "get": {
        "operationId": "GET_api_contacts_export_status_jobId",
        "summary": "Status · Contacts",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The job id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "jobId": {},
                    "state": {},
                    "progress": {}
                  },
                  "required": [
                    "success",
                    "jobId",
                    "state",
                    "progress"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/contacts/from-thread": {
      "post": {
        "operationId": "POST_api_contacts_from_thread",
        "summary": "From Thread · Contacts",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "custom_fields": {
                    "anyOf": [
                      {
                        "type": "object"
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  },
                  "email": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "segments": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "status": {
                    "type": "string"
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "threadId": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "required": [
                  "threadId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "errors": {}
                      },
                      "required": [
                        "success",
                        "message",
                        "errors"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/contacts/funnel/action": {
      "post": {
        "operationId": "POST_api_contacts_funnel_action",
        "summary": "Action · Contacts",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "actions": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "minItems": 1
                  },
                  "globalItemId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "globalItemId",
                  "actions"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/contacts/funnels": {
      "get": {
        "operationId": "GET_api_contacts_funnels",
        "summary": "Funnels · Contacts",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/contacts/import": {
      "post": {
        "operationId": "POST_api_contacts_import",
        "summary": "Import · Contacts",
        "description": "Pass workspace_id or X-Workspace-ID. This operation requires a Workspace.",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "File to upload."
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "jobId": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "jobId"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/contacts/stats/summary": {
      "get": {
        "operationId": "GET_api_contacts_stats_summary",
        "summary": "Summary · Contacts",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "by_status": {}
                      },
                      "required": [
                        "total",
                        "by_status"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/custom-fields": {
      "get": {
        "operationId": "GET_api_custom_fields",
        "summary": "List Custom Fields",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string",
              "default": "created_at"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Filter by resource type.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "fields": {},
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "currentPage": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            },
                            "totalItems": {
                              "type": "integer"
                            },
                            "itemsPerPage": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "currentPage",
                            "totalPages",
                            "totalItems",
                            "itemsPerPage"
                          ]
                        }
                      },
                      "required": [
                        "fields",
                        "pagination"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_custom_fields",
        "summary": "Create Custom Fields",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string"
                  },
                  "is_active": {
                    "type": "boolean"
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1
                  },
                  "max_length": {
                    "type": "number"
                  },
                  "max_value": {
                    "type": "number"
                  },
                  "min_length": {
                    "type": "number"
                  },
                  "min_value": {
                    "type": "number"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "operational_scope": {
                    "type": "string"
                  },
                  "options": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "placeholder": {
                    "type": "string"
                  },
                  "required": {
                    "type": "boolean"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "text",
                      "number",
                      "date",
                      "boolean",
                      "select",
                      "textarea",
                      "email",
                      "phone"
                    ]
                  },
                  "workspace_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  }
                },
                "required": [
                  "name",
                  "label",
                  "type"
                ],
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "type": {
                          "const": "select"
                        }
                      },
                      "required": [
                        "type"
                      ]
                    },
                    "then": {
                      "required": [
                        "options"
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "errors": {}
                      },
                      "required": [
                        "success",
                        "message",
                        "errors"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "refused": {
                          "type": "string"
                        },
                        "remediation_options": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "success",
                        "refused",
                        "remediation_options"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/custom-fields/{id}": {
      "get": {
        "operationId": "GET_api_custom_fields_id",
        "summary": "Get Custom Fields",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "PUT_api_custom_fields_id",
        "summary": "Update Custom Fields",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string"
                  },
                  "is_active": {
                    "type": "boolean"
                  },
                  "label": {
                    "type": "string"
                  },
                  "max_length": {
                    "type": "number"
                  },
                  "max_value": {
                    "type": "number"
                  },
                  "min_length": {
                    "type": "number"
                  },
                  "min_value": {
                    "type": "number"
                  },
                  "name": {
                    "type": "string"
                  },
                  "options": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "placeholder": {
                    "type": "string"
                  },
                  "required": {
                    "type": "boolean"
                  },
                  "type": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "errors": {}
                      },
                      "required": [
                        "success",
                        "message",
                        "errors"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/custom-fields/delete": {
      "post": {
        "operationId": "POST_api_custom_fields_delete",
        "summary": "Delete · Custom Fields",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedCount": {},
                        "deletedIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "deletedCount",
                        "deletedIds"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/custom-fields/status": {
      "post": {
        "operationId": "POST_api_custom_fields_status",
        "summary": "Status · Custom Fields",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  },
                  "is_active": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "ids",
                  "is_active"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "matchedCount": {},
                        "modifiedCount": {},
                        "updatedIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "is_active": {}
                      },
                      "required": [
                        "matchedCount",
                        "modifiedCount",
                        "updatedIds",
                        "is_active"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/import-jobs": {
      "get": {
        "operationId": "GET_api_import_jobs",
        "summary": "List Import Jobs",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 10
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string",
              "default": "created_at"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "import_jobs": {},
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "currentPage": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            },
                            "totalItems": {
                              "type": "integer"
                            },
                            "itemsPerPage": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "currentPage",
                            "totalPages",
                            "totalItems",
                            "itemsPerPage"
                          ]
                        }
                      },
                      "required": [
                        "import_jobs",
                        "pagination"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/import-jobs/{id}": {
      "get": {
        "operationId": "GET_api_import_jobs_id",
        "summary": "Get Import Jobs",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/import-jobs/bulk-delete": {
      "post": {
        "operationId": "POST_api_import_jobs_bulk_delete",
        "summary": "Bulk Delete · Import Jobs",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedCount": {},
                        "deletedIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "deletedCount",
                        "deletedIds"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/kanban-funnels": {
      "get": {
        "operationId": "GET_api_kanban_funnels",
        "summary": "List Kanban Funnels",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "funnelType",
            "in": "query",
            "required": false,
            "description": "Filter results by funnel type.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "currentPage": {
                          "type": "integer"
                        },
                        "totalPages": {
                          "type": "integer"
                        },
                        "totalFunnels": {
                          "type": "integer"
                        },
                        "limit": {},
                        "skip": {}
                      },
                      "required": [
                        "currentPage",
                        "totalPages",
                        "totalFunnels",
                        "limit",
                        "skip"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_kanban_funnels",
        "summary": "Create Kanban Funnels",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string"
                  },
                  "funnelType": {
                    "type": "string",
                    "minLength": 1
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "operational_scope": {
                    "type": "string"
                  },
                  "workspace_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  }
                },
                "required": [
                  "name",
                  "funnelType"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/kanban-funnels/{id}": {
      "delete": {
        "operationId": "DELETE_api_kanban_funnels_id",
        "summary": "Delete Kanban Funnels",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "GET_api_kanban_funnels_id",
        "summary": "Get Kanban Funnels",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "PATCH_api_kanban_funnels_id",
        "summary": "Update Kanban Funnels",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/kanban-funnels/{id}/available-data": {
      "get": {
        "operationId": "GET_api_kanban_funnels_id_available_data",
        "summary": "Available Data · Kanban Funnels",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "available": {
                          "type": "array",
                          "items": {}
                        },
                        "archived": {
                          "type": "array",
                          "items": {}
                        }
                      },
                      "required": [
                        "available",
                        "archived"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/kanban-funnels/{id}/items": {
      "get": {
        "operationId": "GET_api_kanban_funnels_id_items",
        "summary": "Items · Kanban Funnels",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "priority",
            "in": "query",
            "required": false,
            "description": "Filter results by priority.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "stages": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "_id": {},
                              "name": {},
                              "color": {},
                              "stageOrder": {},
                              "items": {}
                            },
                            "required": [
                              "_id",
                              "name",
                              "color",
                              "stageOrder",
                              "items"
                            ]
                          }
                        }
                      },
                      "required": [
                        "stages"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/kanban-funnels/{id}/items/{itemId}": {
      "delete": {
        "operationId": "DELETE_api_kanban_funnels_id_items_itemId",
        "summary": "Items · Kanban Funnels",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The item id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "PATCH_api_kanban_funnels_id_items_itemId",
        "summary": "Items · Kanban Funnels",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The item id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "isArchived": {
                    "type": "boolean"
                  },
                  "priority": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/kanban-funnels/{id}/items/move": {
      "post": {
        "operationId": "POST_api_kanban_funnels_id_items_move",
        "summary": "Move · Kanban Funnels",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "globalItemId": {
                    "type": "string"
                  },
                  "itemId": {
                    "type": "string"
                  },
                  "position": {
                    "type": "number"
                  },
                  "toStageId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "toStageId"
                ],
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "required": [
                          "itemId"
                        ]
                      },
                      {
                        "required": [
                          "globalItemId"
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/kanban-funnels/{id}/stages": {
      "get": {
        "operationId": "GET_api_kanban_funnels_id_stages",
        "summary": "Stages · Kanban Funnels",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "PUT_api_kanban_funnels_id_stages",
        "summary": "Stages · Kanban Funnels",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "stages": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  }
                },
                "required": [
                  "stages"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/kanban-funnels/capacity/usage": {
      "get": {
        "operationId": "GET_api_kanban_funnels_capacity_usage",
        "summary": "Usage · Kanban Funnels",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/segments": {
      "get": {
        "operationId": "GET_api_segments",
        "summary": "List Segments",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "segments": {},
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "currentPage": {
                              "type": "integer"
                            },
                            "totalSegments": {
                              "type": "integer"
                            },
                            "totalItems": {
                              "type": "integer"
                            },
                            "itemsPerPage": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "currentPage",
                            "totalSegments",
                            "totalItems",
                            "itemsPerPage"
                          ]
                        }
                      },
                      "required": [
                        "segments",
                        "pagination"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_segments",
        "summary": "Create Segments",
        "description": "Pass workspace_id or X-Workspace-ID. This operation requires a Workspace.",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contactIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "description": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Other error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/segments/{segmentId}": {
      "delete": {
        "operationId": "DELETE_api_segments_segmentId",
        "summary": "Delete Segments",
        "description": "Pass workspace_id or X-Workspace-ID. This operation requires a Workspace.",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "segmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The segment id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "GET_api_segments_segmentId",
        "summary": "Get Segments",
        "description": "Pass workspace_id or X-Workspace-ID. This operation requires a Workspace.",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "segmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The segment id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "PUT_api_segments_segmentId",
        "summary": "Update Segments",
        "description": "Pass workspace_id or X-Workspace-ID. This operation requires a Workspace.",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "segmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The segment id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contactIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "description": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "sort_order": {
                    "type": "number"
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Other error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/segments/{segmentId}/contacts": {
      "delete": {
        "operationId": "DELETE_api_segments_segmentId_contacts",
        "summary": "Contacts · Segments",
        "description": "Pass workspace_id or X-Workspace-ID. This operation requires a Workspace.",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "segmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The segment id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contactIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "required": [
                  "contactIds"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedCount": {}
                      },
                      "required": [
                        "deletedCount"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "GET_api_segments_segmentId_contacts",
        "summary": "Contacts · Segments",
        "description": "Pass workspace_id or X-Workspace-ID. This operation requires a Workspace.",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "segmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The segment id in the resource URL."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_segments_segmentId_contacts",
        "summary": "Contacts · Segments",
        "description": "Pass workspace_id or X-Workspace-ID. This operation requires a Workspace.",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "segmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The segment id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contactIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "required": [
                  "contactIds"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "processedCount": {}
                      },
                      "required": [
                        "processedCount"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/segments/delete": {
      "delete": {
        "operationId": "DELETE_api_segments_delete",
        "summary": "Delete · Segments",
        "description": "Pass workspace_id or X-Workspace-ID. This operation requires a Workspace.",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "segmentIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "required": [
                  "segmentIds"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedCount": {}
                      },
                      "required": [
                        "deletedCount"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/tags": {
      "get": {
        "operationId": "GET_api_tags",
        "summary": "List Tags",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string",
              "default": "created_at"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "tags": {},
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "currentPage": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            },
                            "totalItems": {
                              "type": "integer"
                            },
                            "itemsPerPage": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "currentPage",
                            "totalPages",
                            "totalItems",
                            "itemsPerPage"
                          ]
                        }
                      },
                      "required": [
                        "tags",
                        "pagination"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_tags",
        "summary": "Create Tags",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "color": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "required": [
                  "label"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "errors": {}
                      },
                      "required": [
                        "success",
                        "message",
                        "errors"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/tags/{id}": {
      "get": {
        "operationId": "GET_api_tags_id",
        "summary": "Get Tags",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "usage_count": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "usage_count"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "PUT_api_tags_id",
        "summary": "Update Tags",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "color": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "errors": {}
                      },
                      "required": [
                        "success",
                        "message",
                        "errors"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/tags/delete": {
      "delete": {
        "operationId": "DELETE_api_tags_delete",
        "summary": "Delete · Tags",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedCount": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "deletedIds": {
                          "type": "array",
                          "items": {}
                        }
                      },
                      "required": [
                        "deletedCount",
                        "deletedIds"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/tags/stats/popular": {
      "get": {
        "operationId": "GET_api_tags_stats_popular",
        "summary": "Popular · Tags",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 10
            }
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/tags/stats/usage": {
      "get": {
        "operationId": "GET_api_tags_stats_usage",
        "summary": "Usage · Tags",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/working-hours": {
      "post": {
        "operationId": "POST_api_working_hours",
        "summary": "Create Working Hours",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "friday": {
                    "type": "string"
                  },
                  "is_holiday_mode": {
                    "type": "boolean"
                  },
                  "monday": {
                    "type": "string"
                  },
                  "saturday": {
                    "type": "string"
                  },
                  "sunday": {
                    "type": "string"
                  },
                  "thursday": {
                    "type": "string"
                  },
                  "tuesday": {
                    "type": "string"
                  },
                  "waba_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Whatsaper WhatsApp account ID. Use the _id from GET /api/whatsapp/waba-list."
                  },
                  "wednesday": {
                    "type": "string"
                  }
                },
                "required": [
                  "waba_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/working-hours/{waba_id}": {
      "delete": {
        "operationId": "DELETE_api_working_hours_waba_id",
        "summary": "Delete Working Hours",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "waba_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The waba id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "GET_api_working_hours_waba_id",
        "summary": "Get Working Hours",
        "tags": [
          "Contacts & CRM"
        ],
        "parameters": [
          {
            "name": "waba_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The waba id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/automation": {
      "get": {
        "operationId": "GET_api_automation",
        "summary": "List Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "is_active",
            "in": "query",
            "required": false,
            "description": "Filter by activation status. Send true or false.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "description": "Filter by channel platform.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "currentPage": {
                          "type": "integer"
                        },
                        "totalPages": {
                          "type": "integer"
                        },
                        "totalItems": {
                          "type": "integer"
                        },
                        "itemsPerPage": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "currentPage",
                        "totalPages",
                        "totalItems",
                        "itemsPerPage"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_automation",
        "summary": "Create Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connections": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "description": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "nodes": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "platform": {
                    "type": "string"
                  },
                  "settings": {
                    "type": "object"
                  },
                  "triggers": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "required": [
                  "name",
                  "nodes"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/automation/{flowId}": {
      "delete": {
        "operationId": "DELETE_api_automation_flowId",
        "summary": "Delete Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "flowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The flow id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "GET_api_automation_flowId",
        "summary": "Get Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "flowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The flow id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "PUT_api_automation_flowId",
        "summary": "Update Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "flowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The flow id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connections": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "description": {
                    "type": "string"
                  },
                  "is_active": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "string"
                  },
                  "nodes": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "platform": {
                    "type": "string"
                  },
                  "settings": {
                    "type": "object"
                  },
                  "triggers": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/automation/{flowId}/duplicate": {
      "post": {
        "operationId": "POST_api_automation_flowId_duplicate",
        "summary": "Duplicate · Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "flowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The flow id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/automation/{flowId}/executions": {
      "get": {
        "operationId": "GET_api_automation_flowId_executions",
        "summary": "Executions · Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "flowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The flow id in the resource URL."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 10
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "currentPage": {
                          "type": "integer"
                        },
                        "totalPages": {
                          "type": "integer"
                        },
                        "totalItems": {
                          "type": "integer"
                        },
                        "itemsPerPage": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "currentPage",
                        "totalPages",
                        "totalItems",
                        "itemsPerPage"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/automation/{flowId}/export": {
      "get": {
        "operationId": "GET_api_automation_flowId_export",
        "summary": "Export · Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "flowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The flow id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/automation/{flowId}/test": {
      "post": {
        "operationId": "POST_api_automation_flowId_test",
        "summary": "Test · Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "flowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The flow id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "test_data": {
                    "type": "object"
                  },
                  "unsaved_flow": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "success": {
                              "const": true
                            }
                          },
                          "required": [
                            "success"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {}
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/automation/{flowId}/toggle": {
      "patch": {
        "operationId": "PATCH_api_automation_flowId_toggle",
        "summary": "Toggle · Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "flowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The flow id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "is_active": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "is_active"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "blockers": {}
                      },
                      "required": [
                        "success",
                        "message",
                        "blockers"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/automation/diagnose": {
      "post": {
        "operationId": "POST_api_automation_diagnose",
        "summary": "Diagnose · Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string"
                  },
                  "senderNumber": {
                    "type": "string"
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "userId": {
                          "type": "string"
                        },
                        "steps": {
                          "type": "array",
                          "items": {}
                        }
                      },
                      "required": [
                        "userId",
                        "steps"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/automation/executions": {
      "get": {
        "operationId": "GET_api_automation_executions",
        "summary": "Executions · Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "flowId",
            "in": "query",
            "required": false,
            "description": "Filter results by flow ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 10
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "currentPage": {
                          "type": "integer"
                        },
                        "totalPages": {
                          "type": "integer"
                        },
                        "totalItems": {
                          "type": "integer"
                        },
                        "itemsPerPage": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "currentPage",
                        "totalPages",
                        "totalItems",
                        "itemsPerPage"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/automation/executions/{executionId}": {
      "get": {
        "operationId": "GET_api_automation_executions_executionId",
        "summary": "Executions · Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "executionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The execution id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/automation/import": {
      "post": {
        "operationId": "POST_api_automation_import",
        "summary": "Import · Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "schema_version": {
                    "const": "automation-flow/v1"
                  },
                  "workflow": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "description": {
                        "type": "string"
                      },
                      "nodes": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      },
                      "connections": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      },
                      "triggers": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      },
                      "settings": {
                        "type": "object"
                      }
                    }
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "required": [
                  "schema_version",
                  "workflow"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "flow_id": {
                          "type": "string"
                        },
                        "warnings": {},
                        "unresolved_requirements": {}
                      },
                      "required": [
                        "flow_id",
                        "warnings",
                        "unresolved_requirements"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {}
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/automation/import/preview": {
      "post": {
        "operationId": "POST_api_automation_import_preview",
        "summary": "Preview · Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "schema_version": {
                    "const": "automation-flow/v1"
                  },
                  "workflow": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "description": {
                        "type": "string"
                      },
                      "nodes": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      },
                      "connections": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      },
                      "triggers": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      },
                      "settings": {
                        "type": "object"
                      }
                    }
                  }
                },
                "required": [
                  "schema_version",
                  "workflow"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {},
                    "data": {},
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {},
                        "data": {},
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "data",
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/automation/node-types": {
      "get": {
        "operationId": "GET_api_automation_node_types",
        "summary": "Node Types · Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "icon": {
                                "type": "string"
                              },
                              "inputs": {
                                "type": "integer"
                              },
                              "outputs": {
                                "type": "integer"
                              },
                              "parameters": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "type": {
                                      "type": "string"
                                    },
                                    "options": {
                                      "type": "array",
                                      "items": {}
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "type",
                                    "options"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "category",
                              "icon",
                              "inputs",
                              "outputs",
                              "parameters"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "icon": {
                                "type": "string"
                              },
                              "inputs": {
                                "type": "integer"
                              },
                              "outputs": {
                                "type": "integer"
                              },
                              "parameters": {
                                "type": "array",
                                "items": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "default": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "default"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "default": {
                                          "type": "integer"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "default"
                                      ]
                                    }
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "category",
                              "icon",
                              "inputs",
                              "outputs",
                              "parameters"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "icon": {
                                "type": "string"
                              },
                              "inputs": {
                                "type": "integer"
                              },
                              "outputs": {
                                "type": "integer"
                              },
                              "parameters": {
                                "type": "array",
                                "items": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "item_fields": {
                                          "type": "array",
                                          "items": {}
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "item_fields"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label"
                                      ]
                                    }
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "category",
                              "icon",
                              "inputs",
                              "outputs",
                              "parameters"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "icon": {
                                "type": "string"
                              },
                              "inputs": {
                                "type": "integer"
                              },
                              "outputs": {
                                "type": "integer"
                              },
                              "parameters": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "type": {
                                      "type": "string"
                                    },
                                    "label": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "type",
                                    "label"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "category",
                              "icon",
                              "inputs",
                              "outputs",
                              "parameters"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "icon": {
                                "type": "string"
                              },
                              "inputs": {
                                "type": "integer"
                              },
                              "outputs": {
                                "type": "integer"
                              },
                              "parameters": {
                                "type": "array",
                                "items": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "required": {
                                          "const": true
                                        },
                                        "placeholder": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "required",
                                        "placeholder"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "placeholder": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "placeholder"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "item_fields": {
                                          "type": "array",
                                          "items": {}
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "item_fields"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "options": {
                                          "type": "array",
                                          "items": {}
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "options"
                                      ]
                                    }
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "category",
                              "icon",
                              "inputs",
                              "outputs",
                              "parameters"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "icon": {
                                "type": "string"
                              },
                              "inputs": {
                                "type": "integer"
                              },
                              "outputs": {
                                "type": "integer"
                              },
                              "parameters": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "type": {
                                      "type": "string"
                                    },
                                    "label": {
                                      "type": "string"
                                    },
                                    "placeholder": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "type",
                                    "label",
                                    "placeholder"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "category",
                              "icon",
                              "inputs",
                              "outputs",
                              "parameters"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "icon": {
                                "type": "string"
                              },
                              "inputs": {
                                "type": "integer"
                              },
                              "outputs": {
                                "type": "integer"
                              },
                              "parameters": {
                                "type": "array",
                                "items": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "placeholder": {
                                          "type": "string"
                                        },
                                        "default": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "placeholder",
                                        "default"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "placeholder": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "placeholder"
                                      ]
                                    }
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "category",
                              "icon",
                              "inputs",
                              "outputs",
                              "parameters"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "icon": {
                                "type": "string"
                              },
                              "inputs": {
                                "type": "integer"
                              },
                              "outputs": {
                                "type": "integer"
                              },
                              "parameters": {
                                "type": "array",
                                "items": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "required": {
                                          "const": true
                                        },
                                        "placeholder": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "required",
                                        "placeholder"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "placeholder": {
                                          "type": "string"
                                        },
                                        "default": {
                                          "type": "integer"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "placeholder",
                                        "default"
                                      ]
                                    }
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "category",
                              "icon",
                              "inputs",
                              "outputs",
                              "parameters"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "icon": {
                                "type": "string"
                              },
                              "inputs": {
                                "type": "integer"
                              },
                              "outputs": {
                                "type": "integer"
                              },
                              "parameters": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "type": {
                                      "type": "string"
                                    },
                                    "label": {
                                      "type": "string"
                                    },
                                    "required": {
                                      "const": true
                                    },
                                    "placeholder": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "type",
                                    "label",
                                    "required",
                                    "placeholder"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "category",
                              "icon",
                              "inputs",
                              "outputs",
                              "parameters"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "icon": {
                                "type": "string"
                              },
                              "inputs": {
                                "type": "integer"
                              },
                              "outputs": {
                                "type": "integer"
                              },
                              "parameters": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "type": {
                                      "type": "string"
                                    },
                                    "label": {
                                      "type": "string"
                                    },
                                    "item_fields": {
                                      "type": "array",
                                      "items": {}
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "type",
                                    "label",
                                    "item_fields"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "category",
                              "icon",
                              "inputs",
                              "outputs",
                              "parameters"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "icon": {
                                "type": "string"
                              },
                              "inputs": {
                                "type": "integer"
                              },
                              "outputs": {
                                "type": "integer"
                              },
                              "parameters": {
                                "type": "array",
                                "items": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "required": {
                                          "const": true
                                        },
                                        "placeholder": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "required",
                                        "placeholder"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "default": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "default"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "item_fields": {
                                          "type": "array",
                                          "items": {}
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "item_fields"
                                      ]
                                    }
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "category",
                              "icon",
                              "inputs",
                              "outputs",
                              "parameters"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "icon": {
                                "type": "string"
                              },
                              "inputs": {
                                "type": "integer"
                              },
                              "outputs": {
                                "type": "integer"
                              },
                              "parameters": {
                                "type": "array",
                                "items": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "required": {
                                          "const": true
                                        },
                                        "placeholder": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "required",
                                        "placeholder"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "required": {
                                          "const": true
                                        },
                                        "default": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "required",
                                        "default"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "placeholder": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "placeholder"
                                      ]
                                    }
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "category",
                              "icon",
                              "inputs",
                              "outputs",
                              "parameters"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "icon": {
                                "type": "string"
                              },
                              "inputs": {
                                "type": "integer"
                              },
                              "outputs": {
                                "type": "integer"
                              },
                              "parameters": {
                                "type": "array",
                                "items": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "required": {
                                          "const": true
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "required"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "default": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "default"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "default": {
                                          "type": "integer"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "default"
                                      ]
                                    }
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "category",
                              "icon",
                              "inputs",
                              "outputs",
                              "parameters"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "icon": {
                                "type": "string"
                              },
                              "inputs": {
                                "type": "integer"
                              },
                              "outputs": {
                                "type": "integer"
                              },
                              "parameters": {
                                "type": "array",
                                "items": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "options": {
                                          "type": "array",
                                          "items": {}
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "options"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "item_fields": {
                                          "type": "array",
                                          "items": {}
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "item_fields"
                                      ]
                                    }
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "category",
                              "icon",
                              "inputs",
                              "outputs",
                              "parameters"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "icon": {
                                "type": "string"
                              },
                              "inputs": {
                                "type": "integer"
                              },
                              "outputs": {
                                "type": "integer"
                              },
                              "parameters": {
                                "type": "array",
                                "items": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "options": {
                                          "type": "array",
                                          "items": {}
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "options"
                                      ]
                                    }
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "category",
                              "icon",
                              "inputs",
                              "outputs",
                              "parameters"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "icon": {
                                "type": "string"
                              },
                              "inputs": {
                                "type": "integer"
                              },
                              "outputs": {
                                "type": "integer"
                              },
                              "parameters": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "type": {
                                      "type": "string"
                                    },
                                    "label": {
                                      "type": "string"
                                    },
                                    "default": {
                                      "type": "integer"
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "type",
                                    "label",
                                    "default"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "category",
                              "icon",
                              "inputs",
                              "outputs",
                              "parameters"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "icon": {
                                "type": "string"
                              },
                              "inputs": {
                                "type": "integer"
                              },
                              "outputs": {
                                "type": "integer"
                              },
                              "parameters": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "type": {
                                      "type": "string"
                                    },
                                    "fields": {
                                      "type": "array",
                                      "items": {}
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "type",
                                    "fields"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "category",
                              "icon",
                              "inputs",
                              "outputs",
                              "parameters"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "icon": {
                                "type": "string"
                              },
                              "inputs": {
                                "type": "integer"
                              },
                              "outputs": {
                                "type": "integer"
                              },
                              "parameters": {
                                "type": "array",
                                "items": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "placeholder": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "placeholder"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "placeholder": {
                                          "type": "string"
                                        },
                                        "default": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "placeholder",
                                        "default"
                                      ]
                                    }
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "category",
                              "icon",
                              "inputs",
                              "outputs",
                              "parameters"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "icon": {
                                "type": "string"
                              },
                              "inputs": {
                                "type": "integer"
                              },
                              "outputs": {
                                "type": "integer"
                              },
                              "parameters": {
                                "type": "array",
                                "items": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "placeholder": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "placeholder"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "placeholder": {
                                          "type": "string"
                                        },
                                        "default": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "placeholder",
                                        "default"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "options": {
                                          "type": "array",
                                          "items": {}
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label",
                                        "options"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "type",
                                        "label"
                                      ]
                                    }
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "category",
                              "icon",
                              "inputs",
                              "outputs",
                              "parameters"
                            ]
                          }
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/automation/statistics": {
      "get": {
        "operationId": "GET_api_automation_statistics",
        "summary": "Statistics · Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "total_flows": {},
                        "active_flows": {},
                        "total_executions": {},
                        "successful_executions": {},
                        "success_rate": {},
                        "recent_executions": {}
                      },
                      "required": [
                        "total_flows",
                        "active_flows",
                        "total_executions",
                        "successful_executions",
                        "success_rate",
                        "recent_executions"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/automation/suggest": {
      "post": {
        "operationId": "POST_api_automation_suggest",
        "summary": "Suggest · Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "minLength": 1
                  },
                  "additionalDetails": {
                    "type": "string"
                  },
                  "businessName": {
                    "type": "string",
                    "minLength": 1
                  },
                  "industry": {
                    "type": "string",
                    "minLength": 1
                  },
                  "language": {
                    "type": "string",
                    "minLength": 1
                  },
                  "occasion": {
                    "type": "string"
                  },
                  "platform": {
                    "type": "string"
                  },
                  "purpose": {
                    "type": "string",
                    "minLength": 1
                  },
                  "tone": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "action",
                  "businessName",
                  "industry",
                  "language",
                  "purpose",
                  "tone"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "null"
                          }
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "raw_response": {}
                            },
                            "required": [
                              "raw_response"
                            ]
                          }
                        }
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/automation/workflow-schema": {
      "get": {
        "operationId": "GET_api_automation_workflow_schema",
        "summary": "Workflow Schema · Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/campaigns": {
      "get": {
        "operationId": "GET_api_campaigns",
        "summary": "List Campaigns",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 10,
              "maximum": 100
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "description": "Filter by channel platform.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string",
              "enum": [
                "name",
                "description",
                "recipient_type",
                "status",
                "created_at",
                "sent_at"
              ],
              "default": "created_at"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "campaigns": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {},
                              "name": {},
                              "description": {},
                              "template_name": {},
                              "recipient_type": {},
                              "is_scheduled": {},
                              "scheduled_at": {},
                              "sent_at": {},
                              "stats": {},
                              "status": {},
                              "completion_duration_seconds": {},
                              "platform": {},
                              "recurring_schedule": {}
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "template_name",
                              "recipient_type",
                              "is_scheduled",
                              "scheduled_at",
                              "sent_at",
                              "stats",
                              "status",
                              "completion_duration_seconds",
                              "platform",
                              "recurring_schedule"
                            ]
                          }
                        },
                        "campaignStatistics": {
                          "type": "object",
                          "properties": {
                            "totalCampaignsCreated": {
                              "type": "integer"
                            },
                            "totalSent": {
                              "type": "integer"
                            },
                            "messagesDelivered": {
                              "type": "integer"
                            },
                            "messagesRead": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "totalCampaignsCreated",
                            "totalSent",
                            "messagesDelivered",
                            "messagesRead"
                          ]
                        },
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "currentPage": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            },
                            "totalItems": {
                              "type": "integer"
                            },
                            "itemsPerPage": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "currentPage",
                            "totalPages",
                            "totalItems",
                            "itemsPerPage"
                          ]
                        }
                      },
                      "required": [
                        "campaigns",
                        "campaignStatistics",
                        "pagination"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_campaigns",
        "summary": "Create Campaigns",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "avoid_unsubscribers": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ],
                    "default": true
                  },
                  "carousel_cards_data": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "carousel_products": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "contact_numbers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "coupon_code": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "is_scheduled": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ],
                    "default": false
                  },
                  "language_code": {
                    "type": "string"
                  },
                  "location_data": {
                    "type": "object"
                  },
                  "media_url": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "offer_expiration_minutes": {
                    "type": "number"
                  },
                  "phone_numbers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "platform": {
                    "type": "string",
                    "default": "whatsapp"
                  },
                  "recipient_type": {
                    "type": "string",
                    "enum": [
                      "all_contacts",
                      "specific_contacts",
                      "tags",
                      "segments",
                      "all_threads",
                      "specific_threads",
                      "phone_numbers"
                    ]
                  },
                  "recurring_schedule": {
                    "type": "object"
                  },
                  "scheduled_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Scheduled send time in ISO 8601 format."
                  },
                  "segment_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "sender_phone_number_id": {
                    "type": "string"
                  },
                  "specific_contacts": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "specific_threads": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "status": {
                    "type": "string"
                  },
                  "tag_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "template_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  },
                  "template_name": {
                    "type": "string"
                  },
                  "variables_mapping": {
                    "anyOf": [
                      {
                        "type": "object"
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  },
                  "waba_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Required for WhatsApp campaigns. Get the _id from GET /api/whatsapp/waba-list."
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "required": [
                  "name",
                  "recipient_type"
                ],
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "required": [
                          "template_id"
                        ]
                      },
                      {
                        "required": [
                          "template_name"
                        ]
                      }
                    ]
                  },
                  {
                    "if": {
                      "properties": {
                        "platform": {
                          "const": "whatsapp"
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "waba_id"
                      ]
                    }
                  },
                  {
                    "if": {
                      "properties": {
                        "recipient_type": {
                          "const": "tags"
                        }
                      },
                      "required": [
                        "recipient_type"
                      ]
                    },
                    "then": {
                      "required": [
                        "tag_ids"
                      ]
                    }
                  },
                  {
                    "if": {
                      "properties": {
                        "recipient_type": {
                          "const": "segments"
                        }
                      },
                      "required": [
                        "recipient_type"
                      ]
                    },
                    "then": {
                      "required": [
                        "segment_ids"
                      ]
                    }
                  },
                  {
                    "if": {
                      "properties": {
                        "recipient_type": {
                          "const": "specific_threads"
                        }
                      },
                      "required": [
                        "recipient_type"
                      ]
                    },
                    "then": {
                      "required": [
                        "specific_threads"
                      ]
                    }
                  },
                  {
                    "if": {
                      "properties": {
                        "recipient_type": {
                          "const": "specific_contacts"
                        }
                      }
                    },
                    "then": {
                      "anyOf": [
                        {
                          "required": [
                            "specific_contacts"
                          ]
                        },
                        {
                          "required": [
                            "contact_numbers"
                          ]
                        }
                      ]
                    }
                  },
                  {
                    "if": {
                      "properties": {
                        "is_scheduled": {
                          "enum": [
                            true,
                            "true",
                            1,
                            "1"
                          ]
                        }
                      },
                      "required": [
                        "is_scheduled"
                      ]
                    },
                    "then": {
                      "required": [
                        "scheduled_at"
                      ]
                    }
                  }
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "avoid_unsubscribers": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ],
                    "default": true
                  },
                  "carousel_cards_data": {
                    "type": "string",
                    "description": "JSON-encoded carousel cards data."
                  },
                  "carousel_products": {
                    "type": "string",
                    "description": "JSON-encoded carousel products."
                  },
                  "contact_numbers": {
                    "type": "string",
                    "description": "JSON-encoded contact numbers."
                  },
                  "coupon_code": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "is_scheduled": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ],
                    "default": false
                  },
                  "language_code": {
                    "type": "string"
                  },
                  "location_data": {
                    "type": "string",
                    "description": "JSON-encoded location data."
                  },
                  "media_url": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "offer_expiration_minutes": {
                    "type": "number"
                  },
                  "phone_numbers": {
                    "type": "string",
                    "description": "JSON-encoded phone numbers."
                  },
                  "platform": {
                    "type": "string",
                    "default": "whatsapp"
                  },
                  "recipient_type": {
                    "type": "string",
                    "enum": [
                      "all_contacts",
                      "specific_contacts",
                      "tags",
                      "segments",
                      "all_threads",
                      "specific_threads",
                      "phone_numbers"
                    ]
                  },
                  "recurring_schedule": {
                    "type": "string",
                    "description": "JSON-encoded recurring schedule."
                  },
                  "scheduled_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Scheduled send time in ISO 8601 format."
                  },
                  "segment_ids": {
                    "type": "string",
                    "description": "JSON-encoded segment IDS."
                  },
                  "sender_phone_number_id": {
                    "type": "string"
                  },
                  "specific_contacts": {
                    "type": "string",
                    "description": "JSON-encoded specific contacts."
                  },
                  "specific_threads": {
                    "type": "string",
                    "description": "JSON-encoded specific threads."
                  },
                  "status": {
                    "type": "string"
                  },
                  "tag_ids": {
                    "type": "string",
                    "description": "JSON-encoded tag IDS."
                  },
                  "template_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  },
                  "template_name": {
                    "type": "string"
                  },
                  "variables_mapping": {
                    "type": "string",
                    "description": "JSON-encoded variables mapping."
                  },
                  "waba_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$",
                    "description": "Required for WhatsApp campaigns. Get the _id from GET /api/whatsapp/waba-list."
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  },
                  "file_url": {
                    "type": "string",
                    "format": "binary",
                    "description": "File to upload."
                  },
                  "carousel_files": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary",
                      "description": "File to upload."
                    },
                    "maxItems": 10
                  }
                },
                "required": [
                  "name",
                  "recipient_type"
                ],
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "required": [
                          "template_id"
                        ]
                      },
                      {
                        "required": [
                          "template_name"
                        ]
                      }
                    ]
                  },
                  {
                    "if": {
                      "properties": {
                        "platform": {
                          "const": "whatsapp"
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "waba_id"
                      ]
                    }
                  },
                  {
                    "if": {
                      "properties": {
                        "recipient_type": {
                          "const": "tags"
                        }
                      },
                      "required": [
                        "recipient_type"
                      ]
                    },
                    "then": {
                      "required": [
                        "tag_ids"
                      ]
                    }
                  },
                  {
                    "if": {
                      "properties": {
                        "recipient_type": {
                          "const": "segments"
                        }
                      },
                      "required": [
                        "recipient_type"
                      ]
                    },
                    "then": {
                      "required": [
                        "segment_ids"
                      ]
                    }
                  },
                  {
                    "if": {
                      "properties": {
                        "recipient_type": {
                          "const": "specific_threads"
                        }
                      },
                      "required": [
                        "recipient_type"
                      ]
                    },
                    "then": {
                      "required": [
                        "specific_threads"
                      ]
                    }
                  },
                  {
                    "if": {
                      "properties": {
                        "recipient_type": {
                          "const": "specific_contacts"
                        }
                      }
                    },
                    "then": {
                      "anyOf": [
                        {
                          "required": [
                            "specific_contacts"
                          ]
                        },
                        {
                          "required": [
                            "contact_numbers"
                          ]
                        }
                      ]
                    }
                  },
                  {
                    "if": {
                      "properties": {
                        "is_scheduled": {
                          "enum": [
                            true,
                            "true",
                            1,
                            "1"
                          ]
                        }
                      },
                      "required": [
                        "is_scheduled"
                      ]
                    },
                    "then": {
                      "required": [
                        "scheduled_at"
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "campaign_id": {
                      "type": "string"
                    },
                    "cycle_key": {},
                    "required": {},
                    "available": {},
                    "remediation_options": {}
                  },
                  "required": [
                    "success",
                    "code",
                    "message",
                    "campaign_id",
                    "cycle_key",
                    "required",
                    "available",
                    "remediation_options"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/campaigns/{id}": {
      "delete": {
        "operationId": "DELETE_api_campaigns_id",
        "summary": "Delete Campaigns",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "GET_api_campaigns_id",
        "summary": "Get Campaigns",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "PUT_api_campaigns_id",
        "summary": "Update Campaigns",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "avoid_unsubscribers": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ]
                  },
                  "is_scheduled": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ]
                  },
                  "recipients": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "recurring_schedule": {
                    "type": "object"
                  },
                  "scheduled_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Scheduled send time in ISO 8601 format."
                  },
                  "segment_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "sent_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "specific_contacts": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "stats": {
                    "type": "object"
                  },
                  "status": {
                    "type": "string"
                  },
                  "tag_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/campaigns/{id}/insights": {
      "get": {
        "operationId": "GET_api_campaigns_id_insights",
        "summary": "Insights · Campaigns",
        "description": "Pass workspace_id or X-Workspace-ID. This operation requires a Workspace.",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "stats": {},
                        "timeline": {},
                        "failureBreakdown": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "reason": {},
                              "count": {}
                            },
                            "required": [
                              "reason",
                              "count"
                            ]
                          }
                        },
                        "summary_cards": {
                          "type": "object",
                          "properties": {
                            "targeted": {},
                            "sent": {},
                            "delivered": {},
                            "read": {},
                            "failed": {},
                            "replies": {}
                          },
                          "required": [
                            "targeted",
                            "sent",
                            "delivered",
                            "read",
                            "failed",
                            "replies"
                          ]
                        },
                        "hourly_analytics": {},
                        "failure_diagnostics": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "percentage": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "percentage"
                            ]
                          }
                        },
                        "event_timeline": {
                          "type": "array",
                          "items": {}
                        },
                        "top_recipients": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "contact": {},
                              "phone": {},
                              "status": {},
                              "reason": {}
                            },
                            "required": [
                              "contact",
                              "phone",
                              "status",
                              "reason"
                            ]
                          }
                        },
                        "status_distribution": {
                          "type": "object",
                          "properties": {
                            "sent": {},
                            "delivered": {},
                            "read": {},
                            "failed": {},
                            "pending": {}
                          },
                          "required": [
                            "sent",
                            "delivered",
                            "read",
                            "failed",
                            "pending"
                          ]
                        },
                        "benchmarking": {
                          "type": "object",
                          "properties": {
                            "campaign_read_rate": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "integer"
                                }
                              ]
                            },
                            "account_average_read_rate": {
                              "type": "null"
                            },
                            "performance": {
                              "type": "null"
                            }
                          },
                          "required": [
                            "campaign_read_rate",
                            "account_average_read_rate",
                            "performance"
                          ]
                        },
                        "engagement": {
                          "type": "object",
                          "properties": {
                            "delivered": {},
                            "read": {},
                            "replies": {}
                          },
                          "required": [
                            "delivered",
                            "read",
                            "replies"
                          ]
                        }
                      },
                      "required": [
                        "stats",
                        "timeline",
                        "failureBreakdown",
                        "summary_cards",
                        "hourly_analytics",
                        "failure_diagnostics",
                        "event_timeline",
                        "top_recipients",
                        "status_distribution",
                        "benchmarking",
                        "engagement"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/campaigns/{id}/publish": {
      "post": {
        "operationId": "POST_api_campaigns_id_publish",
        "summary": "Publish · Campaigns",
        "description": "Publish a draft campaign. If its scheduled time has passed, choose send_immediately or provide action=reschedule with a future scheduled_at.",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "send_immediately",
                      "reschedule"
                    ]
                  },
                  "scheduled_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "New time when action is reschedule."
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "action": {
                          "const": "reschedule"
                        }
                      },
                      "required": [
                        "action"
                      ]
                    },
                    "then": {
                      "required": [
                        "scheduled_at"
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "code": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        },
                        "scheduled_at": {}
                      },
                      "required": [
                        "success",
                        "code",
                        "error",
                        "scheduled_at"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/campaigns/{id}/recipients": {
      "post": {
        "operationId": "POST_api_campaigns_id_recipients",
        "summary": "Recipients · Campaigns",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "column_variable_mapping": {
                    "type": "string"
                  },
                  "rows": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "minItems": 1
                  },
                  "variable_mapping": {
                    "type": "string"
                  }
                },
                "required": [
                  "rows"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "campaign_id": {},
                        "total_recipients": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "pending": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "invalid": {}
                      },
                      "required": [
                        "campaign_id",
                        "total_recipients",
                        "pending",
                        "invalid"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/campaigns/{id}/resend": {
      "post": {
        "operationId": "POST_api_campaigns_id_resend",
        "summary": "Resend · Campaigns",
        "description": "Resend a campaign. Supply a future scheduled_at when is_scheduled is true.",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "is_scheduled": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ]
                  },
                  "scheduled_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Future date and time, required when is_scheduled is true."
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "is_scheduled": {
                          "enum": [
                            true,
                            "true",
                            1,
                            "1"
                          ]
                        }
                      },
                      "required": [
                        "is_scheduled"
                      ]
                    },
                    "then": {
                      "required": [
                        "scheduled_at"
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/campaigns/{id}/retry": {
      "post": {
        "operationId": "POST_api_campaigns_id_retry",
        "summary": "Retry · Campaigns",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "campaign_id": {},
                        "status": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "campaign_id",
                        "status"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/campaigns/{id}/send": {
      "post": {
        "operationId": "POST_api_campaigns_id_send",
        "summary": "Send · Campaigns",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "campaign_id": {},
                        "total_recipients": {},
                        "status": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "campaign_id",
                        "total_recipients",
                        "status"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/campaigns/{id}/setup-recurring": {
      "post": {
        "operationId": "POST_api_campaigns_id_setup_recurring",
        "summary": "Setup Recurring · Campaigns",
        "description": "Pass workspace_id or X-Workspace-ID. This operation requires a Workspace.",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "recurring_end_date": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "recurring_pattern": {
                    "type": "string",
                    "enum": [
                      "daily",
                      "weekly",
                      "monthly"
                    ]
                  },
                  "scheduled_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Scheduled send time in ISO 8601 format."
                  }
                },
                "required": [
                  "recurring_pattern",
                  "scheduled_at"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/campaigns/{id}/toggle-pause": {
      "post": {
        "operationId": "POST_api_campaigns_id_toggle_pause",
        "summary": "Toggle Pause · Campaigns",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/campaigns/{id}/upload-excel": {
      "post": {
        "operationId": "POST_api_campaigns_id_upload_excel",
        "summary": "Upload Excel · Campaigns",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Name of the spreadsheet column to read."
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "File to upload."
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "totals": {},
                        "rows": {},
                        "columnOptions": {},
                        "phoneColumnIndex": {},
                        "wa_validated": {
                          "const": true
                        }
                      },
                      "required": [
                        "totals",
                        "rows",
                        "columnOptions",
                        "phoneColumnIndex",
                        "wa_validated"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/campaigns/preview-excel": {
      "post": {
        "operationId": "POST_api_campaigns_preview_excel",
        "summary": "Preview Excel · Campaigns",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "column": {
                    "type": "string",
                    "description": "Name of the spreadsheet column to read."
                  },
                  "sender_phone_number_id": {
                    "type": "string"
                  },
                  "waba_id": {
                    "type": "string",
                    "description": "Whatsaper WhatsApp account ID. Use the _id from GET /api/whatsapp/waba-list."
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "File to upload."
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "totals": {},
                        "rows": {},
                        "columnOptions": {},
                        "phoneColumnIndex": {},
                        "wa_validated": {
                          "const": false
                        }
                      },
                      "required": [
                        "totals",
                        "rows",
                        "columnOptions",
                        "phoneColumnIndex",
                        "wa_validated"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/sequences": {
      "get": {
        "operationId": "GET_api_sequences",
        "summary": "List Sequences",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "description": "Filter by channel platform.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_sequences",
        "summary": "Create Sequences",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "platform": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/sequences/{id}": {
      "delete": {
        "operationId": "DELETE_api_sequences_id",
        "summary": "Delete Sequences",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "GET_api_sequences_id",
        "summary": "Get Sequences",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "steps": {
                          "type": "array",
                          "items": {}
                        }
                      },
                      "required": [
                        "steps"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "PUT_api_sequences_id",
        "summary": "Update Sequences",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "is_active": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "string"
                  },
                  "platform": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/sequences/steps": {
      "post": {
        "operationId": "POST_api_sequences_steps",
        "summary": "Steps · Sequences",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "carousel_cards_data": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "catalog_id": {
                    "type": "string"
                  },
                  "coupon_code": {
                    "type": "string"
                  },
                  "delay_unit": {
                    "type": "string"
                  },
                  "delay_value": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "from_time": {
                    "type": "string"
                  },
                  "media_url": {
                    "type": "string"
                  },
                  "product_retailer_id": {
                    "type": "string"
                  },
                  "reply_material_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "reply_material_type": {
                    "type": "string",
                    "minLength": 1
                  },
                  "send_anytime": {
                    "type": "boolean"
                  },
                  "send_days": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "sequence_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  },
                  "sort": {
                    "type": "number"
                  },
                  "to_time": {
                    "type": "string"
                  },
                  "variables_mapping": {
                    "anyOf": [
                      {
                        "type": "object"
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  }
                },
                "required": [
                  "reply_material_id",
                  "reply_material_type",
                  "sequence_id"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/sequences/steps/{id}": {
      "delete": {
        "operationId": "DELETE_api_sequences_steps_id",
        "summary": "Steps · Sequences",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "PUT_api_sequences_steps_id",
        "summary": "Steps · Sequences",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sort": {
                    "type": "number"
                  },
                  "to_time": {
                    "type": "string"
                  },
                  "media_url": {
                    "type": "string"
                  },
                  "is_active": {
                    "type": "boolean"
                  },
                  "from_time": {
                    "type": "string"
                  },
                  "send_days": {
                    "type": "array",
                    "items": {}
                  },
                  "catalog_id": {
                    "type": "string"
                  },
                  "delay_unit": {
                    "enum": [
                      "minutes",
                      "hours",
                      "days"
                    ],
                    "type": "string"
                  },
                  "sequence_id": {
                    "type": "string",
                    "description": "ObjectId (ref: Sequence)"
                  },
                  "coupon_code": {
                    "type": "string"
                  },
                  "delay_value": {
                    "type": "number"
                  },
                  "send_anytime": {
                    "type": "boolean"
                  },
                  "reply_material_id": {
                    "type": "string",
                    "description": "ObjectId"
                  },
                  "variables_mapping": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "carousel_products": {
                    "type": "array",
                    "items": {}
                  },
                  "reply_material_type": {
                    "enum": [
                      "ReplyMaterial",
                      "Template",
                      "EcommerceCatalog",
                      "chatbot"
                    ],
                    "type": "string"
                  },
                  "carousel_cards_data": {
                    "type": "array",
                    "items": {}
                  },
                  "product_retailer_id": {
                    "type": "string"
                  },
                  "offer_expiration_minutes": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/sequences/steps/reorder": {
      "put": {
        "operationId": "PUT_api_sequences_steps_reorder",
        "summary": "Reorder · Sequences",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "steps": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  }
                },
                "required": [
                  "steps"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/social-automation": {
      "get": {
        "operationId": "GET_api_social_automation",
        "summary": "List Social Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "description": "Filter by channel platform.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_social_automation",
        "summary": "Create Social Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "auto_hide_comment": {
                    "type": "boolean"
                  },
                  "auto_like_comment": {
                    "type": "boolean"
                  },
                  "auto_reply_text": {
                    "type": "string"
                  },
                  "automation_type": {
                    "type": "string",
                    "minLength": 1
                  },
                  "carousel_cards_data": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "carousel_products": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "connection_id": {
                    "type": "string"
                  },
                  "coupon_code": {
                    "type": "string"
                  },
                  "delay_seconds": {
                    "type": "number"
                  },
                  "follow_gate_button_no": {
                    "type": "string"
                  },
                  "follow_gate_button_yes": {
                    "type": "string"
                  },
                  "follow_gate_message": {
                    "type": "string"
                  },
                  "follow_gate_rejection_message": {
                    "type": "string"
                  },
                  "hide_chatbot_id": {
                    "type": "string"
                  },
                  "hide_condition_type": {
                    "type": "string"
                  },
                  "hide_keywords": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "keywords": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "location_data": {
                    "type": "object"
                  },
                  "matching_method": {
                    "type": "string"
                  },
                  "media_url": {
                    "type": "string"
                  },
                  "partial_percentage": {
                    "type": "number"
                  },
                  "platform": {
                    "type": "string",
                    "minLength": 1
                  },
                  "reply_id": {
                    "type": "string"
                  },
                  "reply_type": {
                    "type": "string"
                  },
                  "reply_type_ref": {
                    "type": "string"
                  },
                  "requires_following": {
                    "type": "boolean"
                  },
                  "status": {
                    "type": "string"
                  },
                  "target_media_id": {
                    "type": "string"
                  },
                  "variables_mapping": {
                    "anyOf": [
                      {
                        "type": "object"
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "required": [
                  "platform",
                  "workspace_id",
                  "automation_type"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/social-automation/{id}": {
      "delete": {
        "operationId": "DELETE_api_social_automation_id",
        "summary": "Delete Social Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "GET_api_social_automation_id",
        "summary": "Get Social Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "PUT_api_social_automation_id",
        "summary": "Update Social Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "enum": [
                      "active",
                      "inactive"
                    ],
                    "type": "string"
                  },
                  "platform": {
                    "enum": [
                      "instagram",
                      "facebook"
                    ],
                    "type": "string"
                  },
                  "keywords": {
                    "type": "array",
                    "items": {}
                  },
                  "reply_id": {
                    "type": "string",
                    "description": "ObjectId"
                  },
                  "media_url": {
                    "type": "string"
                  },
                  "reply_type": {
                    "enum": [
                      "text",
                      "media",
                      "template",
                      "chatbot"
                    ],
                    "type": "string"
                  },
                  "coupon_code": {
                    "type": "string"
                  },
                  "connection_id": {
                    "type": "string",
                    "description": "ObjectId"
                  },
                  "location_data": {},
                  "hide_keywords": {
                    "type": "array",
                    "items": {}
                  },
                  "delay_seconds": {
                    "type": "number"
                  },
                  "reply_type_ref": {
                    "enum": [
                      "ReplyMaterial",
                      "Template",
                      "Chatbot"
                    ],
                    "type": "string"
                  },
                  "automation_type": {
                    "enum": [
                      "post_comment",
                      "reel_comment",
                      "story_mention",
                      "story_reply"
                    ],
                    "type": "string"
                  },
                  "target_media_id": {
                    "type": "string"
                  },
                  "matching_method": {
                    "enum": [
                      "exact",
                      "contains",
                      "partial",
                      "starts_with",
                      "ends_with"
                    ],
                    "type": "string"
                  },
                  "auto_reply_text": {
                    "type": "string"
                  },
                  "hide_chatbot_id": {
                    "type": "string",
                    "description": "ObjectId (ref: Chatbot)"
                  },
                  "activation_state": {
                    "enum": [
                      "draft",
                      "active",
                      "inactive"
                    ],
                    "type": "string"
                  },
                  "variables_mapping": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "carousel_products": {
                    "type": "array",
                    "items": {}
                  },
                  "auto_like_comment": {
                    "type": "boolean"
                  },
                  "auto_hide_comment": {
                    "type": "boolean"
                  },
                  "partial_percentage": {
                    "type": "number"
                  },
                  "requires_following": {
                    "type": "boolean"
                  },
                  "carousel_cards_data": {
                    "type": "array",
                    "items": {}
                  },
                  "hide_condition_type": {
                    "enum": [
                      "keywords",
                      "chatbot"
                    ],
                    "type": "string"
                  },
                  "follow_gate_message": {
                    "type": "string"
                  },
                  "follow_gate_button_no": {
                    "type": "string"
                  },
                  "follow_gate_button_yes": {
                    "type": "string"
                  },
                  "follow_gate_rejection_message": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/social-automation/media": {
      "post": {
        "operationId": "POST_api_social_automation_media",
        "summary": "Media · Social Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "media_type": {
                    "type": "string"
                  },
                  "page_id": {
                    "type": "string"
                  },
                  "platform": {
                    "type": "string",
                    "minLength": 1
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "required": [
                  "platform",
                  "workspace_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/social-automation/retrigger": {
      "post": {
        "operationId": "POST_api_social_automation_retrigger",
        "summary": "Retrigger · Social Automation",
        "tags": [
          "Campaigns & Automation"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "media_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "platform": {
                    "type": "string",
                    "minLength": 1
                  },
                  "workspace_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  }
                },
                "required": [
                  "media_id",
                  "platform",
                  "workspace_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "count": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "count"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "total_processed": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "triggered": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "total_processed",
                        "triggered"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-catalog/{id}/funnel-status": {
      "get": {
        "operationId": "GET_api_ecommerce_catalog_id_funnel_status",
        "summary": "Funnel Status · Ecommerce Catalog",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-catalog/capacity/usage": {
      "get": {
        "operationId": "GET_api_ecommerce_catalog_capacity_usage",
        "summary": "Usage · Ecommerce Catalog",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-catalog/catalog/{catalog_id}/confirm-deactivation": {
      "post": {
        "operationId": "POST_api_ecommerce_catalog_catalog_catalog_id_confirm_deactivation",
        "summary": "Confirm Deactivation · Ecommerce Catalog",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "catalog_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The catalog id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {},
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "data": {}
                      },
                      "required": [
                        "success",
                        "error",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {},
                        "data": {}
                      },
                      "required": [
                        "success",
                        "data"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-catalog/catalog/{catalog_id}/deactivate": {
      "post": {
        "operationId": "POST_api_ecommerce_catalog_catalog_catalog_id_deactivate",
        "summary": "Deactivate · Ecommerce Catalog",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "catalog_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The catalog id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-catalog/catalog/{catalog_id}/products": {
      "get": {
        "operationId": "GET_api_ecommerce_catalog_catalog_catalog_id_products",
        "summary": "Products · Ecommerce Catalog",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "catalog_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The catalog id in the resource URL."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "products": {
                          "type": "array",
                          "items": {}
                        },
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "currentPage": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            },
                            "totalItems": {
                              "type": "integer"
                            },
                            "itemsPerPage": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "currentPage",
                            "totalPages",
                            "totalItems",
                            "itemsPerPage"
                          ]
                        }
                      },
                      "required": [
                        "products",
                        "pagination"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "message",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_ecommerce_catalog_catalog_catalog_id_products",
        "summary": "Products · Ecommerce Catalog",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "catalog_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The catalog id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "additional_variant_attributes": {
                    "type": "string"
                  },
                  "availability": {
                    "type": "string"
                  },
                  "brand": {
                    "type": "string"
                  },
                  "category": {
                    "type": "string"
                  },
                  "condition": {
                    "type": "string"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "image_urls": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "price": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "retailer_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "sale_price": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "url": {
                    "type": "string"
                  }
                },
                "required": [
                  "retailer_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "product_id": {},
                        "product_db_id": {},
                        "response": {}
                      },
                      "required": [
                        "product_id",
                        "product_db_id",
                        "response"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "message",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-catalog/catalog/{catalog_id}/products/{product_id}": {
      "delete": {
        "operationId": "DELETE_api_ecommerce_catalog_catalog_catalog_id_products_product_id",
        "summary": "Products · Ecommerce Catalog",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "catalog_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The catalog id in the resource URL."
          },
          {
            "name": "product_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The product id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "message",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "PUT_api_ecommerce_catalog_catalog_catalog_id_products_product_id",
        "summary": "Products · Ecommerce Catalog",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "catalog_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The catalog id in the resource URL."
          },
          {
            "name": "product_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The product id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "additional_variant_attributes": {
                    "type": "string"
                  },
                  "availability": {
                    "type": "string"
                  },
                  "brand": {
                    "type": "string"
                  },
                  "category": {
                    "type": "string"
                  },
                  "condition": {
                    "type": "string"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "image_urls": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "price": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "retailer_id": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "message",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-catalog/catalog/{catalog_id}/reactivate": {
      "post": {
        "operationId": "POST_api_ecommerce_catalog_catalog_catalog_id_reactivate",
        "summary": "Reactivate · Ecommerce Catalog",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "catalog_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The catalog id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "state": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "state"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-catalog/funnel/action": {
      "post": {
        "operationId": "POST_api_ecommerce_catalog_funnel_action",
        "summary": "Action · Ecommerce Catalog",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "actions": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "minItems": 1
                  },
                  "globalItemId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "globalItemId",
                  "actions"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-catalog/funnels": {
      "get": {
        "operationId": "GET_api_ecommerce_catalog_funnels",
        "summary": "Funnels · Ecommerce Catalog",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-catalog/link-catalog": {
      "post": {
        "operationId": "POST_api_ecommerce_catalog_link_catalog",
        "summary": "Link Catalog · Ecommerce Catalog",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "catalog_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "waba_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Whatsaper WhatsApp account ID. Use the _id from GET /api/whatsapp/waba-list."
                  }
                },
                "required": [
                  "catalog_id",
                  "waba_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "catalog_id": {},
                        "catalog_db_id": {},
                        "response": {}
                      },
                      "required": [
                        "catalog_id",
                        "catalog_db_id",
                        "response"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "message",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-catalog/user/catalogs": {
      "get": {
        "operationId": "GET_api_ecommerce_catalog_user_catalogs",
        "summary": "Catalogs · Ecommerce Catalog",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "catalogs": {},
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "currentPage": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            },
                            "totalItems": {
                              "type": "integer"
                            },
                            "itemsPerPage": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "currentPage",
                            "totalPages",
                            "totalItems",
                            "itemsPerPage"
                          ]
                        }
                      },
                      "required": [
                        "catalogs",
                        "pagination"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-catalog/user/products": {
      "get": {
        "operationId": "GET_api_ecommerce_catalog_user_products",
        "summary": "Products · Ecommerce Catalog",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "catalog_id",
            "in": "query",
            "required": false,
            "description": "Catalog ID used to filter products.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 10,
              "maximum": 100
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Filter products by channel. Omit to list all allowed products.",
            "schema": {
              "type": "string",
              "enum": [
                "shopify",
                "whatsapp"
              ]
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "products": {},
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "currentPage": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            },
                            "totalItems": {
                              "type": "integer"
                            },
                            "itemsPerPage": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "currentPage",
                            "totalPages",
                            "totalItems",
                            "itemsPerPage"
                          ]
                        }
                      },
                      "required": [
                        "products",
                        "pagination"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-catalog/waba/{waba_id}/catalogs": {
      "get": {
        "operationId": "GET_api_ecommerce_catalog_waba_waba_id_catalogs",
        "summary": "Catalogs · Ecommerce Catalog",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "waba_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The waba id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "data": {}
                      },
                      "required": [
                        "data"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-catalog/waba/{waba_id}/linked-catalogs": {
      "get": {
        "operationId": "GET_api_ecommerce_catalog_waba_waba_id_linked_catalogs",
        "summary": "Linked Catalogs · Ecommerce Catalog",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "waba_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The waba id in the resource URL."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "catalogs": {},
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "currentPage": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            },
                            "totalItems": {
                              "type": "integer"
                            },
                            "itemsPerPage": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "currentPage",
                            "totalPages",
                            "totalItems",
                            "itemsPerPage"
                          ]
                        }
                      },
                      "required": [
                        "catalogs",
                        "pagination"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-catalog/waba/{waba_id}/sync-catalogs": {
      "post": {
        "operationId": "POST_api_ecommerce_catalog_waba_waba_id_sync_catalogs",
        "summary": "Sync Catalogs · Ecommerce Catalog",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "waba_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The waba id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "synced_count": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "catalogs": {}
                      },
                      "required": [
                        "synced_count",
                        "catalogs"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-order/message/{message_id}/orders": {
      "get": {
        "operationId": "GET_api_ecommerce_order_message_message_id_orders",
        "summary": "Orders · Ecommerce Order",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The message id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-order/orders/{order_id}": {
      "get": {
        "operationId": "GET_api_ecommerce_order_orders_order_id",
        "summary": "Orders · Ecommerce Order",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The order id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {},
                        "payment_link_sent": {},
                        "payment_link": {}
                      },
                      "required": [
                        "items",
                        "payment_link_sent",
                        "payment_link"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-order/orders/{order_id}/send-payment-link": {
      "post": {
        "operationId": "POST_api_ecommerce_order_orders_order_id_send_payment_link",
        "summary": "Send Payment Link · Ecommerce Order",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The order id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-order/orders/{order_id}/status": {
      "put": {
        "operationId": "PUT_api_ecommerce_order_orders_order_id_status",
        "summary": "Status · Ecommerce Order",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The order id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "order": {
                          "type": "object"
                        },
                        "notification": {
                          "type": "object",
                          "properties": {
                            "attempted": {
                              "const": false
                            },
                            "sent": {
                              "const": false
                            },
                            "wa_message_id": {
                              "type": "null"
                            },
                            "error": {
                              "type": "null"
                            }
                          },
                          "required": [
                            "attempted",
                            "sent",
                            "wa_message_id",
                            "error"
                          ]
                        }
                      },
                      "required": [
                        "order",
                        "notification"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-order/orders/bulk-delete": {
      "post": {
        "operationId": "POST_api_ecommerce_order_orders_bulk_delete",
        "summary": "Bulk Delete · Ecommerce Order",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedCount": {},
                        "deletedIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "deletedCount",
                        "deletedIds"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-order/status-templates": {
      "get": {
        "operationId": "GET_api_ecommerce_order_status_templates",
        "summary": "Status Templates · Ecommerce Order",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-order/status-templates/{status}": {
      "put": {
        "operationId": "PUT_api_ecommerce_order_status_templates_status",
        "summary": "Status Templates · Ecommerce Order",
        "description": "Set the message for an order status. Supply approved_template_id when use_approved_template is true, or message_template otherwise.",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The status in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "approved_template_id": {
                    "type": "string"
                  },
                  "is_active": {
                    "type": "boolean"
                  },
                  "message_template": {
                    "type": "string"
                  },
                  "use_approved_template": {
                    "type": "boolean"
                  },
                  "variable_mappings": {
                    "type": "object"
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "use_approved_template": {
                          "const": true
                        }
                      },
                      "required": [
                        "use_approved_template"
                      ]
                    },
                    "then": {
                      "required": [
                        "approved_template_id"
                      ]
                    },
                    "else": {
                      "required": [
                        "message_template"
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "template": {
                          "type": "object"
                        },
                        "placeholders": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "template",
                        "placeholders"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-order/user/orders": {
      "get": {
        "operationId": "GET_api_ecommerce_order_user_orders",
        "summary": "Orders · Ecommerce Order",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "contact_id",
            "in": "query",
            "required": false,
            "description": "Contact ID used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "description": "Filter results by currency.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "description": "End date for the result range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "description": "Start date for the result range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "wa_order_id",
            "in": "query",
            "required": false,
            "description": "Filter results by wa order ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "orders": {
                          "type": "array",
                          "items": {}
                        },
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "currentPage": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            },
                            "totalItems": {
                              "type": "integer"
                            },
                            "itemsPerPage": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "currentPage",
                            "totalPages",
                            "totalItems",
                            "itemsPerPage"
                          ]
                        }
                      },
                      "required": [
                        "orders",
                        "pagination"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ecommerce-order/user/orders/stats": {
      "get": {
        "operationId": "GET_api_ecommerce_order_user_orders_stats",
        "summary": "Stats · Ecommerce Order",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "description": "End date for the result range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "description": "Start date for the result range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/short-links": {
      "get": {
        "operationId": "GET_api_short_links",
        "summary": "List Short Links",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 10
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string",
              "default": "created_at"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "short_links": {},
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "currentPage": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            },
                            "totalItems": {
                              "type": "integer"
                            },
                            "itemsPerPage": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "currentPage",
                            "totalPages",
                            "totalItems",
                            "itemsPerPage"
                          ]
                        }
                      },
                      "required": [
                        "short_links",
                        "pagination"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_short_links",
        "summary": "Create Short Links",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "first_message": {
                    "type": "string"
                  },
                  "mobile": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "mobile"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "user": {
                          "type": "object",
                          "properties": {
                            "name": {},
                            "email": {}
                          },
                          "required": [
                            "name",
                            "email"
                          ]
                        },
                        "short_link": {
                          "type": "string"
                        },
                        "qr_code": {}
                      },
                      "required": [
                        "user",
                        "short_link",
                        "qr_code"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/short-links/{id}": {
      "get": {
        "operationId": "GET_api_short_links_id",
        "summary": "Get Short Links",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "user": {},
                        "short_link": {
                          "type": "string"
                        },
                        "qr_code": {}
                      },
                      "required": [
                        "user",
                        "short_link",
                        "qr_code"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "PUT_api_short_links_id",
        "summary": "Update Short Links",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "first_message": {
                    "type": "string"
                  },
                  "mobile": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "user": {
                          "type": "object",
                          "properties": {
                            "name": {},
                            "email": {}
                          },
                          "required": [
                            "name",
                            "email"
                          ]
                        },
                        "short_link": {
                          "type": "string"
                        },
                        "qr_code": {}
                      },
                      "required": [
                        "user",
                        "short_link",
                        "qr_code"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/short-links/bulk-delete": {
      "post": {
        "operationId": "POST_api_short_links_bulk_delete",
        "summary": "Bulk Delete · Short Links",
        "tags": [
          "Commerce"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedCount": {},
                        "deletedIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "deletedCount",
                        "deletedIds"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/facebook-leads/capacity": {
      "get": {
        "operationId": "GET_api_facebook_leads_capacity",
        "summary": "Capacity · Facebook Leads",
        "tags": [
          "Channels & Ads"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/facebook-leads/forms": {
      "get": {
        "operationId": "GET_api_facebook_leads_forms",
        "summary": "Forms · Facebook Leads",
        "tags": [
          "Channels & Ads"
        ],
        "parameters": [
          {
            "name": "page_id",
            "in": "query",
            "required": true,
            "description": "Facebook Page ID for the connected Page that owns the lead forms.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "count": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "data": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "success",
                    "count",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/facebook-leads/forms/{id}": {
      "delete": {
        "operationId": "DELETE_api_facebook_leads_forms_id",
        "summary": "Forms · Facebook Leads",
        "tags": [
          "Channels & Ads"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "GET_api_facebook_leads_forms_id",
        "summary": "Forms · Facebook Leads",
        "tags": [
          "Channels & Ads"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/facebook-leads/forms/{id}/leads": {
      "get": {
        "operationId": "GET_api_facebook_leads_forms_id_leads",
        "summary": "Leads · Facebook Leads",
        "tags": [
          "Channels & Ads"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 20
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "currentPage": {
                          "type": "integer"
                        },
                        "totalPages": {
                          "type": "integer"
                        },
                        "totalItems": {
                          "type": "integer"
                        },
                        "itemsPerPage": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "currentPage",
                        "totalPages",
                        "totalItems",
                        "itemsPerPage"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/facebook-leads/forms/{id}/mapping": {
      "put": {
        "operationId": "PUT_api_facebook_leads_forms_id_mapping",
        "summary": "Mapping · Facebook Leads",
        "tags": [
          "Channels & Ads"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "field_mapping": {
                    "anyOf": [
                      {
                        "type": "object"
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  },
                  "send_first_template": {
                    "type": "boolean"
                  },
                  "tag_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  },
                  "template_carousel_cards_data": {
                    "type": "string"
                  },
                  "template_id": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{24}$"
                  },
                  "template_variable_mappings": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "pending_leads_retried": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data",
                    "pending_leads_retried"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "available_fields": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {},
                              "name": {},
                              "label": {},
                              "type": {}
                            },
                            "required": [
                              "id",
                              "name",
                              "label",
                              "type"
                            ]
                          }
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "available_fields"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/facebook-leads/forms/connect": {
      "post": {
        "operationId": "POST_api_facebook_leads_forms_connect",
        "summary": "Connect · Facebook Leads",
        "tags": [
          "Channels & Ads"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "form_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "form_name": {
                    "type": "string"
                  },
                  "page_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "tag_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  }
                },
                "required": [
                  "form_id",
                  "page_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "webhook_subscribed": {
                      "const": false
                    },
                    "subscription_error": {},
                    "sample_payload_available": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "data",
                    "webhook_subscribed",
                    "subscription_error",
                    "sample_payload_available"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/facebook-leads/forms/connected": {
      "get": {
        "operationId": "GET_api_facebook_leads_forms_connected",
        "summary": "Connected · Facebook Leads",
        "tags": [
          "Channels & Ads"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "count": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "data": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "success",
                    "count",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/facebook-leads/forms/create": {
      "post": {
        "operationId": "POST_api_facebook_leads_forms_create",
        "summary": "Create · Facebook Leads",
        "tags": [
          "Channels & Ads"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "follow_up_action_url": {
                    "type": "string"
                  },
                  "form_type": {
                    "type": "string",
                    "default": "MORE_VOLUME"
                  },
                  "intro": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "page_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "privacy_policy_url": {
                    "type": "string",
                    "minLength": 1
                  },
                  "questions": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  }
                },
                "required": [
                  "name",
                  "page_id",
                  "privacy_policy_url"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "meta_response": {},
                    "webhook_subscribed": {
                      "const": false
                    },
                    "subscription_error": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "data",
                    "meta_response",
                    "webhook_subscribed",
                    "subscription_error"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/facebook-leads/pages/{page_id}/subscribe": {
      "post": {
        "operationId": "POST_api_facebook_leads_pages_page_id_subscribe",
        "summary": "Subscribe · Facebook Leads",
        "tags": [
          "Channels & Ads"
        ],
        "parameters": [
          {
            "name": "page_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The page id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "meta_response": {},
                    "previous_subscriptions": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "meta_response",
                    "previous_subscriptions"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        },
                        "meta_error": {}
                      },
                      "required": [
                        "success",
                        "error",
                        "details",
                        "meta_error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ai-automation/generate": {
      "post": {
        "operationId": "POST_api_ai_automation_generate",
        "summary": "Generate · Ai Automation",
        "tags": [
          "AI"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "session_id": {
                    "type": "string"
                  },
                  "wizard_data": {
                    "type": "object"
                  }
                },
                "required": [
                  "wizard_data"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "session_id": {},
                    "flow": {
                      "type": "null"
                    },
                    "error": {
                      "type": "null"
                    }
                  },
                  "required": [
                    "success",
                    "session_id",
                    "flow",
                    "error"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "session_id": {}
                  },
                  "required": [
                    "success",
                    "error",
                    "session_id"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "502": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "session_id": {}
                  },
                  "required": [
                    "success",
                    "error",
                    "session_id"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Other error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ai-automation/save": {
      "post": {
        "operationId": "POST_api_ai_automation_save",
        "summary": "Save · Ai Automation",
        "tags": [
          "AI"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "session_id": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "session_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "flow_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "flow_id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ai-automation/v2/generate": {
      "post": {
        "operationId": "POST_api_ai_automation_v2_generate",
        "summary": "Generate · Ai Automation",
        "tags": [
          "AI"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "extracted_variables": {
                    "type": "object"
                  },
                  "platform_connection_id": {
                    "type": "string"
                  },
                  "session_id": {
                    "type": "string"
                  },
                  "wizard_data": {
                    "type": "object",
                    "properties": {
                      "automation_type": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "automation_type"
                    ]
                  }
                },
                "required": [
                  "wizard_data"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "session_id": {},
                    "flow": {
                      "type": "null"
                    },
                    "template_drafts": {
                      "type": "array",
                      "items": {}
                    },
                    "error": {
                      "type": "null"
                    }
                  },
                  "required": [
                    "success",
                    "session_id",
                    "flow",
                    "template_drafts",
                    "error"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "session_id": {}
                  },
                  "required": [
                    "success",
                    "error",
                    "session_id"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "502": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "session_id": {}
                  },
                  "required": [
                    "success",
                    "error",
                    "session_id"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Other error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ai-automation/v2/refine": {
      "post": {
        "operationId": "POST_api_ai_automation_v2_refine",
        "summary": "Refine · Ai Automation",
        "tags": [
          "AI"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "edit_request": {
                    "type": "string",
                    "minLength": 1
                  },
                  "session_id": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "edit_request",
                  "session_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "flow": {
                      "type": "null"
                    },
                    "changes_made": {
                      "type": "null"
                    },
                    "suggestion": {
                      "type": "null"
                    },
                    "error": {
                      "type": "null"
                    }
                  },
                  "required": [
                    "success",
                    "flow",
                    "changes_made",
                    "suggestion",
                    "error"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "flow": {
                      "type": "null"
                    },
                    "changes_made": {
                      "type": "null"
                    },
                    "suggestion": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "flow",
                    "changes_made",
                    "suggestion",
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Other error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ai-automation/v2/save": {
      "post": {
        "operationId": "POST_api_ai_automation_v2_save",
        "summary": "Save · Ai Automation",
        "tags": [
          "AI"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "session_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "template_drafts": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  }
                },
                "required": [
                  "session_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "flow_id": {
                      "type": "string"
                    },
                    "template_ids": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "success",
                    "flow_id",
                    "template_ids"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "flow_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "flow_id"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ai/delete": {
      "post": {
        "operationId": "POST_api_ai_delete",
        "summary": "Delete · Ai",
        "tags": [
          "AI"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedCount": {},
                        "deletedIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "deletedCount",
                        "deletedIds"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ai/languages": {
      "get": {
        "operationId": "GET_api_ai_languages",
        "summary": "Languages · Ai",
        "tags": [
          "AI"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "languages": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "code": {},
                              "name": {}
                            },
                            "required": [
                              "code",
                              "name"
                            ]
                          }
                        },
                        "totalCount": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "languages",
                        "totalCount"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ai/models": {
      "get": {
        "operationId": "GET_api_ai_models",
        "summary": "Models · Ai",
        "tags": [
          "AI"
        ],
        "parameters": [
          {
            "name": "capability",
            "in": "query",
            "required": false,
            "description": "Filter results by capability.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "is_default",
            "in": "query",
            "required": false,
            "description": "Filter results by is default.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "description": "Filter by connection provider.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "models": {
                          "type": "array",
                          "items": {}
                        },
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "currentPage": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            },
                            "totalItems": {
                              "type": "integer"
                            },
                            "itemsPerPage": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "currentPage",
                            "totalPages",
                            "totalItems",
                            "itemsPerPage"
                          ]
                        }
                      },
                      "required": [
                        "models",
                        "pagination"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_ai_models",
        "summary": "Models · Ai",
        "tags": [
          "AI"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "apiEndpoint": {
                    "type": "string",
                    "minLength": 1
                  },
                  "apiKey": {
                    "type": "string",
                    "format": "password",
                    "writeOnly": true
                  },
                  "apiVersion": {
                    "type": "string"
                  },
                  "capabilities": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "config": {
                    "type": "object"
                  },
                  "description": {
                    "type": "string"
                  },
                  "displayName": {
                    "type": "string",
                    "minLength": 1
                  },
                  "headersTemplate": {
                    "type": "object"
                  },
                  "modelId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "provider": {
                    "type": "string",
                    "minLength": 1
                  },
                  "requestFormat": {
                    "type": "string"
                  },
                  "responsePath": {
                    "type": "string"
                  }
                },
                "required": [
                  "apiEndpoint",
                  "displayName",
                  "modelId",
                  "provider"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ai/models/{id}": {
      "get": {
        "operationId": "GET_api_ai_models_id",
        "summary": "Models · Ai",
        "tags": [
          "AI"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "PUT_api_ai_models_id",
        "summary": "Models · Ai",
        "tags": [
          "AI"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "apiEndpoint": {
                    "type": "string"
                  },
                  "apiKey": {
                    "type": "string",
                    "format": "password",
                    "writeOnly": true
                  },
                  "apiVersion": {
                    "type": "string"
                  },
                  "capabilities": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "config": {
                    "type": "object"
                  },
                  "description": {
                    "type": "string"
                  },
                  "displayName": {
                    "type": "string"
                  },
                  "headersTemplate": {
                    "type": "object"
                  },
                  "modelId": {
                    "type": "string"
                  },
                  "provider": {
                    "type": "string"
                  },
                  "requestFormat": {
                    "type": "string"
                  },
                  "responsePath": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ai/models/{id}/status": {
      "patch": {
        "operationId": "PATCH_api_ai_models_id_status",
        "summary": "Status · Ai",
        "tags": [
          "AI"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "inactive"
                    ]
                  }
                },
                "required": [
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "name": {},
                        "status": {}
                      },
                      "required": [
                        "name",
                        "status"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ai/models/test": {
      "post": {
        "operationId": "POST_api_ai_models_test",
        "summary": "Test · Ai",
        "tags": [
          "AI"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "apiKey": {
                    "type": "string",
                    "format": "password",
                    "writeOnly": true
                  },
                  "modelId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "prompt": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "apiKey",
                  "modelId",
                  "prompt"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "response": {},
                        "model": {},
                        "provider": {}
                      },
                      "required": [
                        "response",
                        "model",
                        "provider"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ai/suggest-reply": {
      "post": {
        "operationId": "POST_api_ai_suggest_reply",
        "summary": "Suggest Reply · Ai",
        "tags": [
          "AI"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "conversation": {
                    "anyOf": [
                      {
                        "type": "object"
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  },
                  "count": {
                    "type": "number",
                    "default": 3
                  },
                  "tone": {
                    "type": "string"
                  }
                },
                "required": [
                  "conversation"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "suggestedReplies": {},
                        "tone": {},
                        "modelUsed": {},
                        "modelId": {},
                        "count": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "suggestedReplies",
                        "tone",
                        "modelUsed",
                        "modelId",
                        "count"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/ai/transform": {
      "post": {
        "operationId": "POST_api_ai_transform",
        "summary": "Transform · Ai",
        "tags": [
          "AI"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "feature": {
                    "type": "string",
                    "minLength": 1
                  },
                  "language": {
                    "type": "string",
                    "minLength": 1
                  },
                  "message": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "feature",
                  "language",
                  "message"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "original": {},
                        "transformed": {},
                        "feature": {},
                        "language": {},
                        "languageName": {},
                        "modelUsed": {},
                        "modelId": {}
                      },
                      "required": [
                        "original",
                        "transformed",
                        "feature",
                        "language",
                        "languageName",
                        "modelUsed",
                        "modelId"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/agent-task/{id}": {
      "get": {
        "operationId": "GET_api_agent_task_id",
        "summary": "Get Agent Task",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/agent-task/{id}/comment": {
      "post": {
        "operationId": "POST_api_agent_task_id_comment",
        "summary": "Comment · Agent Task",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "comment": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Comment text."
                  }
                },
                "required": [
                  "comment"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "task_id": {},
                        "comment": {
                          "type": "object",
                          "properties": {
                            "comment": {},
                            "commented_by": {},
                            "commented_by_role": {}
                          },
                          "required": [
                            "comment",
                            "commented_by",
                            "commented_by_role"
                          ]
                        }
                      },
                      "required": [
                        "task_id",
                        "comment"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/agent-task/{id}/comment/{commentId}": {
      "delete": {
        "operationId": "DELETE_api_agent_task_id_comment_commentId",
        "summary": "Comment · Agent Task",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "commentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The comment id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "task_id": {},
                        "deleted_comment_id": {}
                      },
                      "required": [
                        "task_id",
                        "deleted_comment_id"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "PUT_api_agent_task_id_comment_commentId",
        "summary": "Comment · Agent Task",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "commentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The comment id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "comment": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Comment text."
                  }
                },
                "required": [
                  "comment"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "task_id": {},
                        "comment": {}
                      },
                      "required": [
                        "task_id",
                        "comment"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/agent-task/{id}/update": {
      "put": {
        "operationId": "PUT_api_agent_task_id_update",
        "summary": "Update · Agent Task",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agent_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1
                  },
                  "due_date": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "status": {
                    "type": "string"
                  },
                  "task_priority": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "title",
                  "description",
                  "agent_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/agent-task/{id}/update/status": {
      "put": {
        "operationId": "PUT_api_agent_task_id_update_status",
        "summary": "Status · Agent Task",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {},
                        "status": {}
                      },
                      "required": [
                        "id",
                        "status"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/agent-task/all": {
      "get": {
        "operationId": "GET_api_agent_task_all",
        "summary": "All · Agent Task",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "query",
            "required": false,
            "description": "Filter results by agent ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "tasks": {},
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "currentPage": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            },
                            "totalItems": {
                              "type": "integer"
                            },
                            "itemsPerPage": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "currentPage",
                            "totalPages",
                            "totalItems",
                            "itemsPerPage"
                          ]
                        }
                      },
                      "required": [
                        "tasks",
                        "pagination"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/agent-task/create": {
      "post": {
        "operationId": "POST_api_agent_task_create",
        "summary": "Create · Agent Task",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agent_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1
                  },
                  "due_date": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "status": {
                    "type": "string"
                  },
                  "task_priority": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "title",
                  "description",
                  "agent_id"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/agent-task/delete": {
      "delete": {
        "operationId": "DELETE_api_agent_task_delete",
        "summary": "Delete · Agent Task",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedCount": {},
                        "deletedIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "deletedCount",
                        "deletedIds"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/{id}": {
      "get": {
        "operationId": "GET_api_agent_id",
        "summary": "Get Agent",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/{id}/anonymize": {
      "post": {
        "operationId": "POST_api_agent_id_anonymize",
        "summary": "Anonymize · Agent",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirm": {
                    "const": true
                  }
                },
                "required": [
                  "confirm"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/{id}/funnel-status": {
      "get": {
        "operationId": "GET_api_agent_id_funnel_status",
        "summary": "Funnel Status · Agent",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/{id}/phone-no": {
      "put": {
        "operationId": "PUT_api_agent_id_phone_no",
        "summary": "Phone No · Agent",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "is_phoneno_hide": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "is_phoneno_hide"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {},
                        "is_phoneno_hide": {}
                      },
                      "required": [
                        "id",
                        "is_phoneno_hide"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/{id}/update": {
      "put": {
        "operationId": "PUT_api_agent_id_update",
        "summary": "Update · Agent",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agent_greeting": {
                    "type": "string"
                  },
                  "country_code": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "minLength": 1
                  },
                  "is_phoneno_hide": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "note": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string",
                    "format": "password",
                    "writeOnly": true
                  },
                  "phone": {
                    "type": "string"
                  },
                  "status": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ]
                  },
                  "team_id": {
                    "type": "string"
                  },
                  "workspaces": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  }
                },
                "required": [
                  "name",
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/{id}/update/status": {
      "put": {
        "operationId": "PUT_api_agent_id_update_status",
        "summary": "Status · Agent",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "disposition": {
                    "type": "string"
                  },
                  "status": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ]
                  }
                },
                "required": [
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "id": {},
                            "status": {}
                          },
                          "required": [
                            "id",
                            "status"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "id": {},
                            "status": {
                              "const": false
                            },
                            "state": {},
                            "released": {}
                          },
                          "required": [
                            "id",
                            "status",
                            "state",
                            "released"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "id": {},
                            "status": {
                              "const": true
                            },
                            "active": {}
                          },
                          "required": [
                            "id",
                            "status",
                            "active"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "refused": {},
                            "remediation": {}
                          },
                          "required": [
                            "refused",
                            "remediation"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/all": {
      "get": {
        "operationId": "GET_api_agent_all",
        "summary": "All · Agent",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": false,
            "description": "Workspace ID. You can also send the X-Workspace-ID header.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          },
          {
            "name": "workspace_scoped",
            "in": "query",
            "required": false,
            "description": "Limit agent results to the selected Workspace when true.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Workspace-restricted keys need an authorized Workspace in this header or an accepted Workspace field on the request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "agents": {},
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "currentPage": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            },
                            "totalItems": {
                              "type": "integer"
                            },
                            "itemsPerPage": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "currentPage",
                            "totalPages",
                            "totalItems",
                            "itemsPerPage"
                          ]
                        }
                      },
                      "required": [
                        "agents",
                        "pagination"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/create": {
      "post": {
        "operationId": "POST_api_agent_create",
        "summary": "Create · Agent",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agent_greeting": {
                    "type": "string"
                  },
                  "country_code": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "minLength": 1
                  },
                  "is_phoneno_hide": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "note": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string",
                    "format": "password",
                    "writeOnly": true
                  },
                  "phone": {
                    "type": "string"
                  },
                  "status": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ]
                  },
                  "team_id": {
                    "type": "string"
                  },
                  "workspaces": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    }
                  }
                },
                "required": [
                  "name",
                  "email",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/delete": {
      "delete": {
        "operationId": "DELETE_api_agent_delete",
        "summary": "Delete · Agent",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedCount": {},
                        "deletedIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "deletedCount",
                        "deletedIds"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/funnel/action": {
      "post": {
        "operationId": "POST_api_agent_funnel_action",
        "summary": "Action · Agent",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "actions": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "minItems": 1
                  },
                  "globalItemId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "globalItemId",
                  "actions"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/funnels": {
      "get": {
        "operationId": "GET_api_agent_funnels",
        "summary": "Funnels · Agent",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/teams": {
      "get": {
        "operationId": "GET_api_teams",
        "summary": "List Teams",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "teams": {},
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "currentPage": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            },
                            "totalItems": {
                              "type": "integer"
                            },
                            "itemsPerPage": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "currentPage",
                            "totalPages",
                            "totalItems",
                            "itemsPerPage"
                          ]
                        }
                      },
                      "required": [
                        "teams",
                        "pagination"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/teams/{id}": {
      "get": {
        "operationId": "GET_api_teams_id",
        "summary": "Get Teams",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "permissions": {
                          "type": "array",
                          "items": {}
                        }
                      },
                      "required": [
                        "permissions"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "PUT_api_teams_id",
        "summary": "Update Teams",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "permissions": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "status": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "errors": {}
                      },
                      "required": [
                        "success",
                        "message",
                        "errors"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "unauthorizedPermissions": {
                          "type": "array",
                          "items": {}
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "unauthorizedPermissions"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/teams/{id}/toggle-status": {
      "patch": {
        "operationId": "PATCH_api_teams_id_toggle_status",
        "summary": "Toggle Status · Teams",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/teams/create": {
      "post": {
        "operationId": "POST_api_teams_create",
        "summary": "Create · Teams",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "permissions": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1
                  },
                  "status": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "permissions"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "errors": {}
                      },
                      "required": [
                        "success",
                        "message",
                        "errors"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "unauthorizedPermissions": {
                          "type": "array",
                          "items": {}
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "unauthorizedPermissions"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/teams/delete": {
      "delete": {
        "operationId": "DELETE_api_teams_delete",
        "summary": "Delete · Teams",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedCount": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "deletedIds": {
                          "type": "array",
                          "items": {}
                        }
                      },
                      "required": [
                        "deletedCount",
                        "deletedIds"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/teams/permissions": {
      "get": {
        "operationId": "GET_api_teams_permissions",
        "summary": "Permissions · Teams",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/users": {
      "delete": {
        "operationId": "DELETE_api_users",
        "summary": "Delete Users",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{24}$"
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedCount": {},
                        "deletedIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "deletedCount",
                        "deletedIds"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "GET_api_users",
        "summary": "List Users",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "plan_id",
            "in": "query",
            "required": false,
            "description": "Filter results by plan ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "plan_slug",
            "in": "query",
            "required": false,
            "description": "Filter results by plan slug.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text used to filter results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Field used to sort results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "users": {
                          "type": "array",
                          "items": {}
                        },
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "currentPage": {
                              "type": "integer"
                            },
                            "totalPages": {
                              "type": "integer"
                            },
                            "totalItems": {
                              "type": "integer"
                            },
                            "itemsPerPage": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "currentPage",
                            "totalPages",
                            "totalItems",
                            "itemsPerPage"
                          ]
                        }
                      },
                      "required": [
                        "users",
                        "pagination"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_users",
        "summary": "Create Users",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "country": {
                    "type": "string"
                  },
                  "country_code": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "minLength": 1
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "note": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string",
                    "format": "password",
                    "writeOnly": true
                  },
                  "phone": {
                    "type": "string"
                  },
                  "role_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "email",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "_id": {},
                        "name": {},
                        "email": {},
                        "phone": {},
                        "country": {},
                        "country_code": {},
                        "note": {},
                        "role_id": {},
                        "email_verified": {},
                        "status": {},
                        "storage_limit": {
                          "type": "string"
                        },
                        "storage_used": {
                          "type": "string"
                        },
                        "created_at": {},
                        "updated_at": {}
                      },
                      "required": [
                        "_id",
                        "name",
                        "email",
                        "phone",
                        "country",
                        "country_code",
                        "note",
                        "role_id",
                        "email_verified",
                        "status",
                        "storage_limit",
                        "storage_used",
                        "created_at",
                        "updated_at"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "errors": {}
                      },
                      "required": [
                        "success",
                        "message",
                        "errors"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/users/{id}": {
      "get": {
        "operationId": "GET_api_users_id",
        "summary": "Get Users",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "PUT_api_users_id",
        "summary": "Update Users",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "country": {
                    "type": "string"
                  },
                  "country_code": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "email_verified": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "string"
                  },
                  "note": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "role_id": {
                    "type": "string"
                  },
                  "status": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "1",
                          "0"
                        ]
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ]
                  },
                  "storage_limit": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/users/{id}/send-reset-password-link": {
      "post": {
        "operationId": "POST_api_users_id_send_reset_password_link",
        "summary": "Send Reset Password Link · Users",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message",
                        "error"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces": {
      "get": {
        "operationId": "GET_api_workspaces",
        "summary": "List Workspaces",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "POST_api_workspaces",
        "summary": "Create Workspaces",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{id}": {
      "delete": {
        "operationId": "DELETE_api_workspaces_id",
        "summary": "Delete Workspaces",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "GET_api_workspaces_id",
        "summary": "Get Workspaces",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "PATCH_api_workspaces_id",
        "summary": "Update Workspaces",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string"
                  },
                  "is_active": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{id}/assignment-policy": {
      "get": {
        "operationId": "GET_api_workspaces_id_assignment_policy",
        "summary": "Assignment Policy · Workspaces",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "PATCH_api_workspaces_id_assignment_policy",
        "summary": "Assignment Policy · Workspaces",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "enabled"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{id}/close": {
      "post": {
        "operationId": "POST_api_workspaces_id_close",
        "summary": "Close · Workspaces",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "workspace_id": {},
                        "lifecycle_state": {},
                        "released": {},
                        "components": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {},
                              "status": {},
                              "attempts": {},
                              "confirmed_at": {},
                              "last_error_code": {}
                            },
                            "required": [
                              "name",
                              "status",
                              "attempts",
                              "confirmed_at",
                              "last_error_code"
                            ]
                          }
                        }
                      },
                      "required": [
                        "workspace_id",
                        "lifecycle_state",
                        "released",
                        "components"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Other error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "refused": {},
                    "remediation_options": {}
                  },
                  "required": [
                    "success",
                    "refused",
                    "remediation_options"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{id}/closure-preview": {
      "post": {
        "operationId": "POST_api_workspaces_id_closure_preview",
        "summary": "Closure Preview · Workspaces",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Other error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "refused": {},
                    "remediation_options": {}
                  },
                  "required": [
                    "success",
                    "refused",
                    "remediation_options"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{id}/closure-progress": {
      "get": {
        "operationId": "GET_api_workspaces_id_closure_progress",
        "summary": "Closure Progress · Workspaces",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {}
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "refused": {}
                      },
                      "required": [
                        "success",
                        "refused"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{id}/reopen": {
      "post": {
        "operationId": "POST_api_workspaces_id_reopen",
        "summary": "Reopen · Workspaces",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id in the resource URL."
          },
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "workspace": {}
                      },
                      "required": [
                        "workspace"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Other error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "refused": {},
                    "remediation_options": {}
                  },
                  "required": [
                    "success",
                    "refused",
                    "remediation_options"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/connected": {
      "get": {
        "operationId": "GET_api_workspaces_connected",
        "summary": "Connected · Workspaces",
        "tags": [
          "Workspaces & Team"
        ],
        "parameters": [
          {
            "name": "X-Workspace-ID",
            "in": "header",
            "required": false,
            "description": "Workspace ID. Required for Workspace-restricted keys unless another accepted Workspace input supplies it.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or Workspace context",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or outside the authorized Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "string"
                        },
                        "details": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "error",
                        "details"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "success",
                        "message"
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  }
}
