{
  "openapi": "3.1.0",
  "info": {
    "title": "Heyy API",
    "version": "3.0.0"
  },
  "servers": [
    {
      "url": "https://api.heyy.io/v3"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {},
    "parameters": {}
  },
  "paths": {
    "/workspace": {
      "get": {
        "summary": "Get workspace",
        "description": "Returns the workspace associated with the API key.",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "availability": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "week_day",
                                  "date"
                                ]
                              },
                              "date": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "weekDay": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "sunday"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "monday"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "tuesday"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "wednesday"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "thursday"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "friday"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "saturday"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "intervals": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "from": {
                                      "type": "string"
                                    },
                                    "to": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "from",
                                    "to"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "type",
                              "date",
                              "weekDay",
                              "intervals"
                            ]
                          }
                        },
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "name",
                        "timezone",
                        "availability",
                        "id",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "name": "string",
                    "timezone": "string",
                    "availability": [],
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/users": {
      "get": {
        "summary": "Get users",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "email": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "phoneNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "firstName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "fullName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "profilePicture": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "image",
                                  "video",
                                  "audio",
                                  "document"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "contentType": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string"
                              },
                              "size": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "id",
                              "createdAt",
                              "type",
                              "name",
                              "contentType",
                              "url",
                              "size"
                            ]
                          },
                          "roles": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "ADMIN",
                                "MANAGER",
                                "MEMBER",
                                "PARTNER"
                              ]
                            }
                          },
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          }
                        },
                        "required": [
                          "email",
                          "phoneNumber",
                          "firstName",
                          "lastName",
                          "fullName",
                          "profilePicture",
                          "roles",
                          "id",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": []
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/users/{userId}": {
      "get": {
        "summary": "Get user",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phoneNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "firstName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "fullName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "profilePicture": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "image",
                                "video",
                                "audio",
                                "document"
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "contentType": {
                              "type": "string"
                            },
                            "url": {
                              "type": "string"
                            },
                            "size": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "id",
                            "createdAt",
                            "type",
                            "name",
                            "contentType",
                            "url",
                            "size"
                          ]
                        },
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "ADMIN",
                              "MANAGER",
                              "MEMBER",
                              "PARTNER"
                            ]
                          }
                        },
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "email",
                        "phoneNumber",
                        "firstName",
                        "lastName",
                        "fullName",
                        "profilePicture",
                        "roles",
                        "id",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "email": "string",
                    "phoneNumber": "string",
                    "firstName": "string",
                    "lastName": "string",
                    "fullName": "string",
                    "profilePicture": {
                      "id": "string",
                      "createdAt": "string",
                      "type": "image",
                      "name": "string",
                      "contentType": "string",
                      "url": "string",
                      "size": 0
                    },
                    "roles": [],
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/teams/search": {
      "post": {
        "summary": "Search teams",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Structured filter expression. See [Query syntax](/api-reference/v3/query) for expression functions. Filterable fields: `id`, `createdAt`, `updatedAt`, `name`, `icon`."
                  },
                  "sortBy": {
                    "type": "string",
                    "description": "Sort expression. See [Sort By syntax](/api-reference/v3/sort-by) for expression functions. Sortable fields: `id`, `createdAt`, `updatedAt`, `name`, `icon`."
                  },
                  "search": {
                    "type": "string",
                    "description": "Free-text search by `name`. See [Search](/api-reference/v3/search)."
                  },
                  "pagination": {
                    "type": "object",
                    "properties": {
                      "page": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Zero-based page index. Defaults to 0 when omitted."
                      },
                      "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Rows per page. Defaults to 10 when omitted. Maximum 100."
                      }
                    },
                    "required": [
                      "page",
                      "limit"
                    ],
                    "additionalProperties": false,
                    "description": "Page through results. Defaults to page 0 and limit 10 when omitted. See [Pagination](/api-reference/v3/pagination)."
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "icon": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "users": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id"
                              ]
                            }
                          },
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          }
                        },
                        "required": [
                          "icon",
                          "name",
                          "users",
                          "id",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "limit": {
                          "type": "integer",
                          "maximum": 1000
                        },
                        "total": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "query": {
                      "type": "object",
                      "properties": {
                        "query": {
                          "type": "string"
                        },
                        "sortBy": {
                          "type": "string"
                        },
                        "search": {
                          "type": "string"
                        }
                      }
                    },
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "pagination",
                    "query",
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": [],
                  "pagination": {
                    "page": 0,
                    "limit": 0,
                    "total": 0
                  },
                  "query": {
                    "query": "string",
                    "sortBy": "string",
                    "search": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/teams/{teamId}": {
      "get": {
        "summary": "Get team",
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "icon": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "users": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ]
                          }
                        },
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "icon",
                        "name",
                        "users",
                        "id",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "icon": "string",
                    "name": "string",
                    "users": [],
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Update team",
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "icon": {
                    "type": "string",
                    "format": "emoji"
                  },
                  "name": {
                    "type": "string"
                  },
                  "users": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "icon": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "users": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ]
                          }
                        },
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "icon",
                        "name",
                        "users",
                        "id",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "icon": "string",
                    "name": "string",
                    "users": [],
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete team",
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "notFoundIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "deletedIds",
                        "notFoundIds"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "deletedIds": [],
                    "notFoundIds": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/teams": {
      "post": {
        "summary": "Create team",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "icon": {
                    "type": "string",
                    "format": "emoji"
                  },
                  "name": {
                    "type": "string"
                  },
                  "users": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "required": [
                  "icon",
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "icon": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "users": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ]
                          }
                        },
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "icon",
                        "name",
                        "users",
                        "id",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "icon": "string",
                    "name": "string",
                    "users": [],
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/files/{fileId}": {
      "get": {
        "summary": "Get file",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "image",
                            "video",
                            "audio",
                            "document"
                          ]
                        },
                        "name": {
                          "type": "string"
                        },
                        "contentType": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "size": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "type",
                        "name",
                        "contentType",
                        "url",
                        "size"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "string",
                    "type": "image",
                    "name": "string",
                    "contentType": "string",
                    "url": "string",
                    "size": 0
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/files/{fileId}/public_url": {
      "get": {
        "summary": "Get public file URL",
        "description": "Returns a stable public URL for an uploaded file, creating one if it does not exist yet. Use this URL when referencing the file by URL (for example, in automation template media overrides). The URL does not expire.",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "publicUrl": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "publicUrl"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "publicUrl": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/files": {
      "post": {
        "summary": "Upload file",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "image",
                      "video",
                      "audio",
                      "document"
                    ]
                  },
                  "file": {
                    "type": "string",
                    "description": "File to upload"
                  }
                },
                "required": [
                  "type",
                  "file"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "image",
                            "video",
                            "audio",
                            "document"
                          ]
                        },
                        "name": {
                          "type": "string"
                        },
                        "contentType": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "size": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "type",
                        "name",
                        "contentType",
                        "url",
                        "size"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "string",
                    "type": "image",
                    "name": "string",
                    "contentType": "string",
                    "url": "string",
                    "size": 0
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api_webhooks/search": {
      "post": {
        "summary": "Search API webhooks",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Structured filter expression. See [Query syntax](/api-reference/v3/query) for expression functions. Filterable fields: `id`, `createdAt`, `updatedAt`, `status`, `url`, `events`."
                  },
                  "sortBy": {
                    "type": "string",
                    "description": "Sort expression. See [Sort By syntax](/api-reference/v3/sort-by) for expression functions. Sortable fields: `id`, `createdAt`, `updatedAt`, `status`, `url`, `events`."
                  },
                  "search": {
                    "type": "string",
                    "description": "Free-text search by `url`. See [Search](/api-reference/v3/search)."
                  },
                  "pagination": {
                    "type": "object",
                    "properties": {
                      "page": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Zero-based page index. Defaults to 0 when omitted."
                      },
                      "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Rows per page. Defaults to 10 when omitted. Maximum 100."
                      }
                    },
                    "required": [
                      "page",
                      "limit"
                    ],
                    "additionalProperties": false,
                    "description": "Page through results. Defaults to page 0 and limit 10 when omitted. See [Pagination](/api-reference/v3/pagination)."
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "url": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "inactive"
                            ]
                          },
                          "events": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "whatsapp_message_received",
                                    "whatsapp_message_status",
                                    "message.received",
                                    "message.sent",
                                    "message.updated"
                                  ]
                                },
                                "scopes": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "channel"
                                        ]
                                      },
                                      "ids": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "ids"
                                    ]
                                  }
                                }
                              },
                              "required": [
                                "type",
                                "scopes"
                              ]
                            }
                          },
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          }
                        },
                        "required": [
                          "url",
                          "status",
                          "events",
                          "id",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "limit": {
                          "type": "integer",
                          "maximum": 1000
                        },
                        "total": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "query": {
                      "type": "object",
                      "properties": {
                        "query": {
                          "type": "string"
                        },
                        "sortBy": {
                          "type": "string"
                        },
                        "search": {
                          "type": "string"
                        }
                      }
                    },
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "pagination",
                    "query",
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": [],
                  "pagination": {
                    "page": 0,
                    "limit": 0,
                    "total": 0
                  },
                  "query": {
                    "query": "string",
                    "sortBy": "string",
                    "search": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api_webhooks": {
      "post": {
        "summary": "Create API webhook",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "whatsapp_message_received",
                            "whatsapp_message_status",
                            "message.received",
                            "message.sent",
                            "message.updated"
                          ]
                        },
                        "scopes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "channel"
                                ]
                              },
                              "ids": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "type",
                              "ids"
                            ]
                          }
                        }
                      },
                      "required": [
                        "type",
                        "scopes"
                      ]
                    }
                  }
                },
                "required": [
                  "url",
                  "events"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "inactive"
                          ]
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "whatsapp_message_received",
                                  "whatsapp_message_status",
                                  "message.received",
                                  "message.sent",
                                  "message.updated"
                                ]
                              },
                              "scopes": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "channel"
                                      ]
                                    },
                                    "ids": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "ids"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "type",
                              "scopes"
                            ]
                          }
                        },
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "url",
                        "status",
                        "events",
                        "id",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "url": "string",
                    "status": "active",
                    "events": [],
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api_webhooks/{webhookId}": {
      "put": {
        "summary": "Update API webhook",
        "parameters": [
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "inactive"
                    ]
                  },
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "whatsapp_message_received",
                            "whatsapp_message_status",
                            "message.received",
                            "message.sent",
                            "message.updated"
                          ]
                        },
                        "scopes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "channel"
                                ]
                              },
                              "ids": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "type",
                              "ids"
                            ]
                          }
                        }
                      },
                      "required": [
                        "type",
                        "scopes"
                      ]
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "inactive"
                          ]
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "whatsapp_message_received",
                                  "whatsapp_message_status",
                                  "message.received",
                                  "message.sent",
                                  "message.updated"
                                ]
                              },
                              "scopes": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "channel"
                                      ]
                                    },
                                    "ids": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "ids"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "type",
                              "scopes"
                            ]
                          }
                        },
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "url",
                        "status",
                        "events",
                        "id",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "url": "string",
                    "status": "active",
                    "events": [],
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete API webhook",
        "parameters": [
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "notFoundIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "deletedIds",
                        "notFoundIds"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "deletedIds": [],
                    "notFoundIds": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/attributes/search": {
      "post": {
        "summary": "Search attributes",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Structured filter expression. See [Query syntax](/api-reference/v3/query) for expression functions. Filterable fields: `id`, `createdAt`, `updatedAt`, `name`, `type`, `displayName`, `description`, `visibility`, `details`."
                  },
                  "sortBy": {
                    "type": "string",
                    "description": "Sort expression. See [Sort By syntax](/api-reference/v3/sort-by) for expression functions. Sortable fields: `id`, `createdAt`, `updatedAt`, `name`, `type`, `displayName`, `description`, `visibility`, `details`."
                  },
                  "search": {
                    "type": "string",
                    "description": "Free-text search by `name`. See [Search](/api-reference/v3/search)."
                  },
                  "pagination": {
                    "type": "object",
                    "properties": {
                      "page": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Zero-based page index. Defaults to 0 when omitted."
                      },
                      "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Rows per page. Defaults to 10 when omitted. Maximum 100."
                      }
                    },
                    "required": [
                      "page",
                      "limit"
                    ],
                    "additionalProperties": false,
                    "description": "Page through results. Defaults to page 0 and limit 10 when omitted. See [Pagination](/api-reference/v3/pagination)."
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "text",
                              "number",
                              "single_select",
                              "multi_select",
                              "date",
                              "datetime"
                            ]
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "visibility": {
                            "type": "object",
                            "properties": {
                              "inbox": {
                                "type": "boolean"
                              },
                              "contacts": {
                                "type": "boolean"
                              },
                              "create": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "inbox",
                              "contacts",
                              "create"
                            ]
                          },
                          "details": {
                            "type": "object",
                            "properties": {
                              "options": {
                                "type": [
                                  "array",
                                  "null"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "color": {
                                      "type": "string"
                                    },
                                    "value": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "color",
                                    "value"
                                  ]
                                }
                              }
                            }
                          }
                        },
                        "required": [
                          "id",
                          "createdAt",
                          "updatedAt",
                          "name",
                          "type",
                          "displayName",
                          "description",
                          "visibility",
                          "details"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "limit": {
                          "type": "integer",
                          "maximum": 1000
                        },
                        "total": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "query": {
                      "type": "object",
                      "properties": {
                        "query": {
                          "type": "string"
                        },
                        "sortBy": {
                          "type": "string"
                        },
                        "search": {
                          "type": "string"
                        }
                      }
                    },
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "pagination",
                    "query",
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": [],
                  "pagination": {
                    "page": 0,
                    "limit": 0,
                    "total": 0
                  },
                  "query": {
                    "query": "string",
                    "sortBy": "string",
                    "search": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/attributes/{attributeId}": {
      "get": {
        "summary": "Get attribute",
        "parameters": [
          {
            "name": "attributeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "name": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "text",
                            "number",
                            "single_select",
                            "multi_select",
                            "date",
                            "datetime"
                          ]
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "visibility": {
                          "type": "object",
                          "properties": {
                            "inbox": {
                              "type": "boolean"
                            },
                            "contacts": {
                              "type": "boolean"
                            },
                            "create": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "inbox",
                            "contacts",
                            "create"
                          ]
                        },
                        "details": {
                          "type": "object",
                          "properties": {
                            "options": {
                              "type": [
                                "array",
                                "null"
                              ],
                              "items": {
                                "type": "object",
                                "properties": {
                                  "color": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "color",
                                  "value"
                                ]
                              }
                            }
                          }
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "name",
                        "type",
                        "displayName",
                        "description",
                        "visibility",
                        "details"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "name": "string",
                    "type": "text",
                    "displayName": "string",
                    "description": "string",
                    "visibility": {
                      "inbox": true,
                      "contacts": true,
                      "create": true
                    },
                    "details": {
                      "options": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Update attribute",
        "parameters": [
          {
            "name": "attributeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "type": "string"
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "visibility": {
                    "type": "object",
                    "properties": {
                      "inbox": {
                        "type": "boolean"
                      },
                      "contacts": {
                        "type": "boolean"
                      },
                      "create": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "inbox",
                      "contacts",
                      "create"
                    ],
                    "additionalProperties": false
                  },
                  "details": {
                    "type": "object",
                    "properties": {
                      "options": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "value": {
                              "type": "string"
                            },
                            "color": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "value",
                            "color"
                          ]
                        },
                        "minItems": 1
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "name": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "text",
                            "number",
                            "single_select",
                            "multi_select",
                            "date",
                            "datetime"
                          ]
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "visibility": {
                          "type": "object",
                          "properties": {
                            "inbox": {
                              "type": "boolean"
                            },
                            "contacts": {
                              "type": "boolean"
                            },
                            "create": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "inbox",
                            "contacts",
                            "create"
                          ]
                        },
                        "details": {
                          "type": "object",
                          "properties": {
                            "options": {
                              "type": [
                                "array",
                                "null"
                              ],
                              "items": {
                                "type": "object",
                                "properties": {
                                  "color": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "color",
                                  "value"
                                ]
                              }
                            }
                          }
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "name",
                        "type",
                        "displayName",
                        "description",
                        "visibility",
                        "details"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "name": "string",
                    "type": "text",
                    "displayName": "string",
                    "description": "string",
                    "visibility": {
                      "inbox": true,
                      "contacts": true,
                      "create": true
                    },
                    "details": {
                      "options": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete attribute",
        "parameters": [
          {
            "name": "attributeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "notFoundIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "deletedIds",
                        "notFoundIds"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "deletedIds": [],
                    "notFoundIds": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/attributes": {
      "post": {
        "summary": "Create attribute",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "text",
                      "number",
                      "single_select",
                      "multi_select",
                      "date",
                      "datetime"
                    ]
                  },
                  "displayName": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "visibility": {
                    "type": "object",
                    "properties": {
                      "inbox": {
                        "type": "boolean"
                      },
                      "contacts": {
                        "type": "boolean"
                      },
                      "create": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "inbox",
                      "contacts",
                      "create"
                    ],
                    "additionalProperties": false
                  },
                  "details": {
                    "type": "object",
                    "properties": {
                      "options": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "value": {
                              "type": "string"
                            },
                            "color": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "value",
                            "color"
                          ]
                        },
                        "minItems": 1
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "displayName",
                  "name",
                  "visibility"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "name": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "text",
                            "number",
                            "single_select",
                            "multi_select",
                            "date",
                            "datetime"
                          ]
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "visibility": {
                          "type": "object",
                          "properties": {
                            "inbox": {
                              "type": "boolean"
                            },
                            "contacts": {
                              "type": "boolean"
                            },
                            "create": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "inbox",
                            "contacts",
                            "create"
                          ]
                        },
                        "details": {
                          "type": "object",
                          "properties": {
                            "options": {
                              "type": [
                                "array",
                                "null"
                              ],
                              "items": {
                                "type": "object",
                                "properties": {
                                  "color": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "color",
                                  "value"
                                ]
                              }
                            }
                          }
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "name",
                        "type",
                        "displayName",
                        "description",
                        "visibility",
                        "details"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "name": "string",
                    "type": "text",
                    "displayName": "string",
                    "description": "string",
                    "visibility": {
                      "inbox": true,
                      "contacts": true,
                      "create": true
                    },
                    "details": {
                      "options": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/automations/search": {
      "post": {
        "summary": "Search automations",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Structured filter expression. See [Query syntax](/api-reference/v3/query) for expression functions. Filterable fields: `id`, `createdAt`, `updatedAt`, `name`, `status`, `activeVersionId`, `activeVersionTriggerType`, `activeVersionTriggerParametersChannelId`, `latestVersionTriggerType`, `latestVersionTriggerParametersChannelId`, `latestVersionId`."
                  },
                  "sortBy": {
                    "type": "string",
                    "description": "Sort expression. See [Sort By syntax](/api-reference/v3/sort-by) for expression functions. Sortable fields: `id`, `createdAt`, `updatedAt`, `name`, `status`, `activeVersionId`, `activeVersionTriggerType`, `activeVersionTriggerParametersChannelId`, `latestVersionTriggerType`, `latestVersionTriggerParametersChannelId`, `latestVersionId`."
                  },
                  "search": {
                    "type": "string",
                    "description": "Free-text search by `name`. See [Search](/api-reference/v3/search)."
                  },
                  "pagination": {
                    "type": "object",
                    "properties": {
                      "page": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Zero-based page index. Defaults to 0 when omitted."
                      },
                      "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Rows per page. Defaults to 10 when omitted. Maximum 100."
                      }
                    },
                    "required": [
                      "page",
                      "limit"
                    ],
                    "additionalProperties": false,
                    "description": "Page through results. Defaults to page 0 and limit 10 when omitted. See [Pagination](/api-reference/v3/pagination)."
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "name": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "draft",
                              "active",
                              "paused"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "createdAt",
                          "updatedAt",
                          "name",
                          "status"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "limit": {
                          "type": "integer",
                          "maximum": 1000
                        },
                        "total": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "query": {
                      "type": "object",
                      "properties": {
                        "query": {
                          "type": "string"
                        },
                        "sortBy": {
                          "type": "string"
                        },
                        "search": {
                          "type": "string"
                        }
                      }
                    },
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "pagination",
                    "query",
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": [],
                  "pagination": {
                    "page": 0,
                    "limit": 0,
                    "total": 0
                  },
                  "query": {
                    "query": "string",
                    "sortBy": "string",
                    "search": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/automations/{automationId}": {
      "get": {
        "summary": "Get automation",
        "parameters": [
          {
            "name": "automationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "name": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "active",
                            "paused"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "name",
                        "status"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "name": "string",
                    "status": "draft"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/automations/{automationId}/trigger": {
      "post": {
        "summary": "Trigger automation",
        "parameters": [
          {
            "name": "automationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contactId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "variables": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "scheduledAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "contactId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/automations/{automationId}/pause": {
      "post": {
        "summary": "Pause automation",
        "parameters": [
          {
            "name": "automationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "name": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "active",
                            "paused"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "name",
                        "status"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "name": "string",
                    "status": "draft"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/automations/{automationId}/unpause": {
      "post": {
        "summary": "Unpause automation",
        "parameters": [
          {
            "name": "automationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "name": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "active",
                            "paused"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "name",
                        "status"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "name": "string",
                    "status": "draft"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/campaigns/search": {
      "post": {
        "summary": "Search campaigns",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Structured filter expression. See [Query syntax](/api-reference/v3/query) for expression functions. Filterable fields: `id`, `createdAt`, `updatedAt`, `name`, `automationId`, `groupId`, `scheduledAt`, `recurrence`, `latestExecutionId`, `latestExecutionStatus`."
                  },
                  "sortBy": {
                    "type": "string",
                    "description": "Sort expression. See [Sort By syntax](/api-reference/v3/sort-by) for expression functions. Sortable fields: `id`, `createdAt`, `updatedAt`, `name`, `automationId`, `groupId`, `scheduledAt`, `recurrence`, `latestExecutionId`, `latestExecutionStatus`."
                  },
                  "search": {
                    "type": "string",
                    "description": "Free-text search by `name`. See [Search](/api-reference/v3/search)."
                  },
                  "pagination": {
                    "type": "object",
                    "properties": {
                      "page": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Zero-based page index. Defaults to 0 when omitted."
                      },
                      "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Rows per page. Defaults to 10 when omitted. Maximum 100."
                      }
                    },
                    "required": [
                      "page",
                      "limit"
                    ],
                    "additionalProperties": false,
                    "description": "Page through results. Defaults to page 0 and limit 10 when omitted. See [Pagination](/api-reference/v3/pagination)."
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "automationId": {
                            "type": "string"
                          },
                          "recurrence": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "rules": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "rules"
                            ]
                          },
                          "scheduledAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "variables": {
                            "type": "object",
                            "additionalProperties": {
                              "type": "string"
                            }
                          },
                          "latestExecutionId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "groupId": {
                            "type": "string"
                          },
                          "totalRecipients": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          }
                        },
                        "required": [
                          "name",
                          "automationId",
                          "recurrence",
                          "scheduledAt",
                          "variables",
                          "latestExecutionId",
                          "groupId",
                          "totalRecipients",
                          "id",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "limit": {
                          "type": "integer",
                          "maximum": 1000
                        },
                        "total": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "query": {
                      "type": "object",
                      "properties": {
                        "query": {
                          "type": "string"
                        },
                        "sortBy": {
                          "type": "string"
                        },
                        "search": {
                          "type": "string"
                        }
                      }
                    },
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "pagination",
                    "query",
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": [],
                  "pagination": {
                    "page": 0,
                    "limit": 0,
                    "total": 0
                  },
                  "query": {
                    "query": "string",
                    "sortBy": "string",
                    "search": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/campaigns/{campaignId}": {
      "get": {
        "summary": "Get campaign",
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "automationId": {
                          "type": "string"
                        },
                        "recurrence": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "rules": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "rules"
                          ]
                        },
                        "scheduledAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "variables": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "latestExecutionId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "groupId": {
                          "type": "string"
                        },
                        "totalRecipients": {
                          "type": "number"
                        },
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "name",
                        "automationId",
                        "recurrence",
                        "scheduledAt",
                        "variables",
                        "latestExecutionId",
                        "groupId",
                        "totalRecipients",
                        "id",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "name": "string",
                    "automationId": "string",
                    "recurrence": {
                      "rules": []
                    },
                    "scheduledAt": "string",
                    "variables": {},
                    "latestExecutionId": "string",
                    "groupId": "string",
                    "totalRecipients": 0,
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Update campaign",
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "automationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "variables": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "scheduledAt": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  },
                  "recurrence": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "rules": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "rules"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "automationId": {
                          "type": "string"
                        },
                        "recurrence": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "rules": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "rules"
                          ]
                        },
                        "scheduledAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "variables": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "latestExecutionId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "groupId": {
                          "type": "string"
                        },
                        "totalRecipients": {
                          "type": "number"
                        },
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "name",
                        "automationId",
                        "recurrence",
                        "scheduledAt",
                        "variables",
                        "latestExecutionId",
                        "groupId",
                        "totalRecipients",
                        "id",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "name": "string",
                    "automationId": "string",
                    "recurrence": {
                      "rules": []
                    },
                    "scheduledAt": "string",
                    "variables": {},
                    "latestExecutionId": "string",
                    "groupId": "string",
                    "totalRecipients": 0,
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete campaign",
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "notFoundIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "deletedIds",
                        "notFoundIds"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "deletedIds": [],
                    "notFoundIds": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/campaigns": {
      "post": {
        "summary": "Create campaign",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "automationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "variables": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "scheduledAt": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  },
                  "recurrence": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "rules": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "rules"
                    ]
                  }
                },
                "required": [
                  "name",
                  "automationId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "automationId": {
                          "type": "string"
                        },
                        "recurrence": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "rules": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "rules"
                          ]
                        },
                        "scheduledAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "variables": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "latestExecutionId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "groupId": {
                          "type": "string"
                        },
                        "totalRecipients": {
                          "type": "number"
                        },
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "name",
                        "automationId",
                        "recurrence",
                        "scheduledAt",
                        "variables",
                        "latestExecutionId",
                        "groupId",
                        "totalRecipients",
                        "id",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "name": "string",
                    "automationId": "string",
                    "recurrence": {
                      "rules": []
                    },
                    "scheduledAt": "string",
                    "variables": {},
                    "latestExecutionId": "string",
                    "groupId": "string",
                    "totalRecipients": 0,
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/campaigns/{campaignId}/recipients": {
      "post": {
        "summary": "Add recipients",
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contactIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                },
                "required": [
                  "contactIds"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "contactId": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "phoneNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "email": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isSubscribed": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "contactId",
                          "displayName",
                          "phoneNumber",
                          "email",
                          "isSubscribed"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": []
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Remove recipients",
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contactIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                },
                "required": [
                  "contactIds"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "notFoundIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "deletedIds",
                        "notFoundIds"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "deletedIds": [],
                    "notFoundIds": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/campaigns/{campaignId}/start": {
      "post": {
        "summary": "Start campaign",
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "variables": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "automationId": {
                          "type": "string"
                        },
                        "recurrence": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "rules": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "rules"
                          ]
                        },
                        "scheduledAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "variables": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "latestExecutionId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "groupId": {
                          "type": "string"
                        },
                        "totalRecipients": {
                          "type": "number"
                        },
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "name",
                        "automationId",
                        "recurrence",
                        "scheduledAt",
                        "variables",
                        "latestExecutionId",
                        "groupId",
                        "totalRecipients",
                        "id",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "name": "string",
                    "automationId": "string",
                    "recurrence": {
                      "rules": []
                    },
                    "scheduledAt": "string",
                    "variables": {},
                    "latestExecutionId": "string",
                    "groupId": "string",
                    "totalRecipients": 0,
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/channels/search": {
      "post": {
        "summary": "Search channels",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Structured filter expression. See [Query syntax](/api-reference/v3/query) for expression functions. Filterable fields: `id`, `createdAt`, `updatedAt`, `name`, `type`, `status`, `vendor`, `vendorId`."
                  },
                  "sortBy": {
                    "type": "string",
                    "description": "Sort expression. See [Sort By syntax](/api-reference/v3/sort-by) for expression functions. Sortable fields: `id`, `createdAt`, `updatedAt`, `name`, `type`, `status`, `vendor`, `vendorId`."
                  },
                  "search": {
                    "type": "string",
                    "description": "Free-text search by `name`. See [Search](/api-reference/v3/search)."
                  },
                  "pagination": {
                    "type": "object",
                    "properties": {
                      "page": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Zero-based page index. Defaults to 0 when omitted."
                      },
                      "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Rows per page. Defaults to 10 when omitted. Maximum 100."
                      }
                    },
                    "required": [
                      "page",
                      "limit"
                    ],
                    "additionalProperties": false,
                    "description": "Page through results. Defaults to page 0 and limit 10 when omitted. See [Pagination](/api-reference/v3/pagination)."
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "name": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "whatsapp"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "provisioned",
                                  "active",
                                  "restricted",
                                  "blocked",
                                  "deactivated"
                                ]
                              },
                              "vendor": {
                                "type": "string",
                                "enum": [
                                  "meta",
                                  "bik"
                                ]
                              },
                              "vendorId": {
                                "type": "string"
                              },
                              "vendorDetails": {
                                "type": "object",
                                "properties": {
                                  "vendor": {
                                    "type": "string",
                                    "enum": [
                                      "meta",
                                      "bik"
                                    ]
                                  },
                                  "wabaId": {
                                    "type": "string"
                                  },
                                  "phoneNumberId": {
                                    "type": "string"
                                  },
                                  "phoneNumber": {
                                    "type": "string"
                                  },
                                  "isVerified": {
                                    "type": "boolean"
                                  },
                                  "dailyLimit": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  },
                                  "qualityRating": {
                                    "type": "string",
                                    "enum": [
                                      "flagged",
                                      "high",
                                      "medium",
                                      "low"
                                    ]
                                  },
                                  "displayName": {
                                    "type": "string"
                                  },
                                  "profile": {
                                    "type": "object",
                                    "properties": {
                                      "about": {
                                        "type": "string"
                                      },
                                      "address": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "description": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "email": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "profilePicture": {
                                        "type": [
                                          "object",
                                          "null"
                                        ],
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "createdAt": {
                                            "type": "string"
                                          },
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "image",
                                              "video",
                                              "audio",
                                              "document"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "contentType": {
                                            "type": "string"
                                          },
                                          "url": {
                                            "type": "string"
                                          },
                                          "size": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "createdAt",
                                          "type",
                                          "name",
                                          "contentType",
                                          "url",
                                          "size"
                                        ]
                                      },
                                      "vertical": {
                                        "type": "string",
                                        "enum": [
                                          "undefined",
                                          "other",
                                          "auto",
                                          "beauty",
                                          "apparel",
                                          "edu",
                                          "entertain",
                                          "event_plan",
                                          "finance",
                                          "grocery",
                                          "govt",
                                          "hotel",
                                          "health",
                                          "nonprofit",
                                          "prof_services",
                                          "retail",
                                          "travel",
                                          "restaurant",
                                          "not_a_biz",
                                          "alcohol",
                                          "online_gambling",
                                          "otc_drugs",
                                          "physical_gambling"
                                        ]
                                      },
                                      "websites": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    },
                                    "required": [
                                      "about",
                                      "address",
                                      "description",
                                      "email",
                                      "vertical",
                                      "websites"
                                    ]
                                  }
                                },
                                "required": [
                                  "vendor",
                                  "wabaId",
                                  "phoneNumberId",
                                  "phoneNumber",
                                  "isVerified",
                                  "dailyLimit",
                                  "qualityRating",
                                  "displayName",
                                  "profile"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "createdAt",
                              "updatedAt",
                              "name",
                              "type",
                              "status",
                              "vendor",
                              "vendorId",
                              "vendorDetails"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "name": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "instagram"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "provisioned",
                                  "active",
                                  "restricted",
                                  "blocked",
                                  "deactivated"
                                ]
                              },
                              "vendor": {
                                "type": "string",
                                "enum": [
                                  "meta"
                                ]
                              },
                              "vendorId": {
                                "type": "string"
                              },
                              "vendorDetails": {
                                "type": "object",
                                "properties": {
                                  "vendor": {
                                    "type": "string",
                                    "enum": [
                                      "meta"
                                    ]
                                  },
                                  "pgId": {
                                    "type": "string"
                                  },
                                  "igId": {
                                    "type": "string"
                                  },
                                  "username": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "vendor",
                                  "pgId",
                                  "igId",
                                  "username"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "createdAt",
                              "updatedAt",
                              "name",
                              "type",
                              "status",
                              "vendor",
                              "vendorId",
                              "vendorDetails"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "name": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "sms"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "provisioned",
                                  "active",
                                  "restricted",
                                  "blocked",
                                  "deactivated"
                                ]
                              },
                              "vendor": {
                                "type": "string",
                                "enum": [
                                  "sms019",
                                  "twilio"
                                ]
                              },
                              "vendorId": {
                                "type": "string"
                              },
                              "vendorDetails": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "vendor": {
                                        "type": "string",
                                        "enum": [
                                          "sms019"
                                        ]
                                      },
                                      "senderName": {
                                        "type": "string"
                                      },
                                      "allowInbound": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "vendor",
                                      "senderName",
                                      "allowInbound"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "vendor": {
                                        "type": "string",
                                        "enum": [
                                          "twilio"
                                        ]
                                      },
                                      "accountSid": {
                                        "type": "string"
                                      },
                                      "phoneNumber": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "vendor",
                                      "accountSid",
                                      "phoneNumber"
                                    ]
                                  }
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "createdAt",
                              "updatedAt",
                              "name",
                              "type",
                              "status",
                              "vendor",
                              "vendorId",
                              "vendorDetails"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "name": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "messenger"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "provisioned",
                                  "active",
                                  "restricted",
                                  "blocked",
                                  "deactivated"
                                ]
                              },
                              "vendor": {
                                "type": "string",
                                "enum": [
                                  "meta"
                                ]
                              },
                              "vendorId": {
                                "type": "string"
                              },
                              "vendorDetails": {
                                "type": "object",
                                "properties": {
                                  "vendor": {
                                    "type": "string",
                                    "enum": [
                                      "meta"
                                    ]
                                  },
                                  "pgId": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "vendor",
                                  "pgId",
                                  "name"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "createdAt",
                              "updatedAt",
                              "name",
                              "type",
                              "status",
                              "vendor",
                              "vendorId",
                              "vendorDetails"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "name": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "live_chat"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "provisioned",
                                  "active",
                                  "restricted",
                                  "blocked",
                                  "deactivated"
                                ]
                              },
                              "vendor": {
                                "type": "string",
                                "enum": [
                                  "heyy"
                                ]
                              },
                              "vendorId": {
                                "type": "string"
                              },
                              "vendorDetails": {
                                "type": "object",
                                "properties": {
                                  "vendor": {
                                    "type": "string",
                                    "enum": [
                                      "heyy"
                                    ]
                                  },
                                  "widgetId": {
                                    "type": "string"
                                  },
                                  "security": {
                                    "type": "object",
                                    "properties": {
                                      "allowedDomains": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      },
                                      "secretKeys": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "name": {
                                              "type": "string"
                                            },
                                            "status": {
                                              "type": "string",
                                              "enum": [
                                                "active",
                                                "inactive"
                                              ]
                                            },
                                            "createdAt": {
                                              "type": "string",
                                              "format": "date-time"
                                            },
                                            "key": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "name",
                                            "status",
                                            "createdAt",
                                            "key"
                                          ]
                                        }
                                      }
                                    },
                                    "required": [
                                      "allowedDomains",
                                      "secretKeys"
                                    ]
                                  },
                                  "visibility": {
                                    "type": "object",
                                    "properties": {
                                      "hiddenPaths": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    },
                                    "required": [
                                      "hiddenPaths"
                                    ]
                                  },
                                  "content": {
                                    "type": "object",
                                    "properties": {
                                      "title": {
                                        "type": "string"
                                      },
                                      "messagePlaceholder": {
                                        "type": "string"
                                      },
                                      "initialMessages": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "content": {
                                              "type": "object",
                                              "properties": {
                                                "body": {
                                                  "type": [
                                                    "string",
                                                    "null"
                                                  ]
                                                }
                                              }
                                            }
                                          },
                                          "required": [
                                            "content"
                                          ]
                                        }
                                      },
                                      "suggestedMessages": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      },
                                      "profilePicture": {
                                        "type": [
                                          "object",
                                          "null"
                                        ],
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "createdAt": {
                                            "type": "string"
                                          },
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "image",
                                              "video",
                                              "audio",
                                              "document"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "contentType": {
                                            "type": "string"
                                          },
                                          "url": {
                                            "type": "string"
                                          },
                                          "size": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "createdAt",
                                          "type",
                                          "name",
                                          "contentType",
                                          "url",
                                          "size"
                                        ]
                                      },
                                      "removePoweredBy": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "title",
                                      "messagePlaceholder",
                                      "initialMessages",
                                      "suggestedMessages",
                                      "removePoweredBy"
                                    ]
                                  },
                                  "style": {
                                    "type": "object",
                                    "properties": {
                                      "theme": {
                                        "type": "string",
                                        "enum": [
                                          "light",
                                          "dark"
                                        ]
                                      },
                                      "primaryColor": {
                                        "type": "string"
                                      },
                                      "align": {
                                        "type": "string",
                                        "enum": [
                                          "left",
                                          "right"
                                        ]
                                      },
                                      "direction": {
                                        "type": "string",
                                        "enum": [
                                          "ltr",
                                          "rtl"
                                        ]
                                      },
                                      "positionX": {
                                        "type": "number"
                                      },
                                      "positionY": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "theme",
                                      "primaryColor",
                                      "align",
                                      "direction",
                                      "positionX",
                                      "positionY"
                                    ]
                                  }
                                },
                                "required": [
                                  "vendor",
                                  "widgetId",
                                  "security",
                                  "visibility",
                                  "content",
                                  "style"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "createdAt",
                              "updatedAt",
                              "name",
                              "type",
                              "status",
                              "vendor",
                              "vendorId",
                              "vendorDetails"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "limit": {
                          "type": "integer",
                          "maximum": 1000
                        },
                        "total": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "query": {
                      "type": "object",
                      "properties": {
                        "query": {
                          "type": "string"
                        },
                        "sortBy": {
                          "type": "string"
                        },
                        "search": {
                          "type": "string"
                        }
                      }
                    },
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "pagination",
                    "query",
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": [],
                  "pagination": {
                    "page": 0,
                    "limit": 0,
                    "total": 0
                  },
                  "query": {
                    "query": "string",
                    "sortBy": "string",
                    "search": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/channels/{channelId}": {
      "get": {
        "summary": "Get channel",
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "name": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "whatsapp"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "provisioned",
                                "active",
                                "restricted",
                                "blocked",
                                "deactivated"
                              ]
                            },
                            "vendor": {
                              "type": "string",
                              "enum": [
                                "meta",
                                "bik"
                              ]
                            },
                            "vendorId": {
                              "type": "string"
                            },
                            "vendorDetails": {
                              "type": "object",
                              "properties": {
                                "vendor": {
                                  "type": "string",
                                  "enum": [
                                    "meta",
                                    "bik"
                                  ]
                                },
                                "wabaId": {
                                  "type": "string"
                                },
                                "phoneNumberId": {
                                  "type": "string"
                                },
                                "phoneNumber": {
                                  "type": "string"
                                },
                                "isVerified": {
                                  "type": "boolean"
                                },
                                "dailyLimit": {
                                  "type": [
                                    "number",
                                    "null"
                                  ]
                                },
                                "qualityRating": {
                                  "type": "string",
                                  "enum": [
                                    "flagged",
                                    "high",
                                    "medium",
                                    "low"
                                  ]
                                },
                                "displayName": {
                                  "type": "string"
                                },
                                "profile": {
                                  "type": "object",
                                  "properties": {
                                    "about": {
                                      "type": "string"
                                    },
                                    "address": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "description": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "email": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "profilePicture": {
                                      "type": [
                                        "object",
                                        "null"
                                      ],
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "createdAt": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string",
                                          "enum": [
                                            "image",
                                            "video",
                                            "audio",
                                            "document"
                                          ]
                                        },
                                        "name": {
                                          "type": "string"
                                        },
                                        "contentType": {
                                          "type": "string"
                                        },
                                        "url": {
                                          "type": "string"
                                        },
                                        "size": {
                                          "type": "number"
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "createdAt",
                                        "type",
                                        "name",
                                        "contentType",
                                        "url",
                                        "size"
                                      ]
                                    },
                                    "vertical": {
                                      "type": "string",
                                      "enum": [
                                        "undefined",
                                        "other",
                                        "auto",
                                        "beauty",
                                        "apparel",
                                        "edu",
                                        "entertain",
                                        "event_plan",
                                        "finance",
                                        "grocery",
                                        "govt",
                                        "hotel",
                                        "health",
                                        "nonprofit",
                                        "prof_services",
                                        "retail",
                                        "travel",
                                        "restaurant",
                                        "not_a_biz",
                                        "alcohol",
                                        "online_gambling",
                                        "otc_drugs",
                                        "physical_gambling"
                                      ]
                                    },
                                    "websites": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "required": [
                                    "about",
                                    "address",
                                    "description",
                                    "email",
                                    "vertical",
                                    "websites"
                                  ]
                                }
                              },
                              "required": [
                                "vendor",
                                "wabaId",
                                "phoneNumberId",
                                "phoneNumber",
                                "isVerified",
                                "dailyLimit",
                                "qualityRating",
                                "displayName",
                                "profile"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "createdAt",
                            "updatedAt",
                            "name",
                            "type",
                            "status",
                            "vendor",
                            "vendorId",
                            "vendorDetails"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "name": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "instagram"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "provisioned",
                                "active",
                                "restricted",
                                "blocked",
                                "deactivated"
                              ]
                            },
                            "vendor": {
                              "type": "string",
                              "enum": [
                                "meta"
                              ]
                            },
                            "vendorId": {
                              "type": "string"
                            },
                            "vendorDetails": {
                              "type": "object",
                              "properties": {
                                "vendor": {
                                  "type": "string",
                                  "enum": [
                                    "meta"
                                  ]
                                },
                                "pgId": {
                                  "type": "string"
                                },
                                "igId": {
                                  "type": "string"
                                },
                                "username": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "vendor",
                                "pgId",
                                "igId",
                                "username"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "createdAt",
                            "updatedAt",
                            "name",
                            "type",
                            "status",
                            "vendor",
                            "vendorId",
                            "vendorDetails"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "name": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "sms"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "provisioned",
                                "active",
                                "restricted",
                                "blocked",
                                "deactivated"
                              ]
                            },
                            "vendor": {
                              "type": "string",
                              "enum": [
                                "sms019",
                                "twilio"
                              ]
                            },
                            "vendorId": {
                              "type": "string"
                            },
                            "vendorDetails": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "vendor": {
                                      "type": "string",
                                      "enum": [
                                        "sms019"
                                      ]
                                    },
                                    "senderName": {
                                      "type": "string"
                                    },
                                    "allowInbound": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "vendor",
                                    "senderName",
                                    "allowInbound"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "vendor": {
                                      "type": "string",
                                      "enum": [
                                        "twilio"
                                      ]
                                    },
                                    "accountSid": {
                                      "type": "string"
                                    },
                                    "phoneNumber": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "vendor",
                                    "accountSid",
                                    "phoneNumber"
                                  ]
                                }
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "createdAt",
                            "updatedAt",
                            "name",
                            "type",
                            "status",
                            "vendor",
                            "vendorId",
                            "vendorDetails"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "name": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "messenger"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "provisioned",
                                "active",
                                "restricted",
                                "blocked",
                                "deactivated"
                              ]
                            },
                            "vendor": {
                              "type": "string",
                              "enum": [
                                "meta"
                              ]
                            },
                            "vendorId": {
                              "type": "string"
                            },
                            "vendorDetails": {
                              "type": "object",
                              "properties": {
                                "vendor": {
                                  "type": "string",
                                  "enum": [
                                    "meta"
                                  ]
                                },
                                "pgId": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "vendor",
                                "pgId",
                                "name"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "createdAt",
                            "updatedAt",
                            "name",
                            "type",
                            "status",
                            "vendor",
                            "vendorId",
                            "vendorDetails"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "name": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "live_chat"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "provisioned",
                                "active",
                                "restricted",
                                "blocked",
                                "deactivated"
                              ]
                            },
                            "vendor": {
                              "type": "string",
                              "enum": [
                                "heyy"
                              ]
                            },
                            "vendorId": {
                              "type": "string"
                            },
                            "vendorDetails": {
                              "type": "object",
                              "properties": {
                                "vendor": {
                                  "type": "string",
                                  "enum": [
                                    "heyy"
                                  ]
                                },
                                "widgetId": {
                                  "type": "string"
                                },
                                "security": {
                                  "type": "object",
                                  "properties": {
                                    "allowedDomains": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "secretKeys": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "name": {
                                            "type": "string"
                                          },
                                          "status": {
                                            "type": "string",
                                            "enum": [
                                              "active",
                                              "inactive"
                                            ]
                                          },
                                          "createdAt": {
                                            "type": "string",
                                            "format": "date-time"
                                          },
                                          "key": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "name",
                                          "status",
                                          "createdAt",
                                          "key"
                                        ]
                                      }
                                    }
                                  },
                                  "required": [
                                    "allowedDomains",
                                    "secretKeys"
                                  ]
                                },
                                "visibility": {
                                  "type": "object",
                                  "properties": {
                                    "hiddenPaths": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "required": [
                                    "hiddenPaths"
                                  ]
                                },
                                "content": {
                                  "type": "object",
                                  "properties": {
                                    "title": {
                                      "type": "string"
                                    },
                                    "messagePlaceholder": {
                                      "type": "string"
                                    },
                                    "initialMessages": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "content": {
                                            "type": "object",
                                            "properties": {
                                              "body": {
                                                "type": [
                                                  "string",
                                                  "null"
                                                ]
                                              }
                                            }
                                          }
                                        },
                                        "required": [
                                          "content"
                                        ]
                                      }
                                    },
                                    "suggestedMessages": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "profilePicture": {
                                      "type": [
                                        "object",
                                        "null"
                                      ],
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "createdAt": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string",
                                          "enum": [
                                            "image",
                                            "video",
                                            "audio",
                                            "document"
                                          ]
                                        },
                                        "name": {
                                          "type": "string"
                                        },
                                        "contentType": {
                                          "type": "string"
                                        },
                                        "url": {
                                          "type": "string"
                                        },
                                        "size": {
                                          "type": "number"
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "createdAt",
                                        "type",
                                        "name",
                                        "contentType",
                                        "url",
                                        "size"
                                      ]
                                    },
                                    "removePoweredBy": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "title",
                                    "messagePlaceholder",
                                    "initialMessages",
                                    "suggestedMessages",
                                    "removePoweredBy"
                                  ]
                                },
                                "style": {
                                  "type": "object",
                                  "properties": {
                                    "theme": {
                                      "type": "string",
                                      "enum": [
                                        "light",
                                        "dark"
                                      ]
                                    },
                                    "primaryColor": {
                                      "type": "string"
                                    },
                                    "align": {
                                      "type": "string",
                                      "enum": [
                                        "left",
                                        "right"
                                      ]
                                    },
                                    "direction": {
                                      "type": "string",
                                      "enum": [
                                        "ltr",
                                        "rtl"
                                      ]
                                    },
                                    "positionX": {
                                      "type": "number"
                                    },
                                    "positionY": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "theme",
                                    "primaryColor",
                                    "align",
                                    "direction",
                                    "positionX",
                                    "positionY"
                                  ]
                                }
                              },
                              "required": [
                                "vendor",
                                "widgetId",
                                "security",
                                "visibility",
                                "content",
                                "style"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "createdAt",
                            "updatedAt",
                            "name",
                            "type",
                            "status",
                            "vendor",
                            "vendorId",
                            "vendorDetails"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "name": "string",
                    "type": "whatsapp",
                    "status": "provisioned",
                    "vendor": "meta",
                    "vendorId": "string",
                    "vendorDetails": {
                      "vendor": "meta",
                      "wabaId": "string",
                      "phoneNumberId": "string",
                      "phoneNumber": "string",
                      "isVerified": true,
                      "dailyLimit": 0,
                      "qualityRating": "flagged",
                      "displayName": "string",
                      "profile": {
                        "about": "string",
                        "address": "string",
                        "description": "string",
                        "email": "string",
                        "profilePicture": {
                          "id": "string",
                          "createdAt": "string",
                          "type": "image",
                          "name": "string",
                          "contentType": "string",
                          "url": "string",
                          "size": 0
                        },
                        "vertical": "undefined",
                        "websites": []
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/chats/search": {
      "post": {
        "summary": "Search chats",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Structured filter expression. See [Query syntax](/api-reference/v3/query) for expression functions. Filterable fields: `id`, `createdAt`, `updatedAt`, `handleId`, `contactId`, `status`, `isUnread`, `unreadCount`, `assignedUserId`, `assignedTeamId`, `latestMessage`, `channelId`, `latestMessageTimestamp`, `contactFirstName`, `contactLastName`, `contactIsSubscribed`, `contactLabels`, `contactPhoneNumber`, `contactEmail`, `handleValue`, `isSensitive`. Filter custom contact attributes with `getBy('attributes', 'name', 'your_attribute_name')` or `getBy('attributes', 'id', 'attribute-id')`."
                  },
                  "sortBy": {
                    "type": "string",
                    "description": "Sort expression. See [Sort By syntax](/api-reference/v3/sort-by) for expression functions. Sortable fields: `id`, `createdAt`, `updatedAt`, `handleId`, `contactId`, `status`, `isUnread`, `unreadCount`, `assignedUserId`, `assignedTeamId`, `latestMessage`, `channelId`, `latestMessageTimestamp`, `contactFirstName`, `contactLastName`, `contactIsSubscribed`, `contactLabels`, `contactPhoneNumber`, `contactEmail`, `handleValue`, `isSensitive`. Sort custom contact attributes with `getBy('attributes', 'name', 'your_attribute_name')` or `getBy('attributes', 'id', 'attribute-id')`."
                  },
                  "search": {
                    "type": "string",
                    "description": "Free-text search by contact full name (`firstName` and `lastName` combined with a space), phone number, or email. See [Search](/api-reference/v3/search)."
                  },
                  "pagination": {
                    "type": "object",
                    "properties": {
                      "page": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Zero-based page index. Defaults to 0 when omitted."
                      },
                      "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Rows per page. Defaults to 10 when omitted. Maximum 100."
                      }
                    },
                    "required": [
                      "page",
                      "limit"
                    ],
                    "additionalProperties": false,
                    "description": "Page through results. Defaults to page 0 and limit 10 when omitted. See [Pagination](/api-reference/v3/pagination)."
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "open",
                              "closed",
                              "snoozed"
                            ]
                          },
                          "isUnread": {
                            "type": "boolean"
                          },
                          "openUntil": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "unreadCount": {
                            "type": "number"
                          },
                          "channelId": {
                            "type": "string"
                          },
                          "contactId": {
                            "type": "string"
                          },
                          "handleId": {
                            "type": "string"
                          },
                          "latestMessage": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "vendorId": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "sender": {
                                "type": "string",
                                "enum": [
                                  "outbound",
                                  "inbound",
                                  "unknown",
                                  "system"
                                ]
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "text",
                                  "media",
                                  "audio",
                                  "location",
                                  "contact",
                                  "auth"
                                ]
                              },
                              "timestamp": {
                                "type": "string"
                              },
                              "text": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "vendorId",
                              "sender",
                              "type",
                              "timestamp",
                              "text"
                            ]
                          },
                          "assignedUserId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "assignedTeamId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isSensitive": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "createdAt",
                          "updatedAt",
                          "status",
                          "isUnread",
                          "openUntil",
                          "unreadCount",
                          "channelId",
                          "contactId",
                          "handleId",
                          "latestMessage",
                          "assignedUserId",
                          "assignedTeamId",
                          "isSensitive"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "limit": {
                          "type": "integer",
                          "maximum": 1000
                        },
                        "total": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "query": {
                      "type": "object",
                      "properties": {
                        "query": {
                          "type": "string"
                        },
                        "sortBy": {
                          "type": "string"
                        },
                        "search": {
                          "type": "string"
                        }
                      }
                    },
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "pagination",
                    "query",
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": [],
                  "pagination": {
                    "page": 0,
                    "limit": 0,
                    "total": 0
                  },
                  "query": {
                    "query": "string",
                    "sortBy": "string",
                    "search": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/chats/{chatId}": {
      "get": {
        "summary": "Get chat",
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "open",
                            "closed",
                            "snoozed"
                          ]
                        },
                        "isUnread": {
                          "type": "boolean"
                        },
                        "openUntil": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "unreadCount": {
                          "type": "number"
                        },
                        "channelId": {
                          "type": "string"
                        },
                        "contactId": {
                          "type": "string"
                        },
                        "handleId": {
                          "type": "string"
                        },
                        "latestMessage": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "vendorId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "sender": {
                              "type": "string",
                              "enum": [
                                "outbound",
                                "inbound",
                                "unknown",
                                "system"
                              ]
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "text",
                                "media",
                                "audio",
                                "location",
                                "contact",
                                "auth"
                              ]
                            },
                            "timestamp": {
                              "type": "string"
                            },
                            "text": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "vendorId",
                            "sender",
                            "type",
                            "timestamp",
                            "text"
                          ]
                        },
                        "assignedUserId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "assignedTeamId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isSensitive": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "status",
                        "isUnread",
                        "openUntil",
                        "unreadCount",
                        "channelId",
                        "contactId",
                        "handleId",
                        "latestMessage",
                        "assignedUserId",
                        "assignedTeamId",
                        "isSensitive"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "status": "open",
                    "isUnread": true,
                    "openUntil": "string",
                    "unreadCount": 0,
                    "channelId": "string",
                    "contactId": "string",
                    "contact": {
                      "id": "string",
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z",
                      "firstName": "string",
                      "lastName": "string",
                      "fullName": "string",
                      "isSubscribed": true,
                      "handles": [],
                      "labels": [],
                      "attributes": [],
                      "displayName": "string",
                      "phoneNumber": "string",
                      "email": "string",
                      "chats": [],
                      "metadata": {}
                    },
                    "handleId": "string",
                    "handle": {
                      "id": "string",
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z",
                      "type": "phone_number",
                      "isPrimary": true,
                      "value": "string",
                      "extra": {},
                      "hasChats": true
                    },
                    "latestMessage": {
                      "id": "string",
                      "vendorId": "string",
                      "sender": "outbound",
                      "type": "text",
                      "timestamp": "string",
                      "text": "string"
                    },
                    "assignedUserId": "string",
                    "assignedTeamId": "string",
                    "isSensitive": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete chat",
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "notFoundIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "deletedIds",
                        "notFoundIds"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "deletedIds": [],
                    "notFoundIds": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/chats/{chatId}/mark_as_read": {
      "post": {
        "summary": "Mark chat as read",
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "open",
                            "closed",
                            "snoozed"
                          ]
                        },
                        "isUnread": {
                          "type": "boolean"
                        },
                        "openUntil": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "unreadCount": {
                          "type": "number"
                        },
                        "channelId": {
                          "type": "string"
                        },
                        "contactId": {
                          "type": "string"
                        },
                        "handleId": {
                          "type": "string"
                        },
                        "latestMessage": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "vendorId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "sender": {
                              "type": "string",
                              "enum": [
                                "outbound",
                                "inbound",
                                "unknown",
                                "system"
                              ]
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "text",
                                "media",
                                "audio",
                                "location",
                                "contact",
                                "auth"
                              ]
                            },
                            "timestamp": {
                              "type": "string"
                            },
                            "text": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "vendorId",
                            "sender",
                            "type",
                            "timestamp",
                            "text"
                          ]
                        },
                        "assignedUserId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "assignedTeamId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isSensitive": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "status",
                        "isUnread",
                        "openUntil",
                        "unreadCount",
                        "channelId",
                        "contactId",
                        "handleId",
                        "latestMessage",
                        "assignedUserId",
                        "assignedTeamId",
                        "isSensitive"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "status": "open",
                    "isUnread": true,
                    "openUntil": "string",
                    "unreadCount": 0,
                    "channelId": "string",
                    "contactId": "string",
                    "contact": {
                      "id": "string",
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z",
                      "firstName": "string",
                      "lastName": "string",
                      "fullName": "string",
                      "isSubscribed": true,
                      "handles": [],
                      "labels": [],
                      "attributes": [],
                      "displayName": "string",
                      "phoneNumber": "string",
                      "email": "string",
                      "chats": [],
                      "metadata": {}
                    },
                    "handleId": "string",
                    "handle": {
                      "id": "string",
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z",
                      "type": "phone_number",
                      "isPrimary": true,
                      "value": "string",
                      "extra": {},
                      "hasChats": true
                    },
                    "latestMessage": {
                      "id": "string",
                      "vendorId": "string",
                      "sender": "outbound",
                      "type": "text",
                      "timestamp": "string",
                      "text": "string"
                    },
                    "assignedUserId": "string",
                    "assignedTeamId": "string",
                    "isSensitive": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/chats/{chatId}/mark_as_unread": {
      "post": {
        "summary": "Mark chat as unread",
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "open",
                            "closed",
                            "snoozed"
                          ]
                        },
                        "isUnread": {
                          "type": "boolean"
                        },
                        "openUntil": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "unreadCount": {
                          "type": "number"
                        },
                        "channelId": {
                          "type": "string"
                        },
                        "contactId": {
                          "type": "string"
                        },
                        "handleId": {
                          "type": "string"
                        },
                        "latestMessage": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "vendorId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "sender": {
                              "type": "string",
                              "enum": [
                                "outbound",
                                "inbound",
                                "unknown",
                                "system"
                              ]
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "text",
                                "media",
                                "audio",
                                "location",
                                "contact",
                                "auth"
                              ]
                            },
                            "timestamp": {
                              "type": "string"
                            },
                            "text": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "vendorId",
                            "sender",
                            "type",
                            "timestamp",
                            "text"
                          ]
                        },
                        "assignedUserId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "assignedTeamId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isSensitive": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "status",
                        "isUnread",
                        "openUntil",
                        "unreadCount",
                        "channelId",
                        "contactId",
                        "handleId",
                        "latestMessage",
                        "assignedUserId",
                        "assignedTeamId",
                        "isSensitive"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "status": "open",
                    "isUnread": true,
                    "openUntil": "string",
                    "unreadCount": 0,
                    "channelId": "string",
                    "contactId": "string",
                    "contact": {
                      "id": "string",
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z",
                      "firstName": "string",
                      "lastName": "string",
                      "fullName": "string",
                      "isSubscribed": true,
                      "handles": [],
                      "labels": [],
                      "attributes": [],
                      "displayName": "string",
                      "phoneNumber": "string",
                      "email": "string",
                      "chats": [],
                      "metadata": {}
                    },
                    "handleId": "string",
                    "handle": {
                      "id": "string",
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z",
                      "type": "phone_number",
                      "isPrimary": true,
                      "value": "string",
                      "extra": {},
                      "hasChats": true
                    },
                    "latestMessage": {
                      "id": "string",
                      "vendorId": "string",
                      "sender": "outbound",
                      "type": "text",
                      "timestamp": "string",
                      "text": "string"
                    },
                    "assignedUserId": "string",
                    "assignedTeamId": "string",
                    "isSensitive": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/chats/{chatId}/status": {
      "post": {
        "summary": "Change chat status",
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "open",
                      "closed",
                      "snoozed"
                    ]
                  },
                  "triggerAutomations": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "open",
                            "closed",
                            "snoozed"
                          ]
                        },
                        "isUnread": {
                          "type": "boolean"
                        },
                        "openUntil": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "unreadCount": {
                          "type": "number"
                        },
                        "channelId": {
                          "type": "string"
                        },
                        "contactId": {
                          "type": "string"
                        },
                        "handleId": {
                          "type": "string"
                        },
                        "latestMessage": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "vendorId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "sender": {
                              "type": "string",
                              "enum": [
                                "outbound",
                                "inbound",
                                "unknown",
                                "system"
                              ]
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "text",
                                "media",
                                "audio",
                                "location",
                                "contact",
                                "auth"
                              ]
                            },
                            "timestamp": {
                              "type": "string"
                            },
                            "text": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "vendorId",
                            "sender",
                            "type",
                            "timestamp",
                            "text"
                          ]
                        },
                        "assignedUserId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "assignedTeamId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isSensitive": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "status",
                        "isUnread",
                        "openUntil",
                        "unreadCount",
                        "channelId",
                        "contactId",
                        "handleId",
                        "latestMessage",
                        "assignedUserId",
                        "assignedTeamId",
                        "isSensitive"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "status": "open",
                    "isUnread": true,
                    "openUntil": "string",
                    "unreadCount": 0,
                    "channelId": "string",
                    "contactId": "string",
                    "contact": {
                      "id": "string",
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z",
                      "firstName": "string",
                      "lastName": "string",
                      "fullName": "string",
                      "isSubscribed": true,
                      "handles": [],
                      "labels": [],
                      "attributes": [],
                      "displayName": "string",
                      "phoneNumber": "string",
                      "email": "string",
                      "chats": [],
                      "metadata": {}
                    },
                    "handleId": "string",
                    "handle": {
                      "id": "string",
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z",
                      "type": "phone_number",
                      "isPrimary": true,
                      "value": "string",
                      "extra": {},
                      "hasChats": true
                    },
                    "latestMessage": {
                      "id": "string",
                      "vendorId": "string",
                      "sender": "outbound",
                      "type": "text",
                      "timestamp": "string",
                      "text": "string"
                    },
                    "assignedUserId": "string",
                    "assignedTeamId": "string",
                    "isSensitive": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/chats/{chatId}/assign_user": {
      "post": {
        "summary": "Assign chat to user",
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "triggerAutomations": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "userId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "open",
                            "closed",
                            "snoozed"
                          ]
                        },
                        "isUnread": {
                          "type": "boolean"
                        },
                        "openUntil": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "unreadCount": {
                          "type": "number"
                        },
                        "channelId": {
                          "type": "string"
                        },
                        "contactId": {
                          "type": "string"
                        },
                        "handleId": {
                          "type": "string"
                        },
                        "latestMessage": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "vendorId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "sender": {
                              "type": "string",
                              "enum": [
                                "outbound",
                                "inbound",
                                "unknown",
                                "system"
                              ]
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "text",
                                "media",
                                "audio",
                                "location",
                                "contact",
                                "auth"
                              ]
                            },
                            "timestamp": {
                              "type": "string"
                            },
                            "text": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "vendorId",
                            "sender",
                            "type",
                            "timestamp",
                            "text"
                          ]
                        },
                        "assignedUserId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "assignedTeamId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isSensitive": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "status",
                        "isUnread",
                        "openUntil",
                        "unreadCount",
                        "channelId",
                        "contactId",
                        "handleId",
                        "latestMessage",
                        "assignedUserId",
                        "assignedTeamId",
                        "isSensitive"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "status": "open",
                    "isUnread": true,
                    "openUntil": "string",
                    "unreadCount": 0,
                    "channelId": "string",
                    "contactId": "string",
                    "contact": {
                      "id": "string",
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z",
                      "firstName": "string",
                      "lastName": "string",
                      "fullName": "string",
                      "isSubscribed": true,
                      "handles": [],
                      "labels": [],
                      "attributes": [],
                      "displayName": "string",
                      "phoneNumber": "string",
                      "email": "string",
                      "chats": [],
                      "metadata": {}
                    },
                    "handleId": "string",
                    "handle": {
                      "id": "string",
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z",
                      "type": "phone_number",
                      "isPrimary": true,
                      "value": "string",
                      "extra": {},
                      "hasChats": true
                    },
                    "latestMessage": {
                      "id": "string",
                      "vendorId": "string",
                      "sender": "outbound",
                      "type": "text",
                      "timestamp": "string",
                      "text": "string"
                    },
                    "assignedUserId": "string",
                    "assignedTeamId": "string",
                    "isSensitive": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/chats/{chatId}/assign_team": {
      "post": {
        "summary": "Assign chat to team",
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "teamId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "triggerAutomations": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "teamId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "open",
                            "closed",
                            "snoozed"
                          ]
                        },
                        "isUnread": {
                          "type": "boolean"
                        },
                        "openUntil": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "unreadCount": {
                          "type": "number"
                        },
                        "channelId": {
                          "type": "string"
                        },
                        "contactId": {
                          "type": "string"
                        },
                        "handleId": {
                          "type": "string"
                        },
                        "latestMessage": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "vendorId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "sender": {
                              "type": "string",
                              "enum": [
                                "outbound",
                                "inbound",
                                "unknown",
                                "system"
                              ]
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "text",
                                "media",
                                "audio",
                                "location",
                                "contact",
                                "auth"
                              ]
                            },
                            "timestamp": {
                              "type": "string"
                            },
                            "text": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "vendorId",
                            "sender",
                            "type",
                            "timestamp",
                            "text"
                          ]
                        },
                        "assignedUserId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "assignedTeamId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isSensitive": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "status",
                        "isUnread",
                        "openUntil",
                        "unreadCount",
                        "channelId",
                        "contactId",
                        "handleId",
                        "latestMessage",
                        "assignedUserId",
                        "assignedTeamId",
                        "isSensitive"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "status": "open",
                    "isUnread": true,
                    "openUntil": "string",
                    "unreadCount": 0,
                    "channelId": "string",
                    "contactId": "string",
                    "contact": {
                      "id": "string",
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z",
                      "firstName": "string",
                      "lastName": "string",
                      "fullName": "string",
                      "isSubscribed": true,
                      "handles": [],
                      "labels": [],
                      "attributes": [],
                      "displayName": "string",
                      "phoneNumber": "string",
                      "email": "string",
                      "chats": [],
                      "metadata": {}
                    },
                    "handleId": "string",
                    "handle": {
                      "id": "string",
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z",
                      "type": "phone_number",
                      "isPrimary": true,
                      "value": "string",
                      "extra": {},
                      "hasChats": true
                    },
                    "latestMessage": {
                      "id": "string",
                      "vendorId": "string",
                      "sender": "outbound",
                      "type": "text",
                      "timestamp": "string",
                      "text": "string"
                    },
                    "assignedUserId": "string",
                    "assignedTeamId": "string",
                    "isSensitive": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/chats/{chatId}/mark_as_sensitive": {
      "post": {
        "summary": "Mark chat as sensitive",
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "open",
                            "closed",
                            "snoozed"
                          ]
                        },
                        "isUnread": {
                          "type": "boolean"
                        },
                        "openUntil": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "unreadCount": {
                          "type": "number"
                        },
                        "channelId": {
                          "type": "string"
                        },
                        "contactId": {
                          "type": "string"
                        },
                        "handleId": {
                          "type": "string"
                        },
                        "latestMessage": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "vendorId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "sender": {
                              "type": "string",
                              "enum": [
                                "outbound",
                                "inbound",
                                "unknown",
                                "system"
                              ]
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "text",
                                "media",
                                "audio",
                                "location",
                                "contact",
                                "auth"
                              ]
                            },
                            "timestamp": {
                              "type": "string"
                            },
                            "text": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "vendorId",
                            "sender",
                            "type",
                            "timestamp",
                            "text"
                          ]
                        },
                        "assignedUserId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "assignedTeamId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isSensitive": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "status",
                        "isUnread",
                        "openUntil",
                        "unreadCount",
                        "channelId",
                        "contactId",
                        "handleId",
                        "latestMessage",
                        "assignedUserId",
                        "assignedTeamId",
                        "isSensitive"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "status": "open",
                    "isUnread": true,
                    "openUntil": "string",
                    "unreadCount": 0,
                    "channelId": "string",
                    "contactId": "string",
                    "contact": {
                      "id": "string",
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z",
                      "firstName": "string",
                      "lastName": "string",
                      "fullName": "string",
                      "isSubscribed": true,
                      "handles": [],
                      "labels": [],
                      "attributes": [],
                      "displayName": "string",
                      "phoneNumber": "string",
                      "email": "string",
                      "chats": [],
                      "metadata": {}
                    },
                    "handleId": "string",
                    "handle": {
                      "id": "string",
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z",
                      "type": "phone_number",
                      "isPrimary": true,
                      "value": "string",
                      "extra": {},
                      "hasChats": true
                    },
                    "latestMessage": {
                      "id": "string",
                      "vendorId": "string",
                      "sender": "outbound",
                      "type": "text",
                      "timestamp": "string",
                      "text": "string"
                    },
                    "assignedUserId": "string",
                    "assignedTeamId": "string",
                    "isSensitive": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/chats/{chatId}/mark_as_not_sensitive": {
      "post": {
        "summary": "Mark chat as not sensitive",
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "open",
                            "closed",
                            "snoozed"
                          ]
                        },
                        "isUnread": {
                          "type": "boolean"
                        },
                        "openUntil": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "unreadCount": {
                          "type": "number"
                        },
                        "channelId": {
                          "type": "string"
                        },
                        "contactId": {
                          "type": "string"
                        },
                        "handleId": {
                          "type": "string"
                        },
                        "latestMessage": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "vendorId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "sender": {
                              "type": "string",
                              "enum": [
                                "outbound",
                                "inbound",
                                "unknown",
                                "system"
                              ]
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "text",
                                "media",
                                "audio",
                                "location",
                                "contact",
                                "auth"
                              ]
                            },
                            "timestamp": {
                              "type": "string"
                            },
                            "text": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "vendorId",
                            "sender",
                            "type",
                            "timestamp",
                            "text"
                          ]
                        },
                        "assignedUserId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "assignedTeamId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isSensitive": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "status",
                        "isUnread",
                        "openUntil",
                        "unreadCount",
                        "channelId",
                        "contactId",
                        "handleId",
                        "latestMessage",
                        "assignedUserId",
                        "assignedTeamId",
                        "isSensitive"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "status": "open",
                    "isUnread": true,
                    "openUntil": "string",
                    "unreadCount": 0,
                    "channelId": "string",
                    "contactId": "string",
                    "contact": {
                      "id": "string",
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z",
                      "firstName": "string",
                      "lastName": "string",
                      "fullName": "string",
                      "isSubscribed": true,
                      "handles": [],
                      "labels": [],
                      "attributes": [],
                      "displayName": "string",
                      "phoneNumber": "string",
                      "email": "string",
                      "chats": [],
                      "metadata": {}
                    },
                    "handleId": "string",
                    "handle": {
                      "id": "string",
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z",
                      "type": "phone_number",
                      "isPrimary": true,
                      "value": "string",
                      "extra": {},
                      "hasChats": true
                    },
                    "latestMessage": {
                      "id": "string",
                      "vendorId": "string",
                      "sender": "outbound",
                      "type": "text",
                      "timestamp": "string",
                      "text": "string"
                    },
                    "assignedUserId": "string",
                    "assignedTeamId": "string",
                    "isSensitive": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/contacts/search": {
      "post": {
        "summary": "Search contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Structured filter expression. See [Query syntax](/api-reference/v3/query) for expression functions. Filterable fields: `id`, `createdAt`, `updatedAt`, `firstName`, `lastName`, `isSubscribed`, `labels`, `notes`, `groups`, `phoneNumber`, `email`. Filter custom contact attributes with `getBy('attributes', 'name', 'your_attribute_name')` or `getBy('attributes', 'id', 'attribute-id')`."
                  },
                  "sortBy": {
                    "type": "string",
                    "description": "Sort expression. See [Sort By syntax](/api-reference/v3/sort-by) for expression functions. Sortable fields: `id`, `createdAt`, `updatedAt`, `firstName`, `lastName`, `isSubscribed`, `labels`, `notes`, `groups`, `phoneNumber`, `email`. Sort custom contact attributes with `getBy('attributes', 'name', 'your_attribute_name')` or `getBy('attributes', 'id', 'attribute-id')`."
                  },
                  "search": {
                    "type": "string",
                    "description": "Free-text search by full name (`firstName` and `lastName` combined with a space), phone number, or email. See [Search](/api-reference/v3/search)."
                  },
                  "pagination": {
                    "type": "object",
                    "properties": {
                      "page": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Zero-based page index. Defaults to 0 when omitted."
                      },
                      "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Rows per page. Defaults to 10 when omitted. Maximum 100."
                      }
                    },
                    "required": [
                      "page",
                      "limit"
                    ],
                    "additionalProperties": false,
                    "description": "Page through results. Defaults to page 0 and limit 10 when omitted. See [Pagination](/api-reference/v3/pagination)."
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "firstName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "fullName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isSubscribed": {
                            "type": "boolean"
                          },
                          "handles": {
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time"
                                    },
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "phone_number"
                                      ]
                                    },
                                    "isPrimary": {
                                      "type": "boolean"
                                    },
                                    "value": {
                                      "type": "string"
                                    },
                                    "extra": {
                                      "type": [
                                        "object",
                                        "null"
                                      ],
                                      "additionalProperties": {}
                                    },
                                    "hasChats": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "createdAt",
                                    "updatedAt",
                                    "type",
                                    "isPrimary",
                                    "value",
                                    "extra"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time"
                                    },
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "email"
                                      ]
                                    },
                                    "isPrimary": {
                                      "type": "boolean"
                                    },
                                    "value": {
                                      "type": "string"
                                    },
                                    "extra": {
                                      "type": [
                                        "object",
                                        "null"
                                      ],
                                      "additionalProperties": {}
                                    },
                                    "hasChats": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "createdAt",
                                    "updatedAt",
                                    "type",
                                    "isPrimary",
                                    "value",
                                    "extra"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time"
                                    },
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "instagram"
                                      ]
                                    },
                                    "isPrimary": {
                                      "type": "boolean"
                                    },
                                    "value": {
                                      "type": "string"
                                    },
                                    "extra": {
                                      "type": [
                                        "object",
                                        "null"
                                      ],
                                      "additionalProperties": {}
                                    },
                                    "hasChats": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "createdAt",
                                    "updatedAt",
                                    "type",
                                    "isPrimary",
                                    "value",
                                    "extra"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time"
                                    },
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "messenger"
                                      ]
                                    },
                                    "isPrimary": {
                                      "type": "boolean"
                                    },
                                    "value": {
                                      "type": "string"
                                    },
                                    "extra": {
                                      "type": [
                                        "object",
                                        "null"
                                      ],
                                      "additionalProperties": {}
                                    },
                                    "hasChats": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "createdAt",
                                    "updatedAt",
                                    "type",
                                    "isPrimary",
                                    "value",
                                    "extra"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time"
                                    },
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "live_chat"
                                      ]
                                    },
                                    "isPrimary": {
                                      "type": "boolean"
                                    },
                                    "value": {
                                      "type": "string"
                                    },
                                    "extra": {
                                      "type": [
                                        "object",
                                        "null"
                                      ],
                                      "additionalProperties": {}
                                    },
                                    "hasChats": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "createdAt",
                                    "updatedAt",
                                    "type",
                                    "isPrimary",
                                    "value",
                                    "extra"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time"
                                    },
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "whatsapp"
                                      ]
                                    },
                                    "isPrimary": {
                                      "type": "boolean"
                                    },
                                    "value": {
                                      "type": "string"
                                    },
                                    "extra": {
                                      "type": [
                                        "object",
                                        "null"
                                      ],
                                      "additionalProperties": {}
                                    },
                                    "hasChats": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "createdAt",
                                    "updatedAt",
                                    "type",
                                    "isPrimary",
                                    "value",
                                    "extra"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "labels": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "attributes": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "contactId": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "attribute": {
                                  "type": [
                                    "object",
                                    "null"
                                  ],
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time"
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "text",
                                        "number",
                                        "single_select",
                                        "multi_select",
                                        "date",
                                        "datetime"
                                      ]
                                    },
                                    "displayName": {
                                      "type": "string"
                                    },
                                    "description": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "visibility": {
                                      "type": "object",
                                      "properties": {
                                        "inbox": {
                                          "type": "boolean"
                                        },
                                        "contacts": {
                                          "type": "boolean"
                                        },
                                        "create": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "inbox",
                                        "contacts",
                                        "create"
                                      ]
                                    },
                                    "details": {
                                      "type": "object",
                                      "properties": {
                                        "options": {
                                          "type": [
                                            "array",
                                            "null"
                                          ],
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "color": {
                                                "type": "string"
                                              },
                                              "value": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "color",
                                              "value"
                                            ]
                                          }
                                        }
                                      }
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "createdAt",
                                    "updatedAt",
                                    "name",
                                    "type",
                                    "displayName",
                                    "description",
                                    "visibility",
                                    "details"
                                  ],
                                  "additionalProperties": false
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    {
                                      "type": "null"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "attribute",
                                "value"
                              ]
                            }
                          },
                          "displayName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "phoneNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "email": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "chats": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id"
                              ]
                            }
                          },
                          "metadata": {
                            "type": "object",
                            "additionalProperties": {}
                          }
                        },
                        "required": [
                          "id",
                          "createdAt",
                          "updatedAt",
                          "firstName",
                          "lastName",
                          "fullName",
                          "isSubscribed",
                          "handles",
                          "labels",
                          "attributes",
                          "displayName",
                          "phoneNumber",
                          "email",
                          "chats",
                          "metadata"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "limit": {
                          "type": "integer",
                          "maximum": 1000
                        },
                        "total": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "query": {
                      "type": "object",
                      "properties": {
                        "query": {
                          "type": "string"
                        },
                        "sortBy": {
                          "type": "string"
                        },
                        "search": {
                          "type": "string"
                        }
                      }
                    },
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "pagination",
                    "query",
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": [],
                  "pagination": {
                    "page": 0,
                    "limit": 0,
                    "total": 0
                  },
                  "query": {
                    "query": "string",
                    "sortBy": "string",
                    "search": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/contacts/{contactId}": {
      "get": {
        "summary": "Get contact",
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "firstName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "fullName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isSubscribed": {
                          "type": "boolean"
                        },
                        "handles": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "phone_number"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "email"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "instagram"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "messenger"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "live_chat"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "whatsapp"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "labels": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "attributes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "contactId": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "attribute": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "text",
                                      "number",
                                      "single_select",
                                      "multi_select",
                                      "date",
                                      "datetime"
                                    ]
                                  },
                                  "displayName": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "visibility": {
                                    "type": "object",
                                    "properties": {
                                      "inbox": {
                                        "type": "boolean"
                                      },
                                      "contacts": {
                                        "type": "boolean"
                                      },
                                      "create": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "inbox",
                                      "contacts",
                                      "create"
                                    ]
                                  },
                                  "details": {
                                    "type": "object",
                                    "properties": {
                                      "options": {
                                        "type": [
                                          "array",
                                          "null"
                                        ],
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "color": {
                                              "type": "string"
                                            },
                                            "value": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "color",
                                            "value"
                                          ]
                                        }
                                      }
                                    }
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "name",
                                  "type",
                                  "displayName",
                                  "description",
                                  "visibility",
                                  "details"
                                ],
                                "additionalProperties": false
                              },
                              "value": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  {
                                    "type": "null"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "attribute",
                              "value"
                            ]
                          }
                        },
                        "displayName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phoneNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "chats": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ]
                          }
                        },
                        "metadata": {
                          "type": "object",
                          "additionalProperties": {}
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "firstName",
                        "lastName",
                        "fullName",
                        "isSubscribed",
                        "handles",
                        "labels",
                        "attributes",
                        "displayName",
                        "phoneNumber",
                        "email",
                        "chats",
                        "metadata"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "firstName": "string",
                    "lastName": "string",
                    "fullName": "string",
                    "isSubscribed": true,
                    "handles": [],
                    "labels": [],
                    "attributes": [],
                    "displayName": "string",
                    "phoneNumber": "string",
                    "email": "string",
                    "chats": [],
                    "metadata": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Update contact",
        "description": "Updates contact profile fields (first name, last name, and custom attributes). Phone number and email cannot be changed here — use upsert to create or match by identifier.",
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "firstName": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "lastName": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "attributes": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "value"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "name",
                            "value"
                          ]
                        }
                      ]
                    },
                    "default": []
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "firstName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "fullName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isSubscribed": {
                          "type": "boolean"
                        },
                        "handles": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "phone_number"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "email"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "instagram"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "messenger"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "live_chat"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "whatsapp"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "labels": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "attributes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "contactId": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "attribute": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "text",
                                      "number",
                                      "single_select",
                                      "multi_select",
                                      "date",
                                      "datetime"
                                    ]
                                  },
                                  "displayName": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "visibility": {
                                    "type": "object",
                                    "properties": {
                                      "inbox": {
                                        "type": "boolean"
                                      },
                                      "contacts": {
                                        "type": "boolean"
                                      },
                                      "create": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "inbox",
                                      "contacts",
                                      "create"
                                    ]
                                  },
                                  "details": {
                                    "type": "object",
                                    "properties": {
                                      "options": {
                                        "type": [
                                          "array",
                                          "null"
                                        ],
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "color": {
                                              "type": "string"
                                            },
                                            "value": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "color",
                                            "value"
                                          ]
                                        }
                                      }
                                    }
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "name",
                                  "type",
                                  "displayName",
                                  "description",
                                  "visibility",
                                  "details"
                                ],
                                "additionalProperties": false
                              },
                              "value": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  {
                                    "type": "null"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "attribute",
                              "value"
                            ]
                          }
                        },
                        "displayName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phoneNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "chats": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ]
                          }
                        },
                        "metadata": {
                          "type": "object",
                          "additionalProperties": {}
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "firstName",
                        "lastName",
                        "fullName",
                        "isSubscribed",
                        "handles",
                        "labels",
                        "attributes",
                        "displayName",
                        "phoneNumber",
                        "email",
                        "chats",
                        "metadata"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "firstName": "string",
                    "lastName": "string",
                    "fullName": "string",
                    "isSubscribed": true,
                    "handles": [],
                    "labels": [],
                    "attributes": [],
                    "displayName": "string",
                    "phoneNumber": "string",
                    "email": "string",
                    "chats": [],
                    "metadata": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete contact",
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "notFoundIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "deletedIds",
                        "notFoundIds"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "deletedIds": [],
                    "notFoundIds": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/contacts/upsert": {
      "post": {
        "summary": "Upsert contact",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "firstName": {
                    "type": "string"
                  },
                  "lastName": {
                    "type": "string"
                  },
                  "phoneNumber": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "attributes": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "value"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            }
                          },
                          "required": [
                            "name",
                            "value"
                          ]
                        }
                      ]
                    }
                  },
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "firstName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "fullName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isSubscribed": {
                          "type": "boolean"
                        },
                        "handles": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "phone_number"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "email"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "instagram"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "messenger"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "live_chat"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "whatsapp"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "labels": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "attributes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "contactId": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "attribute": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "text",
                                      "number",
                                      "single_select",
                                      "multi_select",
                                      "date",
                                      "datetime"
                                    ]
                                  },
                                  "displayName": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "visibility": {
                                    "type": "object",
                                    "properties": {
                                      "inbox": {
                                        "type": "boolean"
                                      },
                                      "contacts": {
                                        "type": "boolean"
                                      },
                                      "create": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "inbox",
                                      "contacts",
                                      "create"
                                    ]
                                  },
                                  "details": {
                                    "type": "object",
                                    "properties": {
                                      "options": {
                                        "type": [
                                          "array",
                                          "null"
                                        ],
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "color": {
                                              "type": "string"
                                            },
                                            "value": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "color",
                                            "value"
                                          ]
                                        }
                                      }
                                    }
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "name",
                                  "type",
                                  "displayName",
                                  "description",
                                  "visibility",
                                  "details"
                                ],
                                "additionalProperties": false
                              },
                              "value": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  {
                                    "type": "null"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "attribute",
                              "value"
                            ]
                          }
                        },
                        "displayName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phoneNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "chats": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ]
                          }
                        },
                        "metadata": {
                          "type": "object",
                          "additionalProperties": {}
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "firstName",
                        "lastName",
                        "fullName",
                        "isSubscribed",
                        "handles",
                        "labels",
                        "attributes",
                        "displayName",
                        "phoneNumber",
                        "email",
                        "chats",
                        "metadata"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "firstName": "string",
                    "lastName": "string",
                    "fullName": "string",
                    "isSubscribed": true,
                    "handles": [],
                    "labels": [],
                    "attributes": [],
                    "displayName": "string",
                    "phoneNumber": "string",
                    "email": "string",
                    "chats": [],
                    "metadata": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/contacts": {
      "post": {
        "summary": "Create contact",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "firstName": {
                    "type": "string"
                  },
                  "lastName": {
                    "type": "string"
                  },
                  "phoneNumber": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "attributes": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "value"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "number"
                                }
                              ]
                            }
                          },
                          "required": [
                            "name",
                            "value"
                          ]
                        }
                      ]
                    }
                  },
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "firstName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "fullName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isSubscribed": {
                          "type": "boolean"
                        },
                        "handles": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "phone_number"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "email"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "instagram"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "messenger"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "live_chat"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "whatsapp"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "labels": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "attributes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "contactId": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "attribute": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "text",
                                      "number",
                                      "single_select",
                                      "multi_select",
                                      "date",
                                      "datetime"
                                    ]
                                  },
                                  "displayName": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "visibility": {
                                    "type": "object",
                                    "properties": {
                                      "inbox": {
                                        "type": "boolean"
                                      },
                                      "contacts": {
                                        "type": "boolean"
                                      },
                                      "create": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "inbox",
                                      "contacts",
                                      "create"
                                    ]
                                  },
                                  "details": {
                                    "type": "object",
                                    "properties": {
                                      "options": {
                                        "type": [
                                          "array",
                                          "null"
                                        ],
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "color": {
                                              "type": "string"
                                            },
                                            "value": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "color",
                                            "value"
                                          ]
                                        }
                                      }
                                    }
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "name",
                                  "type",
                                  "displayName",
                                  "description",
                                  "visibility",
                                  "details"
                                ],
                                "additionalProperties": false
                              },
                              "value": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  {
                                    "type": "null"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "attribute",
                              "value"
                            ]
                          }
                        },
                        "displayName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phoneNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "chats": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ]
                          }
                        },
                        "metadata": {
                          "type": "object",
                          "additionalProperties": {}
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "firstName",
                        "lastName",
                        "fullName",
                        "isSubscribed",
                        "handles",
                        "labels",
                        "attributes",
                        "displayName",
                        "phoneNumber",
                        "email",
                        "chats",
                        "metadata"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "firstName": "string",
                    "lastName": "string",
                    "fullName": "string",
                    "isSubscribed": true,
                    "handles": [],
                    "labels": [],
                    "attributes": [],
                    "displayName": "string",
                    "phoneNumber": "string",
                    "email": "string",
                    "chats": [],
                    "metadata": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/contacts/bulk": {
      "post": {
        "summary": "Bulk upsert contacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contacts": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "firstName": {
                          "type": "string"
                        },
                        "lastName": {
                          "type": "string"
                        },
                        "phoneNumber": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "attributes": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid"
                                  },
                                  "value": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "number"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "value"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "number"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "name",
                                  "value"
                                ]
                              }
                            ]
                          }
                        },
                        "labels": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              }
                            },
                            "required": [
                              "id"
                            ]
                          }
                        }
                      }
                    },
                    "minItems": 1,
                    "maxItems": 1000
                  }
                },
                "required": [
                  "contacts"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/contacts/{contactId}/subscribe": {
      "post": {
        "summary": "Subscribe contact",
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "firstName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "fullName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isSubscribed": {
                          "type": "boolean"
                        },
                        "handles": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "phone_number"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "email"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "instagram"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "messenger"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "live_chat"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "whatsapp"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "labels": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "attributes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "contactId": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "attribute": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "text",
                                      "number",
                                      "single_select",
                                      "multi_select",
                                      "date",
                                      "datetime"
                                    ]
                                  },
                                  "displayName": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "visibility": {
                                    "type": "object",
                                    "properties": {
                                      "inbox": {
                                        "type": "boolean"
                                      },
                                      "contacts": {
                                        "type": "boolean"
                                      },
                                      "create": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "inbox",
                                      "contacts",
                                      "create"
                                    ]
                                  },
                                  "details": {
                                    "type": "object",
                                    "properties": {
                                      "options": {
                                        "type": [
                                          "array",
                                          "null"
                                        ],
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "color": {
                                              "type": "string"
                                            },
                                            "value": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "color",
                                            "value"
                                          ]
                                        }
                                      }
                                    }
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "name",
                                  "type",
                                  "displayName",
                                  "description",
                                  "visibility",
                                  "details"
                                ],
                                "additionalProperties": false
                              },
                              "value": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  {
                                    "type": "null"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "attribute",
                              "value"
                            ]
                          }
                        },
                        "displayName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phoneNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "chats": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ]
                          }
                        },
                        "metadata": {
                          "type": "object",
                          "additionalProperties": {}
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "firstName",
                        "lastName",
                        "fullName",
                        "isSubscribed",
                        "handles",
                        "labels",
                        "attributes",
                        "displayName",
                        "phoneNumber",
                        "email",
                        "chats",
                        "metadata"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "firstName": "string",
                    "lastName": "string",
                    "fullName": "string",
                    "isSubscribed": true,
                    "handles": [],
                    "labels": [],
                    "attributes": [],
                    "displayName": "string",
                    "phoneNumber": "string",
                    "email": "string",
                    "chats": [],
                    "metadata": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/contacts/{contactId}/unsubscribe": {
      "post": {
        "summary": "Unsubscribe contact",
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "firstName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "fullName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isSubscribed": {
                          "type": "boolean"
                        },
                        "handles": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "phone_number"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "email"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "instagram"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "messenger"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "live_chat"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "whatsapp"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "labels": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "attributes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "contactId": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "attribute": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "text",
                                      "number",
                                      "single_select",
                                      "multi_select",
                                      "date",
                                      "datetime"
                                    ]
                                  },
                                  "displayName": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "visibility": {
                                    "type": "object",
                                    "properties": {
                                      "inbox": {
                                        "type": "boolean"
                                      },
                                      "contacts": {
                                        "type": "boolean"
                                      },
                                      "create": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "inbox",
                                      "contacts",
                                      "create"
                                    ]
                                  },
                                  "details": {
                                    "type": "object",
                                    "properties": {
                                      "options": {
                                        "type": [
                                          "array",
                                          "null"
                                        ],
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "color": {
                                              "type": "string"
                                            },
                                            "value": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "color",
                                            "value"
                                          ]
                                        }
                                      }
                                    }
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "name",
                                  "type",
                                  "displayName",
                                  "description",
                                  "visibility",
                                  "details"
                                ],
                                "additionalProperties": false
                              },
                              "value": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  {
                                    "type": "null"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "attribute",
                              "value"
                            ]
                          }
                        },
                        "displayName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phoneNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "chats": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ]
                          }
                        },
                        "metadata": {
                          "type": "object",
                          "additionalProperties": {}
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "firstName",
                        "lastName",
                        "fullName",
                        "isSubscribed",
                        "handles",
                        "labels",
                        "attributes",
                        "displayName",
                        "phoneNumber",
                        "email",
                        "chats",
                        "metadata"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "firstName": "string",
                    "lastName": "string",
                    "fullName": "string",
                    "isSubscribed": true,
                    "handles": [],
                    "labels": [],
                    "attributes": [],
                    "displayName": "string",
                    "phoneNumber": "string",
                    "email": "string",
                    "chats": [],
                    "metadata": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/contacts/{contactId}/labels": {
      "post": {
        "summary": "Add labels to contact",
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "required": [
                  "labels"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "firstName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "fullName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isSubscribed": {
                          "type": "boolean"
                        },
                        "handles": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "phone_number"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "email"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "instagram"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "messenger"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "live_chat"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "whatsapp"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "labels": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "attributes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "contactId": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "attribute": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "text",
                                      "number",
                                      "single_select",
                                      "multi_select",
                                      "date",
                                      "datetime"
                                    ]
                                  },
                                  "displayName": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "visibility": {
                                    "type": "object",
                                    "properties": {
                                      "inbox": {
                                        "type": "boolean"
                                      },
                                      "contacts": {
                                        "type": "boolean"
                                      },
                                      "create": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "inbox",
                                      "contacts",
                                      "create"
                                    ]
                                  },
                                  "details": {
                                    "type": "object",
                                    "properties": {
                                      "options": {
                                        "type": [
                                          "array",
                                          "null"
                                        ],
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "color": {
                                              "type": "string"
                                            },
                                            "value": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "color",
                                            "value"
                                          ]
                                        }
                                      }
                                    }
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "name",
                                  "type",
                                  "displayName",
                                  "description",
                                  "visibility",
                                  "details"
                                ],
                                "additionalProperties": false
                              },
                              "value": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  {
                                    "type": "null"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "attribute",
                              "value"
                            ]
                          }
                        },
                        "displayName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phoneNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "chats": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ]
                          }
                        },
                        "metadata": {
                          "type": "object",
                          "additionalProperties": {}
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "firstName",
                        "lastName",
                        "fullName",
                        "isSubscribed",
                        "handles",
                        "labels",
                        "attributes",
                        "displayName",
                        "phoneNumber",
                        "email",
                        "chats",
                        "metadata"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "firstName": "string",
                    "lastName": "string",
                    "fullName": "string",
                    "isSubscribed": true,
                    "handles": [],
                    "labels": [],
                    "attributes": [],
                    "displayName": "string",
                    "phoneNumber": "string",
                    "email": "string",
                    "chats": [],
                    "metadata": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Remove labels from contact",
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "required": [
                  "labels"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "firstName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "fullName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "isSubscribed": {
                          "type": "boolean"
                        },
                        "handles": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "phone_number"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "email"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "instagram"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "messenger"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "live_chat"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "whatsapp"
                                    ]
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "extra": {
                                    "type": [
                                      "object",
                                      "null"
                                    ],
                                    "additionalProperties": {}
                                  },
                                  "hasChats": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "type",
                                  "isPrimary",
                                  "value",
                                  "extra"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "labels": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "attributes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "contactId": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "attribute": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "text",
                                      "number",
                                      "single_select",
                                      "multi_select",
                                      "date",
                                      "datetime"
                                    ]
                                  },
                                  "displayName": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "visibility": {
                                    "type": "object",
                                    "properties": {
                                      "inbox": {
                                        "type": "boolean"
                                      },
                                      "contacts": {
                                        "type": "boolean"
                                      },
                                      "create": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "inbox",
                                      "contacts",
                                      "create"
                                    ]
                                  },
                                  "details": {
                                    "type": "object",
                                    "properties": {
                                      "options": {
                                        "type": [
                                          "array",
                                          "null"
                                        ],
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "color": {
                                              "type": "string"
                                            },
                                            "value": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "color",
                                            "value"
                                          ]
                                        }
                                      }
                                    }
                                  }
                                },
                                "required": [
                                  "id",
                                  "createdAt",
                                  "updatedAt",
                                  "name",
                                  "type",
                                  "displayName",
                                  "description",
                                  "visibility",
                                  "details"
                                ],
                                "additionalProperties": false
                              },
                              "value": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  {
                                    "type": "null"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "attribute",
                              "value"
                            ]
                          }
                        },
                        "displayName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phoneNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "chats": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ]
                          }
                        },
                        "metadata": {
                          "type": "object",
                          "additionalProperties": {}
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "firstName",
                        "lastName",
                        "fullName",
                        "isSubscribed",
                        "handles",
                        "labels",
                        "attributes",
                        "displayName",
                        "phoneNumber",
                        "email",
                        "chats",
                        "metadata"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "firstName": "string",
                    "lastName": "string",
                    "fullName": "string",
                    "isSubscribed": true,
                    "handles": [],
                    "labels": [],
                    "attributes": [],
                    "displayName": "string",
                    "phoneNumber": "string",
                    "email": "string",
                    "chats": [],
                    "metadata": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/journeys/search": {
      "post": {
        "summary": "Search journeys",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Structured filter expression. See [Query syntax](/api-reference/v3/query) for expression functions. Filterable fields: `id`, `createdAt`, `updatedAt`, `name`, `type`, `status`."
                  },
                  "sortBy": {
                    "type": "string",
                    "description": "Sort expression. See [Sort By syntax](/api-reference/v3/sort-by) for expression functions. Sortable fields: `id`, `createdAt`, `updatedAt`, `name`, `type`, `status`."
                  },
                  "search": {
                    "type": "string",
                    "description": "Free-text search by `name`. See [Search](/api-reference/v3/search)."
                  },
                  "pagination": {
                    "type": "object",
                    "properties": {
                      "page": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Zero-based page index. Defaults to 0 when omitted."
                      },
                      "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Rows per page. Defaults to 10 when omitted. Maximum 100."
                      }
                    },
                    "required": [
                      "page",
                      "limit"
                    ],
                    "additionalProperties": false,
                    "description": "Page through results. Defaults to page 0 and limit 10 when omitted. See [Pagination](/api-reference/v3/pagination)."
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "relative",
                              "static"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "paused"
                            ]
                          },
                          "steps": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "paused"
                                  ]
                                },
                                "automationId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "format": "uuid"
                                },
                                "schedule": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "enum": [
                                            "datetime"
                                          ]
                                        },
                                        "datetime": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "datetime"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "enum": [
                                            "delay"
                                          ]
                                        },
                                        "delay": {
                                          "type": "object",
                                          "properties": {
                                            "unit": {
                                              "type": "string",
                                              "enum": [
                                                "seconds",
                                                "minutes",
                                                "hours",
                                                "days"
                                              ]
                                            },
                                            "value": {
                                              "type": "number"
                                            }
                                          },
                                          "required": [
                                            "unit",
                                            "value"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "timeWindows": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "enum": [
                                                  "week_day",
                                                  "date"
                                                ]
                                              },
                                              "date": {
                                                "type": [
                                                  "string",
                                                  "null"
                                                ]
                                              },
                                              "weekDay": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "enum": [
                                                      "sunday"
                                                    ]
                                                  },
                                                  {
                                                    "type": "string",
                                                    "enum": [
                                                      "monday"
                                                    ]
                                                  },
                                                  {
                                                    "type": "string",
                                                    "enum": [
                                                      "tuesday"
                                                    ]
                                                  },
                                                  {
                                                    "type": "string",
                                                    "enum": [
                                                      "wednesday"
                                                    ]
                                                  },
                                                  {
                                                    "type": "string",
                                                    "enum": [
                                                      "thursday"
                                                    ]
                                                  },
                                                  {
                                                    "type": "string",
                                                    "enum": [
                                                      "friday"
                                                    ]
                                                  },
                                                  {
                                                    "type": "string",
                                                    "enum": [
                                                      "saturday"
                                                    ]
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "intervals": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "from": {
                                                      "type": "string"
                                                    },
                                                    "to": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "from",
                                                    "to"
                                                  ]
                                                }
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "date",
                                              "weekDay",
                                              "intervals"
                                            ]
                                          }
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "delay",
                                        "timeWindows"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "status",
                                "automationId",
                                "schedule"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          }
                        },
                        "required": [
                          "name",
                          "type",
                          "status",
                          "steps",
                          "id",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "limit": {
                          "type": "integer",
                          "maximum": 1000
                        },
                        "total": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "query": {
                      "type": "object",
                      "properties": {
                        "query": {
                          "type": "string"
                        },
                        "sortBy": {
                          "type": "string"
                        },
                        "search": {
                          "type": "string"
                        }
                      }
                    },
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "pagination",
                    "query",
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": [],
                  "pagination": {
                    "page": 0,
                    "limit": 0,
                    "total": 0
                  },
                  "query": {
                    "query": "string",
                    "sortBy": "string",
                    "search": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/journeys/{journeyId}": {
      "get": {
        "summary": "Get journey",
        "parameters": [
          {
            "name": "journeyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "relative",
                            "static"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "paused"
                          ]
                        },
                        "steps": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "paused"
                                ]
                              },
                              "automationId": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "uuid"
                              },
                              "schedule": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "datetime"
                                        ]
                                      },
                                      "datetime": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "datetime"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "delay"
                                        ]
                                      },
                                      "delay": {
                                        "type": "object",
                                        "properties": {
                                          "unit": {
                                            "type": "string",
                                            "enum": [
                                              "seconds",
                                              "minutes",
                                              "hours",
                                              "days"
                                            ]
                                          },
                                          "value": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "unit",
                                          "value"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "timeWindows": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "enum": [
                                                "week_day",
                                                "date"
                                              ]
                                            },
                                            "date": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "weekDay": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "enum": [
                                                    "sunday"
                                                  ]
                                                },
                                                {
                                                  "type": "string",
                                                  "enum": [
                                                    "monday"
                                                  ]
                                                },
                                                {
                                                  "type": "string",
                                                  "enum": [
                                                    "tuesday"
                                                  ]
                                                },
                                                {
                                                  "type": "string",
                                                  "enum": [
                                                    "wednesday"
                                                  ]
                                                },
                                                {
                                                  "type": "string",
                                                  "enum": [
                                                    "thursday"
                                                  ]
                                                },
                                                {
                                                  "type": "string",
                                                  "enum": [
                                                    "friday"
                                                  ]
                                                },
                                                {
                                                  "type": "string",
                                                  "enum": [
                                                    "saturday"
                                                  ]
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "intervals": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "from": {
                                                    "type": "string"
                                                  },
                                                  "to": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "from",
                                                  "to"
                                                ]
                                              }
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "date",
                                            "weekDay",
                                            "intervals"
                                          ]
                                        }
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "delay",
                                      "timeWindows"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "status",
                              "automationId",
                              "schedule"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "name",
                        "type",
                        "status",
                        "steps",
                        "id",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "name": "string",
                    "type": "relative",
                    "status": "active",
                    "steps": [],
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/journeys/{journeyId}/subscribe": {
      "post": {
        "summary": "Subscribe contacts to journey",
        "parameters": [
          {
            "name": "journeyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contactIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                },
                "required": [
                  "contactIds"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "journeyId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "contactId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "completed",
                              "cancelled"
                            ]
                          },
                          "subscribedAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "lastCompletedIndex": {
                            "type": "integer"
                          },
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          }
                        },
                        "required": [
                          "journeyId",
                          "contactId",
                          "status",
                          "subscribedAt",
                          "lastCompletedIndex",
                          "id",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": []
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/journeys/{journeyId}/unsubscribe": {
      "post": {
        "summary": "Unsubscribe contacts from journey",
        "parameters": [
          {
            "name": "journeyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contactIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                },
                "required": [
                  "contactIds"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "journeyId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "contactId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "completed",
                              "cancelled"
                            ]
                          },
                          "subscribedAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "lastCompletedIndex": {
                            "type": "integer"
                          },
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          }
                        },
                        "required": [
                          "journeyId",
                          "contactId",
                          "status",
                          "subscribedAt",
                          "lastCompletedIndex",
                          "id",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": []
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/labels/search": {
      "post": {
        "summary": "Search labels",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Structured filter expression. See [Query syntax](/api-reference/v3/query) for expression functions. Filterable fields: `id`, `createdAt`, `updatedAt`, `name`."
                  },
                  "sortBy": {
                    "type": "string",
                    "description": "Sort expression. See [Sort By syntax](/api-reference/v3/sort-by) for expression functions. Sortable fields: `id`, `createdAt`, `updatedAt`, `name`."
                  },
                  "search": {
                    "type": "string",
                    "description": "Free-text search by `name`. See [Search](/api-reference/v3/search)."
                  },
                  "pagination": {
                    "type": "object",
                    "properties": {
                      "page": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Zero-based page index. Defaults to 0 when omitted."
                      },
                      "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Rows per page. Defaults to 10 when omitted. Maximum 100."
                      }
                    },
                    "required": [
                      "page",
                      "limit"
                    ],
                    "additionalProperties": false,
                    "description": "Page through results. Defaults to page 0 and limit 10 when omitted. See [Pagination](/api-reference/v3/pagination)."
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "name": {
                            "type": "string"
                          },
                          "color": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "createdAt",
                          "updatedAt",
                          "name",
                          "color"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "limit": {
                          "type": "integer",
                          "maximum": 1000
                        },
                        "total": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "query": {
                      "type": "object",
                      "properties": {
                        "query": {
                          "type": "string"
                        },
                        "sortBy": {
                          "type": "string"
                        },
                        "search": {
                          "type": "string"
                        }
                      }
                    },
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "pagination",
                    "query",
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": [],
                  "pagination": {
                    "page": 0,
                    "limit": 0,
                    "total": 0
                  },
                  "query": {
                    "query": "string",
                    "sortBy": "string",
                    "search": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/labels/{labelId}": {
      "get": {
        "summary": "Get label",
        "parameters": [
          {
            "name": "labelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "name": {
                          "type": "string"
                        },
                        "color": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "name",
                        "color"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "name": "string",
                    "color": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Update label",
        "parameters": [
          {
            "name": "labelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "color": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "name": {
                          "type": "string"
                        },
                        "color": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "name",
                        "color"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "name": "string",
                    "color": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete label",
        "parameters": [
          {
            "name": "labelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "notFoundIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "deletedIds",
                        "notFoundIds"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "deletedIds": [],
                    "notFoundIds": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/labels": {
      "post": {
        "summary": "Create label",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "color": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "color"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "name": {
                          "type": "string"
                        },
                        "color": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "name",
                        "color"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "name": "string",
                    "color": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/messages/send": {
      "post": {
        "summary": "Send message",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "chat": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "chatId": {
                            "type": "string",
                            "format": "uuid"
                          }
                        },
                        "required": [
                          "chatId"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "channelId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "contactId": {
                            "type": "string",
                            "format": "uuid"
                          }
                        },
                        "required": [
                          "channelId",
                          "contactId"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "channelId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "phoneNumber": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "channelId",
                          "phoneNumber"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "channelId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "email": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "channelId",
                          "email"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "channelId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "handleId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "channelId",
                          "handleId"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "body": {
                    "type": "string"
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "image"
                              ]
                            },
                            "fileId": {
                              "type": "string",
                              "format": "uuid"
                            }
                          },
                          "required": [
                            "type",
                            "fileId"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "video"
                              ]
                            },
                            "fileId": {
                              "type": "string",
                              "format": "uuid"
                            }
                          },
                          "required": [
                            "type",
                            "fileId"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "document"
                              ]
                            },
                            "fileId": {
                              "type": "string",
                              "format": "uuid"
                            }
                          },
                          "required": [
                            "type",
                            "fileId"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "audio"
                              ]
                            },
                            "fileId": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "isVoice": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "type",
                            "fileId"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "button"
                              ]
                            },
                            "buttonType": {
                              "type": "string",
                              "enum": [
                                "quick_reply",
                                "url",
                                "phone_number",
                                "list_title"
                              ]
                            },
                            "text": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "data": {
                              "type": [
                                "object",
                                "null"
                              ],
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "phone_number",
                                    "static_url",
                                    "dynamic_url"
                                  ]
                                },
                                "phoneNumber": {
                                  "type": "string"
                                },
                                "url": {
                                  "type": "string"
                                },
                                "urlExtension": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            "payload": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "type",
                            "buttonType",
                            "text"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "list_section"
                              ]
                            },
                            "title": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "rows": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "title",
                                  "description"
                                ]
                              }
                            }
                          },
                          "required": [
                            "type",
                            "title",
                            "rows"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "quick_reply"
                              ]
                            },
                            "text": {
                              "type": "string"
                            },
                            "payload": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "type",
                            "text",
                            "payload"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  },
                  "header": {
                    "type": "string"
                  },
                  "footer": {
                    "type": "string"
                  },
                  "replyToMessageId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "scheduledAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "chat"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "chatId": {
                          "type": "string"
                        },
                        "channelId": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "message",
                            "note",
                            "chat_open",
                            "chat_close",
                            "chat_snoozed",
                            "chat_assigned",
                            "vendor_comment",
                            "ai_tool_call"
                          ]
                        },
                        "sender": {
                          "type": "string",
                          "enum": [
                            "outbound",
                            "inbound",
                            "unknown",
                            "system"
                          ]
                        },
                        "sources": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "campaign"
                                    ]
                                  },
                                  "campaignExecutionId": {
                                    "type": "string",
                                    "format": "uuid"
                                  }
                                },
                                "required": [
                                  "type",
                                  "campaignExecutionId"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "automation"
                                    ]
                                  },
                                  "automationActionExecutionId": {
                                    "type": "string",
                                    "format": "uuid"
                                  }
                                },
                                "required": [
                                  "type",
                                  "automationActionExecutionId"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "inbox"
                                    ]
                                  },
                                  "userId": {
                                    "type": "string",
                                    "format": "uuid"
                                  }
                                },
                                "required": [
                                  "type",
                                  "userId"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "vendor"
                                    ]
                                  }
                                },
                                "required": [
                                  "type"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "api"
                                    ]
                                  },
                                  "apiKeyId": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type",
                                  "apiKeyId"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "ai_agent"
                                    ]
                                  },
                                  "aiAgentId": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type",
                                  "aiAgentId"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "system"
                                    ]
                                  }
                                },
                                "required": [
                                  "type"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "none",
                            "pending",
                            "sent",
                            "delivered",
                            "read",
                            "scheduled",
                            "deleted",
                            "failed"
                          ]
                        },
                        "scheduledAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "content": {
                          "type": "object",
                          "properties": {
                            "body": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "attachments": {
                              "type": "array",
                              "items": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "image"
                                        ]
                                      },
                                      "file": {
                                        "type": [
                                          "object",
                                          "null"
                                        ],
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "createdAt": {
                                            "type": "string"
                                          },
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "image",
                                              "video",
                                              "audio",
                                              "document"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "contentType": {
                                            "type": "string"
                                          },
                                          "url": {
                                            "type": "string"
                                          },
                                          "size": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "createdAt",
                                          "type",
                                          "name",
                                          "contentType",
                                          "url",
                                          "size"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "video"
                                        ]
                                      },
                                      "file": {
                                        "type": [
                                          "object",
                                          "null"
                                        ],
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "createdAt": {
                                            "type": "string"
                                          },
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "image",
                                              "video",
                                              "audio",
                                              "document"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "contentType": {
                                            "type": "string"
                                          },
                                          "url": {
                                            "type": "string"
                                          },
                                          "size": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "createdAt",
                                          "type",
                                          "name",
                                          "contentType",
                                          "url",
                                          "size"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "document"
                                        ]
                                      },
                                      "file": {
                                        "type": [
                                          "object",
                                          "null"
                                        ],
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "createdAt": {
                                            "type": "string"
                                          },
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "image",
                                              "video",
                                              "audio",
                                              "document"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "contentType": {
                                            "type": "string"
                                          },
                                          "url": {
                                            "type": "string"
                                          },
                                          "size": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "createdAt",
                                          "type",
                                          "name",
                                          "contentType",
                                          "url",
                                          "size"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "audio"
                                        ]
                                      },
                                      "file": {
                                        "type": [
                                          "object",
                                          "null"
                                        ],
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "createdAt": {
                                            "type": "string"
                                          },
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "image",
                                              "video",
                                              "audio",
                                              "document"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "contentType": {
                                            "type": "string"
                                          },
                                          "url": {
                                            "type": "string"
                                          },
                                          "size": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "createdAt",
                                          "type",
                                          "name",
                                          "contentType",
                                          "url",
                                          "size"
                                        ]
                                      },
                                      "isVoice": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "location"
                                        ]
                                      },
                                      "latitude": {
                                        "type": [
                                          "number",
                                          "null"
                                        ]
                                      },
                                      "longitude": {
                                        "type": [
                                          "number",
                                          "null"
                                        ]
                                      },
                                      "name": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "address": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "contact"
                                        ]
                                      },
                                      "addresses": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "street": {
                                              "type": "string"
                                            },
                                            "city": {
                                              "type": "string"
                                            },
                                            "state": {
                                              "type": "string"
                                            },
                                            "zip": {
                                              "type": "string"
                                            },
                                            "country": {
                                              "type": "string"
                                            },
                                            "countryCode": {
                                              "type": "string"
                                            },
                                            "type": {
                                              "type": "string"
                                            }
                                          }
                                        }
                                      },
                                      "birthday": {
                                        "type": "string"
                                      },
                                      "emails": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "email": {
                                              "type": "string"
                                            },
                                            "type": {
                                              "type": "string"
                                            }
                                          }
                                        }
                                      },
                                      "name": {
                                        "type": "object",
                                        "properties": {
                                          "formattedName": {
                                            "type": "string"
                                          },
                                          "firstName": {
                                            "type": "string"
                                          },
                                          "lastName": {
                                            "type": "string"
                                          },
                                          "middleName": {
                                            "type": "string"
                                          },
                                          "suffix": {
                                            "type": "string"
                                          },
                                          "prefix": {
                                            "type": "string"
                                          }
                                        }
                                      },
                                      "org": {
                                        "type": "object",
                                        "properties": {
                                          "company": {
                                            "type": "string"
                                          },
                                          "department": {
                                            "type": "string"
                                          },
                                          "title": {
                                            "type": "string"
                                          }
                                        }
                                      },
                                      "phones": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "phone": {
                                              "type": "string"
                                            },
                                            "type": {
                                              "type": "string"
                                            }
                                          }
                                        }
                                      },
                                      "urls": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "url": {
                                              "type": "string"
                                            },
                                            "type": {
                                              "type": "string"
                                            }
                                          }
                                        }
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "button"
                                        ]
                                      },
                                      "buttonType": {
                                        "type": "string",
                                        "enum": [
                                          "quick_reply",
                                          "url",
                                          "phone_number",
                                          "list_title"
                                        ]
                                      },
                                      "text": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "data": {
                                        "type": [
                                          "object",
                                          "null"
                                        ],
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "phone_number",
                                              "static_url",
                                              "dynamic_url"
                                            ]
                                          },
                                          "phoneNumber": {
                                            "type": "string"
                                          },
                                          "url": {
                                            "type": "string"
                                          },
                                          "urlExtension": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      },
                                      "payload": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type",
                                      "buttonType",
                                      "text"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "list_section"
                                        ]
                                      },
                                      "title": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "rows": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string"
                                            },
                                            "title": {
                                              "type": "string"
                                            },
                                            "description": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "title",
                                            "description"
                                          ]
                                        }
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type",
                                      "title",
                                      "rows"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "quick_reply"
                                        ]
                                      },
                                      "text": {
                                        "type": "string"
                                      },
                                      "payload": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type",
                                      "text",
                                      "payload"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "comment"
                                        ]
                                      },
                                      "text": {
                                        "type": "string"
                                      },
                                      "commentId": {
                                        "type": "string"
                                      },
                                      "mediaId": {
                                        "type": "string"
                                      },
                                      "file": {
                                        "type": [
                                          "object",
                                          "null"
                                        ],
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "createdAt": {
                                            "type": "string"
                                          },
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "image",
                                              "video",
                                              "audio",
                                              "document"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "contentType": {
                                            "type": "string"
                                          },
                                          "url": {
                                            "type": "string"
                                          },
                                          "size": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "createdAt",
                                          "type",
                                          "name",
                                          "contentType",
                                          "url",
                                          "size"
                                        ]
                                      },
                                      "mediaUrl": {
                                        "type": "string"
                                      },
                                      "mediaType": {
                                        "type": "string",
                                        "enum": [
                                          "IMAGE",
                                          "VIDEO",
                                          "CAROUSEL_ALBUM"
                                        ]
                                      },
                                      "mediaProductType": {
                                        "type": "string",
                                        "enum": [
                                          "FEED",
                                          "REELS",
                                          "STORY"
                                        ]
                                      },
                                      "platform": {
                                        "type": "string",
                                        "enum": [
                                          "instagram",
                                          "facebook"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type",
                                      "text"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "ai_tool_call"
                                        ]
                                      },
                                      "toolCallId": {
                                        "type": "string"
                                      },
                                      "toolName": {
                                        "type": "string"
                                      },
                                      "input": {},
                                      "output": {},
                                      "providerDetails": {}
                                    },
                                    "required": [
                                      "id",
                                      "type",
                                      "toolCallId",
                                      "toolName",
                                      "input",
                                      "output",
                                      "providerDetails"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "referral"
                                        ]
                                      },
                                      "source": {
                                        "type": "string",
                                        "enum": [
                                          "whatsapp"
                                        ]
                                      },
                                      "sourceUrl": {
                                        "type": "string"
                                      },
                                      "sourceType": {
                                        "type": "string"
                                      },
                                      "sourceId": {
                                        "type": "string"
                                      },
                                      "headline": {
                                        "type": "string"
                                      },
                                      "body": {
                                        "type": "string"
                                      },
                                      "mediaType": {
                                        "type": "string"
                                      },
                                      "imageUrl": {
                                        "type": "string"
                                      },
                                      "videoUrl": {
                                        "type": "string"
                                      },
                                      "thumbnailUrl": {
                                        "type": "string"
                                      },
                                      "ctwaClid": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type",
                                      "source"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "content_reference"
                                        ]
                                      },
                                      "contentType": {
                                        "type": "string",
                                        "enum": [
                                          "story"
                                        ]
                                      },
                                      "url": {
                                        "type": "string"
                                      },
                                      "externalId": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type",
                                      "contentType",
                                      "url"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "auth"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type"
                                    ]
                                  }
                                ]
                              }
                            },
                            "header": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "footer": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "payload": {
                              "type": "string"
                            }
                          }
                        },
                        "forwarded": {
                          "type": "boolean"
                        },
                        "replyTo": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "vendorId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "sender": {
                              "type": "string",
                              "enum": [
                                "outbound",
                                "inbound",
                                "unknown",
                                "system"
                              ]
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "text",
                                "media",
                                "audio",
                                "location",
                                "contact",
                                "auth"
                              ]
                            },
                            "timestamp": {
                              "type": "string"
                            },
                            "text": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "vendorId",
                            "sender",
                            "type",
                            "timestamp",
                            "text"
                          ]
                        },
                        "reactions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "sender": {
                                "type": "string",
                                "enum": [
                                  "outbound",
                                  "inbound",
                                  "unknown",
                                  "system"
                                ]
                              },
                              "userId": {
                                "type": "string"
                              },
                              "text": {
                                "type": "string"
                              },
                              "timestamp": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "sender",
                              "text",
                              "timestamp"
                            ]
                          }
                        },
                        "errors": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "messageKey": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "vendorError": {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  },
                                  "title": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "type": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "message": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "errorData": {
                                    "type": "object",
                                    "properties": {
                                      "messagingProduct": {
                                        "type": "string"
                                      },
                                      "details": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "fbtraceId": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                }
                              }
                            },
                            "required": [
                              "messageKey",
                              "message"
                            ]
                          }
                        },
                        "history": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "event": {
                                "type": "string",
                                "enum": [
                                  "status_update"
                                ]
                              },
                              "newStatus": {
                                "type": "string",
                                "enum": [
                                  "none",
                                  "pending",
                                  "sent",
                                  "delivered",
                                  "read",
                                  "scheduled",
                                  "deleted",
                                  "failed"
                                ]
                              },
                              "timestamp": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "event",
                              "newStatus",
                              "timestamp"
                            ]
                          }
                        },
                        "vendorId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "timestamp": {
                          "type": "string"
                        },
                        "vendorDetails": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "whatsapp": {
                              "type": "object",
                              "properties": {
                                "context": {
                                  "type": "object",
                                  "properties": {
                                    "frequentlyForwarded": {
                                      "type": "boolean"
                                    },
                                    "referredProduct": {
                                      "type": "object",
                                      "properties": {
                                        "catalogId": {
                                          "type": "string"
                                        },
                                        "productRetailerId": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "catalogId",
                                        "productRetailerId"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "frequentlyForwarded"
                                  ]
                                },
                                "order": {
                                  "type": "object",
                                  "properties": {
                                    "catalogId": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "productItems": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "productRetailerId": {
                                            "type": "string"
                                          },
                                          "quantity": {
                                            "type": "string"
                                          },
                                          "itemPrice": {
                                            "type": "string"
                                          },
                                          "currency": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "productRetailerId",
                                          "quantity",
                                          "itemPrice",
                                          "currency"
                                        ]
                                      }
                                    }
                                  }
                                }
                              }
                            },
                            "instagram": {
                              "type": "object",
                              "properties": {
                                "commentId": {
                                  "type": "string"
                                }
                              }
                            },
                            "messenger": {
                              "type": "object",
                              "properties": {
                                "commentId": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        },
                        "metadata": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "campaignContactId": {
                              "type": "string"
                            },
                            "campaignExecutionId": {
                              "type": "string"
                            }
                          }
                        },
                        "isSensitive": {
                          "type": "boolean"
                        },
                        "aiGenerationId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "chat": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "open",
                                "closed",
                                "snoozed"
                              ]
                            },
                            "isUnread": {
                              "type": "boolean"
                            },
                            "openUntil": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "unreadCount": {
                              "type": "number"
                            },
                            "channelId": {
                              "type": "string"
                            },
                            "contactId": {
                              "type": "string"
                            },
                            "handleId": {
                              "type": "string"
                            },
                            "latestMessage": {
                              "type": [
                                "object",
                                "null"
                              ],
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "vendorId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "sender": {
                                  "type": "string",
                                  "enum": [
                                    "outbound",
                                    "inbound",
                                    "unknown",
                                    "system"
                                  ]
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "text",
                                    "media",
                                    "audio",
                                    "location",
                                    "contact",
                                    "auth"
                                  ]
                                },
                                "timestamp": {
                                  "type": "string"
                                },
                                "text": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "vendorId",
                                "sender",
                                "type",
                                "timestamp",
                                "text"
                              ]
                            },
                            "assignedUserId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "assignedTeamId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "isSensitive": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "id",
                            "createdAt",
                            "updatedAt",
                            "status",
                            "isUnread",
                            "openUntil",
                            "unreadCount",
                            "channelId",
                            "contactId",
                            "handleId",
                            "latestMessage",
                            "assignedUserId",
                            "assignedTeamId",
                            "isSensitive"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "chatId",
                        "channelId",
                        "type",
                        "sender",
                        "sources",
                        "status",
                        "scheduledAt",
                        "content",
                        "forwarded",
                        "reactions",
                        "errors",
                        "history",
                        "vendorId",
                        "timestamp",
                        "vendorDetails",
                        "metadata",
                        "isSensitive",
                        "aiGenerationId"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "chatId": "string",
                    "channelId": "string",
                    "type": "message",
                    "sender": "outbound",
                    "sources": [],
                    "status": "none",
                    "scheduledAt": "string",
                    "content": {
                      "body": "string",
                      "attachments": [],
                      "header": "string",
                      "footer": "string",
                      "payload": "string"
                    },
                    "forwarded": true,
                    "replyTo": {
                      "id": "string",
                      "vendorId": "string",
                      "sender": "outbound",
                      "type": "text",
                      "timestamp": "string",
                      "text": "string"
                    },
                    "reactions": [],
                    "errors": [],
                    "history": [],
                    "vendorId": "string",
                    "timestamp": "string",
                    "vendorDetails": {
                      "whatsapp": {
                        "context": {
                          "frequentlyForwarded": true,
                          "referredProduct": {
                            "catalogId": "string",
                            "productRetailerId": "string"
                          }
                        },
                        "order": {
                          "catalogId": "string",
                          "productItems": []
                        }
                      },
                      "instagram": {
                        "commentId": "string"
                      },
                      "messenger": {
                        "commentId": "string"
                      }
                    },
                    "metadata": {
                      "campaignContactId": "string",
                      "campaignExecutionId": "string"
                    },
                    "isSensitive": true,
                    "aiGenerationId": "string",
                    "chat": {
                      "id": "string",
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z",
                      "status": "open",
                      "isUnread": true,
                      "openUntil": "string",
                      "unreadCount": 0,
                      "channelId": "string",
                      "contactId": "string",
                      "contact": {
                        "id": "string",
                        "createdAt": "2024-01-01T00:00:00.000Z",
                        "updatedAt": "2024-01-01T00:00:00.000Z",
                        "firstName": "string",
                        "lastName": "string",
                        "fullName": "string",
                        "isSubscribed": true,
                        "handles": [],
                        "labels": [],
                        "attributes": [],
                        "displayName": "string",
                        "phoneNumber": "string",
                        "email": "string",
                        "chats": [],
                        "metadata": {}
                      },
                      "handleId": "string",
                      "handle": {
                        "id": "string",
                        "createdAt": "2024-01-01T00:00:00.000Z",
                        "updatedAt": "2024-01-01T00:00:00.000Z",
                        "type": "phone_number",
                        "isPrimary": true,
                        "value": "string",
                        "extra": {},
                        "hasChats": true
                      },
                      "latestMessage": {
                        "id": "string",
                        "vendorId": "string",
                        "sender": "outbound",
                        "type": "text",
                        "timestamp": "string",
                        "text": "string"
                      },
                      "assignedUserId": "string",
                      "assignedTeamId": "string",
                      "isSensitive": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/messages/send_template": {
      "post": {
        "summary": "Send template message",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "chat": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "chatId": {
                            "type": "string",
                            "format": "uuid"
                          }
                        },
                        "required": [
                          "chatId"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "channelId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "contactId": {
                            "type": "string",
                            "format": "uuid"
                          }
                        },
                        "required": [
                          "channelId",
                          "contactId"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "channelId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "phoneNumber": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "channelId",
                          "phoneNumber"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "channelId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "email": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "channelId",
                          "email"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "channelId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "handleId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "channelId",
                          "handleId"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "messageTemplate": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "attachments": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "fileId": {
                              "type": "string",
                              "format": "uuid"
                            }
                          },
                          "required": [
                            "id",
                            "fileId"
                          ]
                        }
                      },
                      "variables": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "id"
                    ]
                  },
                  "scheduledAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "chat",
                  "messageTemplate"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "chatId": {
                          "type": "string"
                        },
                        "channelId": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "message",
                            "note",
                            "chat_open",
                            "chat_close",
                            "chat_snoozed",
                            "chat_assigned",
                            "vendor_comment",
                            "ai_tool_call"
                          ]
                        },
                        "sender": {
                          "type": "string",
                          "enum": [
                            "outbound",
                            "inbound",
                            "unknown",
                            "system"
                          ]
                        },
                        "sources": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "campaign"
                                    ]
                                  },
                                  "campaignExecutionId": {
                                    "type": "string",
                                    "format": "uuid"
                                  }
                                },
                                "required": [
                                  "type",
                                  "campaignExecutionId"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "automation"
                                    ]
                                  },
                                  "automationActionExecutionId": {
                                    "type": "string",
                                    "format": "uuid"
                                  }
                                },
                                "required": [
                                  "type",
                                  "automationActionExecutionId"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "inbox"
                                    ]
                                  },
                                  "userId": {
                                    "type": "string",
                                    "format": "uuid"
                                  }
                                },
                                "required": [
                                  "type",
                                  "userId"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "vendor"
                                    ]
                                  }
                                },
                                "required": [
                                  "type"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "api"
                                    ]
                                  },
                                  "apiKeyId": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type",
                                  "apiKeyId"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "ai_agent"
                                    ]
                                  },
                                  "aiAgentId": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type",
                                  "aiAgentId"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "system"
                                    ]
                                  }
                                },
                                "required": [
                                  "type"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "none",
                            "pending",
                            "sent",
                            "delivered",
                            "read",
                            "scheduled",
                            "deleted",
                            "failed"
                          ]
                        },
                        "scheduledAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "content": {
                          "type": "object",
                          "properties": {
                            "body": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "attachments": {
                              "type": "array",
                              "items": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "image"
                                        ]
                                      },
                                      "file": {
                                        "type": [
                                          "object",
                                          "null"
                                        ],
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "createdAt": {
                                            "type": "string"
                                          },
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "image",
                                              "video",
                                              "audio",
                                              "document"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "contentType": {
                                            "type": "string"
                                          },
                                          "url": {
                                            "type": "string"
                                          },
                                          "size": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "createdAt",
                                          "type",
                                          "name",
                                          "contentType",
                                          "url",
                                          "size"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "video"
                                        ]
                                      },
                                      "file": {
                                        "type": [
                                          "object",
                                          "null"
                                        ],
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "createdAt": {
                                            "type": "string"
                                          },
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "image",
                                              "video",
                                              "audio",
                                              "document"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "contentType": {
                                            "type": "string"
                                          },
                                          "url": {
                                            "type": "string"
                                          },
                                          "size": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "createdAt",
                                          "type",
                                          "name",
                                          "contentType",
                                          "url",
                                          "size"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "document"
                                        ]
                                      },
                                      "file": {
                                        "type": [
                                          "object",
                                          "null"
                                        ],
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "createdAt": {
                                            "type": "string"
                                          },
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "image",
                                              "video",
                                              "audio",
                                              "document"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "contentType": {
                                            "type": "string"
                                          },
                                          "url": {
                                            "type": "string"
                                          },
                                          "size": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "createdAt",
                                          "type",
                                          "name",
                                          "contentType",
                                          "url",
                                          "size"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "audio"
                                        ]
                                      },
                                      "file": {
                                        "type": [
                                          "object",
                                          "null"
                                        ],
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "createdAt": {
                                            "type": "string"
                                          },
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "image",
                                              "video",
                                              "audio",
                                              "document"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "contentType": {
                                            "type": "string"
                                          },
                                          "url": {
                                            "type": "string"
                                          },
                                          "size": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "createdAt",
                                          "type",
                                          "name",
                                          "contentType",
                                          "url",
                                          "size"
                                        ]
                                      },
                                      "isVoice": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "location"
                                        ]
                                      },
                                      "latitude": {
                                        "type": [
                                          "number",
                                          "null"
                                        ]
                                      },
                                      "longitude": {
                                        "type": [
                                          "number",
                                          "null"
                                        ]
                                      },
                                      "name": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "address": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "contact"
                                        ]
                                      },
                                      "addresses": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "street": {
                                              "type": "string"
                                            },
                                            "city": {
                                              "type": "string"
                                            },
                                            "state": {
                                              "type": "string"
                                            },
                                            "zip": {
                                              "type": "string"
                                            },
                                            "country": {
                                              "type": "string"
                                            },
                                            "countryCode": {
                                              "type": "string"
                                            },
                                            "type": {
                                              "type": "string"
                                            }
                                          }
                                        }
                                      },
                                      "birthday": {
                                        "type": "string"
                                      },
                                      "emails": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "email": {
                                              "type": "string"
                                            },
                                            "type": {
                                              "type": "string"
                                            }
                                          }
                                        }
                                      },
                                      "name": {
                                        "type": "object",
                                        "properties": {
                                          "formattedName": {
                                            "type": "string"
                                          },
                                          "firstName": {
                                            "type": "string"
                                          },
                                          "lastName": {
                                            "type": "string"
                                          },
                                          "middleName": {
                                            "type": "string"
                                          },
                                          "suffix": {
                                            "type": "string"
                                          },
                                          "prefix": {
                                            "type": "string"
                                          }
                                        }
                                      },
                                      "org": {
                                        "type": "object",
                                        "properties": {
                                          "company": {
                                            "type": "string"
                                          },
                                          "department": {
                                            "type": "string"
                                          },
                                          "title": {
                                            "type": "string"
                                          }
                                        }
                                      },
                                      "phones": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "phone": {
                                              "type": "string"
                                            },
                                            "type": {
                                              "type": "string"
                                            }
                                          }
                                        }
                                      },
                                      "urls": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "url": {
                                              "type": "string"
                                            },
                                            "type": {
                                              "type": "string"
                                            }
                                          }
                                        }
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "button"
                                        ]
                                      },
                                      "buttonType": {
                                        "type": "string",
                                        "enum": [
                                          "quick_reply",
                                          "url",
                                          "phone_number",
                                          "list_title"
                                        ]
                                      },
                                      "text": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "data": {
                                        "type": [
                                          "object",
                                          "null"
                                        ],
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "phone_number",
                                              "static_url",
                                              "dynamic_url"
                                            ]
                                          },
                                          "phoneNumber": {
                                            "type": "string"
                                          },
                                          "url": {
                                            "type": "string"
                                          },
                                          "urlExtension": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      },
                                      "payload": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type",
                                      "buttonType",
                                      "text"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "list_section"
                                        ]
                                      },
                                      "title": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "rows": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string"
                                            },
                                            "title": {
                                              "type": "string"
                                            },
                                            "description": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "title",
                                            "description"
                                          ]
                                        }
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type",
                                      "title",
                                      "rows"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "quick_reply"
                                        ]
                                      },
                                      "text": {
                                        "type": "string"
                                      },
                                      "payload": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type",
                                      "text",
                                      "payload"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "comment"
                                        ]
                                      },
                                      "text": {
                                        "type": "string"
                                      },
                                      "commentId": {
                                        "type": "string"
                                      },
                                      "mediaId": {
                                        "type": "string"
                                      },
                                      "file": {
                                        "type": [
                                          "object",
                                          "null"
                                        ],
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "createdAt": {
                                            "type": "string"
                                          },
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "image",
                                              "video",
                                              "audio",
                                              "document"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "contentType": {
                                            "type": "string"
                                          },
                                          "url": {
                                            "type": "string"
                                          },
                                          "size": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "createdAt",
                                          "type",
                                          "name",
                                          "contentType",
                                          "url",
                                          "size"
                                        ]
                                      },
                                      "mediaUrl": {
                                        "type": "string"
                                      },
                                      "mediaType": {
                                        "type": "string",
                                        "enum": [
                                          "IMAGE",
                                          "VIDEO",
                                          "CAROUSEL_ALBUM"
                                        ]
                                      },
                                      "mediaProductType": {
                                        "type": "string",
                                        "enum": [
                                          "FEED",
                                          "REELS",
                                          "STORY"
                                        ]
                                      },
                                      "platform": {
                                        "type": "string",
                                        "enum": [
                                          "instagram",
                                          "facebook"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type",
                                      "text"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "ai_tool_call"
                                        ]
                                      },
                                      "toolCallId": {
                                        "type": "string"
                                      },
                                      "toolName": {
                                        "type": "string"
                                      },
                                      "input": {},
                                      "output": {},
                                      "providerDetails": {}
                                    },
                                    "required": [
                                      "id",
                                      "type",
                                      "toolCallId",
                                      "toolName",
                                      "input",
                                      "output",
                                      "providerDetails"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "referral"
                                        ]
                                      },
                                      "source": {
                                        "type": "string",
                                        "enum": [
                                          "whatsapp"
                                        ]
                                      },
                                      "sourceUrl": {
                                        "type": "string"
                                      },
                                      "sourceType": {
                                        "type": "string"
                                      },
                                      "sourceId": {
                                        "type": "string"
                                      },
                                      "headline": {
                                        "type": "string"
                                      },
                                      "body": {
                                        "type": "string"
                                      },
                                      "mediaType": {
                                        "type": "string"
                                      },
                                      "imageUrl": {
                                        "type": "string"
                                      },
                                      "videoUrl": {
                                        "type": "string"
                                      },
                                      "thumbnailUrl": {
                                        "type": "string"
                                      },
                                      "ctwaClid": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type",
                                      "source"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "content_reference"
                                        ]
                                      },
                                      "contentType": {
                                        "type": "string",
                                        "enum": [
                                          "story"
                                        ]
                                      },
                                      "url": {
                                        "type": "string"
                                      },
                                      "externalId": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type",
                                      "contentType",
                                      "url"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "auth"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type"
                                    ]
                                  }
                                ]
                              }
                            },
                            "header": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "footer": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "payload": {
                              "type": "string"
                            }
                          }
                        },
                        "forwarded": {
                          "type": "boolean"
                        },
                        "replyTo": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "vendorId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "sender": {
                              "type": "string",
                              "enum": [
                                "outbound",
                                "inbound",
                                "unknown",
                                "system"
                              ]
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "text",
                                "media",
                                "audio",
                                "location",
                                "contact",
                                "auth"
                              ]
                            },
                            "timestamp": {
                              "type": "string"
                            },
                            "text": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "vendorId",
                            "sender",
                            "type",
                            "timestamp",
                            "text"
                          ]
                        },
                        "reactions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "sender": {
                                "type": "string",
                                "enum": [
                                  "outbound",
                                  "inbound",
                                  "unknown",
                                  "system"
                                ]
                              },
                              "userId": {
                                "type": "string"
                              },
                              "text": {
                                "type": "string"
                              },
                              "timestamp": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "sender",
                              "text",
                              "timestamp"
                            ]
                          }
                        },
                        "errors": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "messageKey": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "vendorError": {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  },
                                  "title": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "type": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "message": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "errorData": {
                                    "type": "object",
                                    "properties": {
                                      "messagingProduct": {
                                        "type": "string"
                                      },
                                      "details": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "fbtraceId": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                }
                              }
                            },
                            "required": [
                              "messageKey",
                              "message"
                            ]
                          }
                        },
                        "history": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "event": {
                                "type": "string",
                                "enum": [
                                  "status_update"
                                ]
                              },
                              "newStatus": {
                                "type": "string",
                                "enum": [
                                  "none",
                                  "pending",
                                  "sent",
                                  "delivered",
                                  "read",
                                  "scheduled",
                                  "deleted",
                                  "failed"
                                ]
                              },
                              "timestamp": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "event",
                              "newStatus",
                              "timestamp"
                            ]
                          }
                        },
                        "vendorId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "timestamp": {
                          "type": "string"
                        },
                        "vendorDetails": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "whatsapp": {
                              "type": "object",
                              "properties": {
                                "context": {
                                  "type": "object",
                                  "properties": {
                                    "frequentlyForwarded": {
                                      "type": "boolean"
                                    },
                                    "referredProduct": {
                                      "type": "object",
                                      "properties": {
                                        "catalogId": {
                                          "type": "string"
                                        },
                                        "productRetailerId": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "catalogId",
                                        "productRetailerId"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "frequentlyForwarded"
                                  ]
                                },
                                "order": {
                                  "type": "object",
                                  "properties": {
                                    "catalogId": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "productItems": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "productRetailerId": {
                                            "type": "string"
                                          },
                                          "quantity": {
                                            "type": "string"
                                          },
                                          "itemPrice": {
                                            "type": "string"
                                          },
                                          "currency": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "productRetailerId",
                                          "quantity",
                                          "itemPrice",
                                          "currency"
                                        ]
                                      }
                                    }
                                  }
                                }
                              }
                            },
                            "instagram": {
                              "type": "object",
                              "properties": {
                                "commentId": {
                                  "type": "string"
                                }
                              }
                            },
                            "messenger": {
                              "type": "object",
                              "properties": {
                                "commentId": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        },
                        "metadata": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "campaignContactId": {
                              "type": "string"
                            },
                            "campaignExecutionId": {
                              "type": "string"
                            }
                          }
                        },
                        "isSensitive": {
                          "type": "boolean"
                        },
                        "aiGenerationId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "chat": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "open",
                                "closed",
                                "snoozed"
                              ]
                            },
                            "isUnread": {
                              "type": "boolean"
                            },
                            "openUntil": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "unreadCount": {
                              "type": "number"
                            },
                            "channelId": {
                              "type": "string"
                            },
                            "contactId": {
                              "type": "string"
                            },
                            "handleId": {
                              "type": "string"
                            },
                            "latestMessage": {
                              "type": [
                                "object",
                                "null"
                              ],
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "vendorId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "sender": {
                                  "type": "string",
                                  "enum": [
                                    "outbound",
                                    "inbound",
                                    "unknown",
                                    "system"
                                  ]
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "text",
                                    "media",
                                    "audio",
                                    "location",
                                    "contact",
                                    "auth"
                                  ]
                                },
                                "timestamp": {
                                  "type": "string"
                                },
                                "text": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "vendorId",
                                "sender",
                                "type",
                                "timestamp",
                                "text"
                              ]
                            },
                            "assignedUserId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "assignedTeamId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "isSensitive": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "id",
                            "createdAt",
                            "updatedAt",
                            "status",
                            "isUnread",
                            "openUntil",
                            "unreadCount",
                            "channelId",
                            "contactId",
                            "handleId",
                            "latestMessage",
                            "assignedUserId",
                            "assignedTeamId",
                            "isSensitive"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "chatId",
                        "channelId",
                        "type",
                        "sender",
                        "sources",
                        "status",
                        "scheduledAt",
                        "content",
                        "forwarded",
                        "reactions",
                        "errors",
                        "history",
                        "vendorId",
                        "timestamp",
                        "vendorDetails",
                        "metadata",
                        "isSensitive",
                        "aiGenerationId"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "chatId": "string",
                    "channelId": "string",
                    "type": "message",
                    "sender": "outbound",
                    "sources": [],
                    "status": "none",
                    "scheduledAt": "string",
                    "content": {
                      "body": "string",
                      "attachments": [],
                      "header": "string",
                      "footer": "string",
                      "payload": "string"
                    },
                    "forwarded": true,
                    "replyTo": {
                      "id": "string",
                      "vendorId": "string",
                      "sender": "outbound",
                      "type": "text",
                      "timestamp": "string",
                      "text": "string"
                    },
                    "reactions": [],
                    "errors": [],
                    "history": [],
                    "vendorId": "string",
                    "timestamp": "string",
                    "vendorDetails": {
                      "whatsapp": {
                        "context": {
                          "frequentlyForwarded": true,
                          "referredProduct": {
                            "catalogId": "string",
                            "productRetailerId": "string"
                          }
                        },
                        "order": {
                          "catalogId": "string",
                          "productItems": []
                        }
                      },
                      "instagram": {
                        "commentId": "string"
                      },
                      "messenger": {
                        "commentId": "string"
                      }
                    },
                    "metadata": {
                      "campaignContactId": "string",
                      "campaignExecutionId": "string"
                    },
                    "isSensitive": true,
                    "aiGenerationId": "string",
                    "chat": {
                      "id": "string",
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z",
                      "status": "open",
                      "isUnread": true,
                      "openUntil": "string",
                      "unreadCount": 0,
                      "channelId": "string",
                      "contactId": "string",
                      "contact": {
                        "id": "string",
                        "createdAt": "2024-01-01T00:00:00.000Z",
                        "updatedAt": "2024-01-01T00:00:00.000Z",
                        "firstName": "string",
                        "lastName": "string",
                        "fullName": "string",
                        "isSubscribed": true,
                        "handles": [],
                        "labels": [],
                        "attributes": [],
                        "displayName": "string",
                        "phoneNumber": "string",
                        "email": "string",
                        "chats": [],
                        "metadata": {}
                      },
                      "handleId": "string",
                      "handle": {
                        "id": "string",
                        "createdAt": "2024-01-01T00:00:00.000Z",
                        "updatedAt": "2024-01-01T00:00:00.000Z",
                        "type": "phone_number",
                        "isPrimary": true,
                        "value": "string",
                        "extra": {},
                        "hasChats": true
                      },
                      "latestMessage": {
                        "id": "string",
                        "vendorId": "string",
                        "sender": "outbound",
                        "type": "text",
                        "timestamp": "string",
                        "text": "string"
                      },
                      "assignedUserId": "string",
                      "assignedTeamId": "string",
                      "isSensitive": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/message_templates/search": {
      "post": {
        "summary": "Search message templates",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Structured filter expression. See [Query syntax](/api-reference/v3/query) for expression functions. Filterable fields: `id`, `createdAt`, `updatedAt`, `name`, `vendorId`, `status`, `channelId`, `type`, `vendorDetailsName`."
                  },
                  "sortBy": {
                    "type": "string",
                    "description": "Sort expression. See [Sort By syntax](/api-reference/v3/sort-by) for expression functions. Sortable fields: `id`, `createdAt`, `updatedAt`, `name`, `vendorId`, `status`, `channelId`, `type`, `vendorDetailsName`."
                  },
                  "search": {
                    "type": "string",
                    "description": "Free-text search by `name`. See [Search](/api-reference/v3/search)."
                  },
                  "pagination": {
                    "type": "object",
                    "properties": {
                      "page": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Zero-based page index. Defaults to 0 when omitted."
                      },
                      "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "description": "Rows per page. Defaults to 10 when omitted. Maximum 100."
                      }
                    },
                    "required": [
                      "page",
                      "limit"
                    ],
                    "additionalProperties": false,
                    "description": "Page through results. Defaults to page 0 and limit 10 when omitted. See [Pagination](/api-reference/v3/pagination)."
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "whatsapp"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "in_review",
                              "active",
                              "rejected",
                              "unavailable"
                            ]
                          },
                          "vendorId": {
                            "type": "string"
                          },
                          "messageContent": {
                            "type": "object",
                            "properties": {
                              "body": {
                                "type": "string"
                              },
                              "code": {
                                "type": "string"
                              },
                              "attachments": {
                                "type": "array",
                                "items": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string",
                                          "enum": [
                                            "image",
                                            "video",
                                            "document"
                                          ]
                                        },
                                        "fileId": {
                                          "type": "string"
                                        },
                                        "file": {
                                          "type": [
                                            "object",
                                            "null"
                                          ],
                                          "properties": {
                                            "id": {
                                              "type": "string"
                                            },
                                            "createdAt": {
                                              "type": "string"
                                            },
                                            "type": {
                                              "type": "string",
                                              "enum": [
                                                "image",
                                                "video",
                                                "audio",
                                                "document"
                                              ]
                                            },
                                            "name": {
                                              "type": "string"
                                            },
                                            "contentType": {
                                              "type": "string"
                                            },
                                            "url": {
                                              "type": "string"
                                            },
                                            "size": {
                                              "type": "number"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "createdAt",
                                            "type",
                                            "name",
                                            "contentType",
                                            "url",
                                            "size"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "type",
                                        "fileId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "enum": [
                                            "button"
                                          ]
                                        },
                                        "buttonType": {
                                          "type": "string",
                                          "enum": [
                                            "quick_reply"
                                          ]
                                        },
                                        "text": {
                                          "type": "string"
                                        },
                                        "id": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "buttonType",
                                        "text",
                                        "id"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "enum": [
                                            "button"
                                          ]
                                        },
                                        "buttonType": {
                                          "type": "string",
                                          "enum": [
                                            "url"
                                          ]
                                        },
                                        "text": {
                                          "type": "string"
                                        },
                                        "url": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "id": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "buttonType",
                                        "text",
                                        "url",
                                        "id"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "enum": [
                                            "button"
                                          ]
                                        },
                                        "buttonType": {
                                          "type": "string",
                                          "enum": [
                                            "phone_number"
                                          ]
                                        },
                                        "text": {
                                          "type": "string"
                                        },
                                        "phoneNumber": {
                                          "type": "string"
                                        },
                                        "id": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "buttonType",
                                        "text",
                                        "phoneNumber",
                                        "id"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "enum": [
                                            "button"
                                          ]
                                        },
                                        "buttonType": {
                                          "type": "string",
                                          "enum": [
                                            "list_title"
                                          ]
                                        },
                                        "text": {
                                          "type": "string"
                                        },
                                        "id": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "buttonType",
                                        "text",
                                        "id"
                                      ]
                                    }
                                  ]
                                }
                              },
                              "header": {
                                "type": "string"
                              },
                              "footer": {
                                "type": "string"
                              }
                            }
                          },
                          "variables": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "vendorDetails": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "language": {
                                "type": "string",
                                "enum": [
                                  "af",
                                  "sq",
                                  "ar",
                                  "az",
                                  "bn",
                                  "bg",
                                  "ca",
                                  "zh_CN",
                                  "zh_HK",
                                  "zh_TW",
                                  "hr",
                                  "cs",
                                  "da",
                                  "nl",
                                  "en",
                                  "en_GB",
                                  "en_US",
                                  "et",
                                  "fil",
                                  "fi",
                                  "fr",
                                  "ka",
                                  "de",
                                  "el",
                                  "gu",
                                  "ha",
                                  "he",
                                  "hi",
                                  "hu",
                                  "id",
                                  "ga",
                                  "it",
                                  "ja",
                                  "kn",
                                  "kk",
                                  "rw_RW",
                                  "ko",
                                  "ky_KG",
                                  "lo",
                                  "lv",
                                  "lt",
                                  "mk",
                                  "ms",
                                  "ml",
                                  "mr",
                                  "nb",
                                  "fa",
                                  "pl",
                                  "pt_BR",
                                  "pt_PT",
                                  "pa",
                                  "ro",
                                  "ru",
                                  "sr",
                                  "sk",
                                  "sl",
                                  "es",
                                  "es_AR",
                                  "es_ES",
                                  "es_MX",
                                  "sw",
                                  "sv",
                                  "ta",
                                  "te",
                                  "th",
                                  "tr",
                                  "uk",
                                  "ur",
                                  "uz",
                                  "vi",
                                  "zu"
                                ]
                              },
                              "category": {
                                "type": "string",
                                "enum": [
                                  "authentication",
                                  "marketing",
                                  "utility"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "in_appeal",
                                  "approved",
                                  "rejected",
                                  "pending_deletion",
                                  "deleted",
                                  "disabled",
                                  "paused",
                                  "limit_exceeded"
                                ]
                              },
                              "addSecurityRecommendation": {
                                "type": "boolean"
                              },
                              "codeExpirationMinutes": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 90
                              },
                              "copyCodeButtonText": {
                                "type": "string"
                              },
                              "otpType": {
                                "type": "string",
                                "enum": [
                                  "copy_code",
                                  "one_tap",
                                  "zero_tap"
                                ]
                              },
                              "autofillButtonText": {
                                "type": "string"
                              },
                              "zeroTapTermsAccepted": {
                                "type": "boolean"
                              },
                              "supportedApps": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "packageName": {
                                      "type": "string"
                                    },
                                    "signatureHash": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "packageName",
                                    "signatureHash"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "name",
                              "language",
                              "category",
                              "status"
                            ]
                          },
                          "channelId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "createdAt",
                          "updatedAt",
                          "name",
                          "type",
                          "status",
                          "vendorId",
                          "messageContent",
                          "variables",
                          "vendorDetails",
                          "channelId"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "limit": {
                          "type": "integer",
                          "maximum": 1000
                        },
                        "total": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "query": {
                      "type": "object",
                      "properties": {
                        "query": {
                          "type": "string"
                        },
                        "sortBy": {
                          "type": "string"
                        },
                        "search": {
                          "type": "string"
                        }
                      }
                    },
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "pagination",
                    "query",
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": [],
                  "pagination": {
                    "page": 0,
                    "limit": 0,
                    "total": 0
                  },
                  "query": {
                    "query": "string",
                    "sortBy": "string",
                    "search": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/message_templates/{messageTemplateId}": {
      "get": {
        "summary": "Get message template",
        "parameters": [
          {
            "name": "messageTemplateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "name": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "whatsapp"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "in_review",
                            "active",
                            "rejected",
                            "unavailable"
                          ]
                        },
                        "vendorId": {
                          "type": "string"
                        },
                        "messageContent": {
                          "type": "object",
                          "properties": {
                            "body": {
                              "type": "string"
                            },
                            "code": {
                              "type": "string"
                            },
                            "attachments": {
                              "type": "array",
                              "items": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "image",
                                          "video",
                                          "document"
                                        ]
                                      },
                                      "fileId": {
                                        "type": "string"
                                      },
                                      "file": {
                                        "type": [
                                          "object",
                                          "null"
                                        ],
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "createdAt": {
                                            "type": "string"
                                          },
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "image",
                                              "video",
                                              "audio",
                                              "document"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "contentType": {
                                            "type": "string"
                                          },
                                          "url": {
                                            "type": "string"
                                          },
                                          "size": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "createdAt",
                                          "type",
                                          "name",
                                          "contentType",
                                          "url",
                                          "size"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type",
                                      "fileId"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "button"
                                        ]
                                      },
                                      "buttonType": {
                                        "type": "string",
                                        "enum": [
                                          "quick_reply"
                                        ]
                                      },
                                      "text": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "buttonType",
                                      "text",
                                      "id"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "button"
                                        ]
                                      },
                                      "buttonType": {
                                        "type": "string",
                                        "enum": [
                                          "url"
                                        ]
                                      },
                                      "text": {
                                        "type": "string"
                                      },
                                      "url": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "buttonType",
                                      "text",
                                      "url",
                                      "id"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "button"
                                        ]
                                      },
                                      "buttonType": {
                                        "type": "string",
                                        "enum": [
                                          "phone_number"
                                        ]
                                      },
                                      "text": {
                                        "type": "string"
                                      },
                                      "phoneNumber": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "buttonType",
                                      "text",
                                      "phoneNumber",
                                      "id"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "button"
                                        ]
                                      },
                                      "buttonType": {
                                        "type": "string",
                                        "enum": [
                                          "list_title"
                                        ]
                                      },
                                      "text": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "buttonType",
                                      "text",
                                      "id"
                                    ]
                                  }
                                ]
                              }
                            },
                            "header": {
                              "type": "string"
                            },
                            "footer": {
                              "type": "string"
                            }
                          }
                        },
                        "variables": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "vendorDetails": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "language": {
                              "type": "string",
                              "enum": [
                                "af",
                                "sq",
                                "ar",
                                "az",
                                "bn",
                                "bg",
                                "ca",
                                "zh_CN",
                                "zh_HK",
                                "zh_TW",
                                "hr",
                                "cs",
                                "da",
                                "nl",
                                "en",
                                "en_GB",
                                "en_US",
                                "et",
                                "fil",
                                "fi",
                                "fr",
                                "ka",
                                "de",
                                "el",
                                "gu",
                                "ha",
                                "he",
                                "hi",
                                "hu",
                                "id",
                                "ga",
                                "it",
                                "ja",
                                "kn",
                                "kk",
                                "rw_RW",
                                "ko",
                                "ky_KG",
                                "lo",
                                "lv",
                                "lt",
                                "mk",
                                "ms",
                                "ml",
                                "mr",
                                "nb",
                                "fa",
                                "pl",
                                "pt_BR",
                                "pt_PT",
                                "pa",
                                "ro",
                                "ru",
                                "sr",
                                "sk",
                                "sl",
                                "es",
                                "es_AR",
                                "es_ES",
                                "es_MX",
                                "sw",
                                "sv",
                                "ta",
                                "te",
                                "th",
                                "tr",
                                "uk",
                                "ur",
                                "uz",
                                "vi",
                                "zu"
                              ]
                            },
                            "category": {
                              "type": "string",
                              "enum": [
                                "authentication",
                                "marketing",
                                "utility"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "in_appeal",
                                "approved",
                                "rejected",
                                "pending_deletion",
                                "deleted",
                                "disabled",
                                "paused",
                                "limit_exceeded"
                              ]
                            },
                            "addSecurityRecommendation": {
                              "type": "boolean"
                            },
                            "codeExpirationMinutes": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 90
                            },
                            "copyCodeButtonText": {
                              "type": "string"
                            },
                            "otpType": {
                              "type": "string",
                              "enum": [
                                "copy_code",
                                "one_tap",
                                "zero_tap"
                              ]
                            },
                            "autofillButtonText": {
                              "type": "string"
                            },
                            "zeroTapTermsAccepted": {
                              "type": "boolean"
                            },
                            "supportedApps": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "packageName": {
                                    "type": "string"
                                  },
                                  "signatureHash": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "packageName",
                                  "signatureHash"
                                ]
                              }
                            }
                          },
                          "required": [
                            "name",
                            "language",
                            "category",
                            "status"
                          ]
                        },
                        "channelId": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "name",
                        "type",
                        "status",
                        "vendorId",
                        "messageContent",
                        "variables",
                        "vendorDetails",
                        "channelId"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "name": "string",
                    "type": "whatsapp",
                    "status": "in_review",
                    "vendorId": "string",
                    "messageContent": {
                      "body": "string",
                      "code": "string",
                      "attachments": [],
                      "header": "string",
                      "footer": "string"
                    },
                    "variables": [],
                    "vendorDetails": {
                      "name": "string",
                      "language": "af",
                      "category": "authentication",
                      "status": "pending",
                      "addSecurityRecommendation": true,
                      "codeExpirationMinutes": 0,
                      "copyCodeButtonText": "string",
                      "otpType": "copy_code",
                      "autofillButtonText": "string",
                      "zeroTapTermsAccepted": true,
                      "supportedApps": []
                    },
                    "channelId": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Update message template",
        "parameters": [
          {
            "name": "messageTemplateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "name": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "whatsapp"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "in_review",
                            "active",
                            "rejected",
                            "unavailable"
                          ]
                        },
                        "vendorId": {
                          "type": "string"
                        },
                        "messageContent": {
                          "type": "object",
                          "properties": {
                            "body": {
                              "type": "string"
                            },
                            "code": {
                              "type": "string"
                            },
                            "attachments": {
                              "type": "array",
                              "items": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "image",
                                          "video",
                                          "document"
                                        ]
                                      },
                                      "fileId": {
                                        "type": "string"
                                      },
                                      "file": {
                                        "type": [
                                          "object",
                                          "null"
                                        ],
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "createdAt": {
                                            "type": "string"
                                          },
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "image",
                                              "video",
                                              "audio",
                                              "document"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "contentType": {
                                            "type": "string"
                                          },
                                          "url": {
                                            "type": "string"
                                          },
                                          "size": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "createdAt",
                                          "type",
                                          "name",
                                          "contentType",
                                          "url",
                                          "size"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type",
                                      "fileId"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "button"
                                        ]
                                      },
                                      "buttonType": {
                                        "type": "string",
                                        "enum": [
                                          "quick_reply"
                                        ]
                                      },
                                      "text": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "buttonType",
                                      "text",
                                      "id"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "button"
                                        ]
                                      },
                                      "buttonType": {
                                        "type": "string",
                                        "enum": [
                                          "url"
                                        ]
                                      },
                                      "text": {
                                        "type": "string"
                                      },
                                      "url": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "buttonType",
                                      "text",
                                      "url",
                                      "id"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "button"
                                        ]
                                      },
                                      "buttonType": {
                                        "type": "string",
                                        "enum": [
                                          "phone_number"
                                        ]
                                      },
                                      "text": {
                                        "type": "string"
                                      },
                                      "phoneNumber": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "buttonType",
                                      "text",
                                      "phoneNumber",
                                      "id"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "button"
                                        ]
                                      },
                                      "buttonType": {
                                        "type": "string",
                                        "enum": [
                                          "list_title"
                                        ]
                                      },
                                      "text": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "buttonType",
                                      "text",
                                      "id"
                                    ]
                                  }
                                ]
                              }
                            },
                            "header": {
                              "type": "string"
                            },
                            "footer": {
                              "type": "string"
                            }
                          }
                        },
                        "variables": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "vendorDetails": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "language": {
                              "type": "string",
                              "enum": [
                                "af",
                                "sq",
                                "ar",
                                "az",
                                "bn",
                                "bg",
                                "ca",
                                "zh_CN",
                                "zh_HK",
                                "zh_TW",
                                "hr",
                                "cs",
                                "da",
                                "nl",
                                "en",
                                "en_GB",
                                "en_US",
                                "et",
                                "fil",
                                "fi",
                                "fr",
                                "ka",
                                "de",
                                "el",
                                "gu",
                                "ha",
                                "he",
                                "hi",
                                "hu",
                                "id",
                                "ga",
                                "it",
                                "ja",
                                "kn",
                                "kk",
                                "rw_RW",
                                "ko",
                                "ky_KG",
                                "lo",
                                "lv",
                                "lt",
                                "mk",
                                "ms",
                                "ml",
                                "mr",
                                "nb",
                                "fa",
                                "pl",
                                "pt_BR",
                                "pt_PT",
                                "pa",
                                "ro",
                                "ru",
                                "sr",
                                "sk",
                                "sl",
                                "es",
                                "es_AR",
                                "es_ES",
                                "es_MX",
                                "sw",
                                "sv",
                                "ta",
                                "te",
                                "th",
                                "tr",
                                "uk",
                                "ur",
                                "uz",
                                "vi",
                                "zu"
                              ]
                            },
                            "category": {
                              "type": "string",
                              "enum": [
                                "authentication",
                                "marketing",
                                "utility"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "in_appeal",
                                "approved",
                                "rejected",
                                "pending_deletion",
                                "deleted",
                                "disabled",
                                "paused",
                                "limit_exceeded"
                              ]
                            },
                            "addSecurityRecommendation": {
                              "type": "boolean"
                            },
                            "codeExpirationMinutes": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 90
                            },
                            "copyCodeButtonText": {
                              "type": "string"
                            },
                            "otpType": {
                              "type": "string",
                              "enum": [
                                "copy_code",
                                "one_tap",
                                "zero_tap"
                              ]
                            },
                            "autofillButtonText": {
                              "type": "string"
                            },
                            "zeroTapTermsAccepted": {
                              "type": "boolean"
                            },
                            "supportedApps": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "packageName": {
                                    "type": "string"
                                  },
                                  "signatureHash": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "packageName",
                                  "signatureHash"
                                ]
                              }
                            }
                          },
                          "required": [
                            "name",
                            "language",
                            "category",
                            "status"
                          ]
                        },
                        "channelId": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "name",
                        "type",
                        "status",
                        "vendorId",
                        "messageContent",
                        "variables",
                        "vendorDetails",
                        "channelId"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "name": "string",
                    "type": "whatsapp",
                    "status": "in_review",
                    "vendorId": "string",
                    "messageContent": {
                      "body": "string",
                      "code": "string",
                      "attachments": [],
                      "header": "string",
                      "footer": "string"
                    },
                    "variables": [],
                    "vendorDetails": {
                      "name": "string",
                      "language": "af",
                      "category": "authentication",
                      "status": "pending",
                      "addSecurityRecommendation": true,
                      "codeExpirationMinutes": 0,
                      "copyCodeButtonText": "string",
                      "otpType": "copy_code",
                      "autofillButtonText": "string",
                      "zeroTapTermsAccepted": true,
                      "supportedApps": []
                    },
                    "channelId": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete message template",
        "parameters": [
          {
            "name": "messageTemplateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "notFoundIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "deletedIds",
                        "notFoundIds"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "deletedIds": [],
                    "notFoundIds": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/message_templates": {
      "post": {
        "summary": "Create message template",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "channelId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "name": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "whatsapp"
                        ]
                      },
                      "messageContent": {
                        "type": "object",
                        "properties": {
                          "body": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "attachments": {
                            "type": "array",
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "image"
                                      ]
                                    },
                                    "fileId": {
                                      "type": "string",
                                      "format": "uuid"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "fileId"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "video"
                                      ]
                                    },
                                    "fileId": {
                                      "type": "string",
                                      "format": "uuid"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "fileId"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "document"
                                      ]
                                    },
                                    "fileId": {
                                      "type": "string",
                                      "format": "uuid"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "fileId"
                                  ]
                                },
                                {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "enum": [
                                            "button"
                                          ]
                                        },
                                        "buttonType": {
                                          "type": "string",
                                          "enum": [
                                            "quick_reply"
                                          ]
                                        },
                                        "text": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "buttonType",
                                        "text"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "enum": [
                                            "button"
                                          ]
                                        },
                                        "buttonType": {
                                          "type": "string",
                                          "enum": [
                                            "url"
                                          ]
                                        },
                                        "text": {
                                          "type": "string"
                                        },
                                        "url": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "buttonType",
                                        "text",
                                        "url"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "enum": [
                                            "button"
                                          ]
                                        },
                                        "buttonType": {
                                          "type": "string",
                                          "enum": [
                                            "phone_number"
                                          ]
                                        },
                                        "text": {
                                          "type": "string"
                                        },
                                        "phoneNumber": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "buttonType",
                                        "text",
                                        "phoneNumber"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "enum": [
                                            "button"
                                          ]
                                        },
                                        "buttonType": {
                                          "type": "string",
                                          "enum": [
                                            "list_title"
                                          ]
                                        },
                                        "text": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "buttonType",
                                        "text"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          },
                          "header": {
                            "type": "string"
                          },
                          "footer": {
                            "type": "string"
                          }
                        }
                      },
                      "vendorDetails": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "whatsapp"
                            ]
                          },
                          "language": {
                            "type": "string",
                            "enum": [
                              "af",
                              "sq",
                              "ar",
                              "az",
                              "bn",
                              "bg",
                              "ca",
                              "zh_CN",
                              "zh_HK",
                              "zh_TW",
                              "hr",
                              "cs",
                              "da",
                              "nl",
                              "en",
                              "en_GB",
                              "en_US",
                              "et",
                              "fil",
                              "fi",
                              "fr",
                              "ka",
                              "de",
                              "el",
                              "gu",
                              "ha",
                              "he",
                              "hi",
                              "hu",
                              "id",
                              "ga",
                              "it",
                              "ja",
                              "kn",
                              "kk",
                              "rw_RW",
                              "ko",
                              "ky_KG",
                              "lo",
                              "lv",
                              "lt",
                              "mk",
                              "ms",
                              "ml",
                              "mr",
                              "nb",
                              "fa",
                              "pl",
                              "pt_BR",
                              "pt_PT",
                              "pa",
                              "ro",
                              "ru",
                              "sr",
                              "sk",
                              "sl",
                              "es",
                              "es_AR",
                              "es_ES",
                              "es_MX",
                              "sw",
                              "sv",
                              "ta",
                              "te",
                              "th",
                              "tr",
                              "uk",
                              "ur",
                              "uz",
                              "vi",
                              "zu"
                            ]
                          },
                          "category": {
                            "type": "string",
                            "enum": [
                              "authentication",
                              "marketing",
                              "utility"
                            ]
                          },
                          "addSecurityRecommendation": {
                            "type": "boolean"
                          },
                          "codeExpirationMinutes": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 90
                          },
                          "copyCodeButtonText": {
                            "type": "string",
                            "maxLength": 25
                          },
                          "otpType": {
                            "type": "string",
                            "enum": [
                              "copy_code",
                              "one_tap",
                              "zero_tap"
                            ]
                          },
                          "autofillButtonText": {
                            "type": "string",
                            "maxLength": 25
                          },
                          "zeroTapTermsAccepted": {
                            "type": "boolean"
                          },
                          "supportedApps": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "packageName": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "signatureHash": {
                                  "type": "string",
                                  "minLength": 11,
                                  "maxLength": 11
                                }
                              },
                              "required": [
                                "packageName",
                                "signatureHash"
                              ]
                            },
                            "maxItems": 5
                          }
                        },
                        "required": [
                          "type",
                          "language",
                          "category"
                        ]
                      }
                    },
                    "required": [
                      "channelId",
                      "name",
                      "type",
                      "messageContent",
                      "vendorDetails"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "name": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "whatsapp"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "in_review",
                            "active",
                            "rejected",
                            "unavailable"
                          ]
                        },
                        "vendorId": {
                          "type": "string"
                        },
                        "messageContent": {
                          "type": "object",
                          "properties": {
                            "body": {
                              "type": "string"
                            },
                            "code": {
                              "type": "string"
                            },
                            "attachments": {
                              "type": "array",
                              "items": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "image",
                                          "video",
                                          "document"
                                        ]
                                      },
                                      "fileId": {
                                        "type": "string"
                                      },
                                      "file": {
                                        "type": [
                                          "object",
                                          "null"
                                        ],
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "createdAt": {
                                            "type": "string"
                                          },
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "image",
                                              "video",
                                              "audio",
                                              "document"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "contentType": {
                                            "type": "string"
                                          },
                                          "url": {
                                            "type": "string"
                                          },
                                          "size": {
                                            "type": "number"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "createdAt",
                                          "type",
                                          "name",
                                          "contentType",
                                          "url",
                                          "size"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type",
                                      "fileId"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "button"
                                        ]
                                      },
                                      "buttonType": {
                                        "type": "string",
                                        "enum": [
                                          "quick_reply"
                                        ]
                                      },
                                      "text": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "buttonType",
                                      "text",
                                      "id"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "button"
                                        ]
                                      },
                                      "buttonType": {
                                        "type": "string",
                                        "enum": [
                                          "url"
                                        ]
                                      },
                                      "text": {
                                        "type": "string"
                                      },
                                      "url": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "buttonType",
                                      "text",
                                      "url",
                                      "id"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "button"
                                        ]
                                      },
                                      "buttonType": {
                                        "type": "string",
                                        "enum": [
                                          "phone_number"
                                        ]
                                      },
                                      "text": {
                                        "type": "string"
                                      },
                                      "phoneNumber": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "buttonType",
                                      "text",
                                      "phoneNumber",
                                      "id"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "button"
                                        ]
                                      },
                                      "buttonType": {
                                        "type": "string",
                                        "enum": [
                                          "list_title"
                                        ]
                                      },
                                      "text": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "buttonType",
                                      "text",
                                      "id"
                                    ]
                                  }
                                ]
                              }
                            },
                            "header": {
                              "type": "string"
                            },
                            "footer": {
                              "type": "string"
                            }
                          }
                        },
                        "variables": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "vendorDetails": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "language": {
                              "type": "string",
                              "enum": [
                                "af",
                                "sq",
                                "ar",
                                "az",
                                "bn",
                                "bg",
                                "ca",
                                "zh_CN",
                                "zh_HK",
                                "zh_TW",
                                "hr",
                                "cs",
                                "da",
                                "nl",
                                "en",
                                "en_GB",
                                "en_US",
                                "et",
                                "fil",
                                "fi",
                                "fr",
                                "ka",
                                "de",
                                "el",
                                "gu",
                                "ha",
                                "he",
                                "hi",
                                "hu",
                                "id",
                                "ga",
                                "it",
                                "ja",
                                "kn",
                                "kk",
                                "rw_RW",
                                "ko",
                                "ky_KG",
                                "lo",
                                "lv",
                                "lt",
                                "mk",
                                "ms",
                                "ml",
                                "mr",
                                "nb",
                                "fa",
                                "pl",
                                "pt_BR",
                                "pt_PT",
                                "pa",
                                "ro",
                                "ru",
                                "sr",
                                "sk",
                                "sl",
                                "es",
                                "es_AR",
                                "es_ES",
                                "es_MX",
                                "sw",
                                "sv",
                                "ta",
                                "te",
                                "th",
                                "tr",
                                "uk",
                                "ur",
                                "uz",
                                "vi",
                                "zu"
                              ]
                            },
                            "category": {
                              "type": "string",
                              "enum": [
                                "authentication",
                                "marketing",
                                "utility"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "in_appeal",
                                "approved",
                                "rejected",
                                "pending_deletion",
                                "deleted",
                                "disabled",
                                "paused",
                                "limit_exceeded"
                              ]
                            },
                            "addSecurityRecommendation": {
                              "type": "boolean"
                            },
                            "codeExpirationMinutes": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 90
                            },
                            "copyCodeButtonText": {
                              "type": "string"
                            },
                            "otpType": {
                              "type": "string",
                              "enum": [
                                "copy_code",
                                "one_tap",
                                "zero_tap"
                              ]
                            },
                            "autofillButtonText": {
                              "type": "string"
                            },
                            "zeroTapTermsAccepted": {
                              "type": "boolean"
                            },
                            "supportedApps": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "packageName": {
                                    "type": "string"
                                  },
                                  "signatureHash": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "packageName",
                                  "signatureHash"
                                ]
                              }
                            }
                          },
                          "required": [
                            "name",
                            "language",
                            "category",
                            "status"
                          ]
                        },
                        "channelId": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "name",
                        "type",
                        "status",
                        "vendorId",
                        "messageContent",
                        "variables",
                        "vendorDetails",
                        "channelId"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "string",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "name": "string",
                    "type": "whatsapp",
                    "status": "in_review",
                    "vendorId": "string",
                    "messageContent": {
                      "body": "string",
                      "code": "string",
                      "attachments": [],
                      "header": "string",
                      "footer": "string"
                    },
                    "variables": [],
                    "vendorDetails": {
                      "name": "string",
                      "language": "af",
                      "category": "authentication",
                      "status": "pending",
                      "addSecurityRecommendation": true,
                      "codeExpirationMinutes": 0,
                      "copyCodeButtonText": "string",
                      "otpType": "copy_code",
                      "autofillButtonText": "string",
                      "zeroTapTermsAccepted": true,
                      "supportedApps": []
                    },
                    "channelId": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request body or parameters are invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "invalid_body_params",
                    "message": "Invalid body params",
                    "invalidParams": {
                      "email": {
                        "key": "invalid_string",
                        "message": "Invalid email"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. A valid API key is required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "unauthorized",
                    "message": "Unauthorized"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The current billing plan does not allow this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "insufficient_billing_plan",
                    "message": "Insufficient billing plan"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. The API key does not have permission to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "forbidden",
                    "message": "Forbidden"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found. The requested resource does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "contact_not_found",
                    "message": "Contact not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Retry after the time indicated by the X-RateLimit-Reset header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "too_many_requests",
                    "message": "Too many requests. Limit is applied per minute per tenant. Please retry after the time indicated by the X-RateLimit-Reset header."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "messageKey": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "invalidParams": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "success": false,
                  "error": {
                    "messageKey": "internal_error",
                    "message": "Oops! Something went wrong"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {}
}