openapi: 3.0.0
servers:
  - description: Wapikit Server
    url: https://api.wapikit.com/api
info:
  version: 0.0.1
  title: Wapikit
  description: The API collection for Wapikit
  license:
    name: AGPL-3.0
    url: https://github.com/wapikit/wapikit/blob/master/LICENSE
  contact:
    email: contact@softlancer.co
    name: Sarthak
    url: https://wapikit.com/contact-us
  termsOfService: https://wapikit.com/terms-and-conditions
tags:
  - name: Auth
    description: Auth API
  - name: Lists
    description: User API
  - name: Organization
    description: Organization API
  - name: Contacts
    description: Contacts API
  - name: User
    description: User API
  - name: Campaigns
    description: Campaigns API
  - name: Messages
    description: Messages API
  - name: Conversations
    description: Conversations API
  - name: System
    description: System API
  - name: Miscellaneous
    description: Miscellaneous API
  - name: RBAC
    description: Role based access control API
  - name: AI
    description: AI API
paths:
  /health-check:
    get:
      tags:
        - System
      description: healthcheck endpoint
      operationId: getHealthCheck
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: boolean
  /meta-data:
    get:
      tags:
        - System
      description: returns the meta data
      operationId: getMetaData
      responses:
        '200':
          description: meta data object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMetaDataResponseSchema'
  /events:
    get:
      summary: Subscribe to real-time events
      description: >
        Opens a persistent connection for real-time updates using Server-Sent
        Events (SSE).

        The client should listen to events and process incoming messages.
      operationId: getSSEUpdates
      tags:
        - Events
      responses:
        '200':
          description: Stream of real-time events
          content:
            text/event-stream:
              schema:
                type: string
  /auth/api-keys/regenerate:
    get:
      tags:
        - Organization
      description: regenerates the API key
      operationId: regenerateApiKey
      responses:
        '200':
          description: api key object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegenerateApiKeyResponseSchema'
  /user:
    get:
      tags:
        - User
      description: returns the user object
      operationId: getUser
      responses:
        '200':
          description: user object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetUserResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    post:
      tags:
        - User
      description: update user info
      operationId: updateUser
      requestBody:
        description: updated user info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateUserSchema'
      responses:
        '200':
          description: user object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateUserResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /user/notifications:
    get:
      tags:
        - User
      description: returns all notifications
      operationId: getUserNotifications
      parameters:
        - in: query
          name: page
          required: true
          description: number of records to skip
          schema:
            type: integer
            format: int64
        - in: query
          name: per_page
          required: true
          description: max number of records to return per page
          schema:
            type: integer
            format: int64
        - in: query
          name: sortBy
          description: sorting order
          schema:
            $ref: '#/components/schemas/OrderEnum'
      responses:
        '200':
          description: notifications list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetUserNotificationsResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /auth/api-keys:
    get:
      tags:
        - Auth
      description: returns all api keys
      operationId: getApiKeys
      responses:
        '200':
          description: api keys list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetApiKeysResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /auth/switch:
    post:
      tags:
        - Auth
      description: switch user organization
      operationId: switchOrganization
      requestBody:
        description: organization id
        content:
          application/json:
            schema:
              type: object
              properties:
                organizationId:
                  type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SwitchOrganizationResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /organization:
    post:
      tags:
        - Organization
      description: create a new organization
      operationId: createOrganization
      requestBody:
        description: new organization info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewOrganizationSchema'
      responses:
        '200':
          description: organization object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateNewOrganizationResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    get:
      tags:
        - Organization
      description: returns all organizations
      operationId: getUserOrganizations
      parameters:
        - in: query
          name: page
          required: true
          description: number of records to skip
          schema:
            type: integer
            format: int64
        - in: query
          name: per_page
          required: true
          description: max number of records to return per page
          schema:
            type: integer
            format: int64
        - in: query
          name: sortBy
          description: sorting order
          schema:
            $ref: '#/components/schemas/OrderEnum'
      responses:
        '200':
          description: organizations list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrganizationsResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /organization/{id}:
    get:
      tags:
        - Organization
      description: returns the organization object
      operationId: getOrganizationById
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the organization you want to get.
          schema:
            type: string
      responses:
        '200':
          description: organization object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrganizationByIdResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    post:
      tags:
        - Organization
      description: update an organization
      operationId: updateOrganization
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the organization you want to update.
          schema:
            type: string
      requestBody:
        description: updated organization info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrganizationSchema'
      responses:
        '200':
          description: organization object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateOrganizationByIdResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /organization/insights:
    get:
      tags:
        - Organization
      description: returns the organization insights
      operationId: getOrganizationInsights
      responses:
        '200':
          description: Organization insights object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrganizationInsightsResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /rbac/roles:
    get:
      tags:
        - Organization
      description: returns all organization roles
      operationId: getOrganizationRoles
      parameters:
        - in: query
          name: page
          required: true
          description: number of records to skip
          schema:
            type: integer
            format: int64
        - in: query
          name: per_page
          required: true
          description: max number of records to return per page
          schema:
            type: integer
            format: int64
        - in: query
          name: sortBy
          description: sorting order
          schema:
            $ref: '#/components/schemas/OrderEnum'
      responses:
        '200':
          description: organization roles list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrganizationRolesResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    post:
      tags:
        - Organization
      description: create a new organization role
      operationId: createOrganizationRole
      requestBody:
        description: new organization role info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewOrganizationRoleSchema'
      responses:
        '200':
          description: role object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateNewRoleResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /rbac/roles/{id}:
    get:
      tags:
        - Organization
      description: returns a single organization role
      operationId: getOrganizationRoleById
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the role you want to get.
          schema:
            type: string
      responses:
        '200':
          description: organization role object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetRoleByIdResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    post:
      tags:
        - Organization
      description: updates a organization role
      operationId: updateOrganizationRoleById
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the role you want to update.
          schema:
            type: string
      requestBody:
        description: update an organization role info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoleUpdateSchema'
      responses:
        '200':
          description: role object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateRoleByIdResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    delete:
      tags:
        - Organization
      description: delete an organization role
      operationId: deleteOrganizationRoleById
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the organization role you want to delete.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteRoleByIdResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /organization/tags:
    get:
      tags:
        - Organization
      description: returns all organization tags
      operationId: getOrganizationTags
      parameters:
        - in: query
          name: page
          required: true
          description: number of records to skip
          schema:
            type: integer
            format: int64
        - in: query
          name: per_page
          required: true
          description: max number of records to return per page
          schema:
            type: integer
            format: int64
        - in: query
          name: sortBy
          description: sorting order
          schema:
            $ref: '#/components/schemas/OrderEnum'
      responses:
        '200':
          description: organization tags list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrganizationTagsResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    post:
      tags:
        - Organization
      description: create a new organization tag
      operationId: createOrganizationTag
      requestBody:
        description: new organization tag info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewOrganizationTagSchema'
      responses:
        '200':
          description: tag object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateNewOrganizationTagResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /organization/invites:
    get:
      tags:
        - Organization
      description: returns all organization invites
      operationId: getOrganizationInvites
      parameters:
        - in: query
          name: page
          required: true
          description: number of records to skip
          schema:
            type: integer
            format: int64
        - in: query
          name: per_page
          required: true
          description: max number of records to return per page
          schema:
            type: integer
            format: int64
        - in: query
          name: sortBy
          description: sorting order
          schema:
            $ref: '#/components/schemas/OrderEnum'
      responses:
        '200':
          description: organization invites list
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GetOrganizationMemberInvitesResponseSchema
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    post:
      tags:
        - Organization
      description: create a new organization invite
      operationId: createOrganizationInvite
      requestBody:
        description: new organization invite info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateNewOrganizationInviteSchema'
      responses:
        '200':
          description: invite object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateInviteResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /organization/invite/{slug}:
    get:
      tags:
        - Organization
      description: returns a single organization invite
      operationId: getOrganizationInviteBySlug
      parameters:
        - in: path
          name: slug
          required: true
          description: The slug value of the invite you want to get.
          schema:
            type: string
      responses:
        '200':
          description: organization invite object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrganizationInviteBySlugResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /organization/invite/{slug}/accept:
    post:
      tags:
        - Organization
      description: accept an organization invite
      operationId: acceptOrganizationInvite
      parameters:
        - in: path
          name: slug
          required: true
          description: The slug value of the invite you want to accept.
          schema:
            type: string
      responses:
        '200':
          description: invite object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AcceptOrganizationInviteResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /organization/members:
    get:
      tags:
        - Organization
      description: returns all organization members
      operationId: getOrganizationMembers
      parameters:
        - in: query
          name: page
          required: true
          description: number of records to skip
          schema:
            type: integer
            format: int64
        - in: query
          name: per_page
          required: true
          description: max number of records to return per page
          schema:
            type: integer
            format: int64
        - in: query
          name: sortBy
          description: sorting order
          schema:
            $ref: '#/components/schemas/OrderEnum'
      responses:
        '200':
          description: organization members list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrganizationMembersResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /organization/members/{id}:
    get:
      tags:
        - Organization Members
      description: returns a single organization member
      operationId: getOrganizationMemberById
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the organization member you want to get.
          schema:
            type: string
      responses:
        '200':
          description: organization member object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrganizationMemberByIdResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    post:
      tags:
        - Organization Members
      description: update a organization member
      operationId: updateOrganizationMemberById
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the organization member you want to update.
          schema:
            type: string
      requestBody:
        description: updated organization member info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrganizationMemberSchema'
      responses:
        '200':
          description: user object
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: >-
                      #/components/schemas/UpdateOrganizationMemberByIdResponseSchema
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    delete:
      tags:
        - Organization Members
      description: delete an organization member
      operationId: deleteOrganizationMemberById
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the organization member you want to delete.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/DeleteOrganizationMemberByIdResponseSchema
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /organization/members/{id}/role:
    post:
      tags:
        - Organization Members
      description: update a organization member role
      operationId: updateOrganizationMemberRoleById
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the organization member you want to update.
          schema:
            type: string
      requestBody:
        description: updated organization member role info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrganizationMemberRoleSchema'
      responses:
        '200':
          description: user object
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/UpdateOrganizationMemberRoleByIdResponseSchema
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /organization/{id}/transfer:
    post:
      tags:
        - Organization
      description: transfer organization ownership
      operationId: transferOrganizationOwnership
      parameters:
        - in: path
          name: id
          required: true
          description: The id of the organization to transfer to.
          schema:
            type: string
      requestBody:
        description: new owner info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransferOrganizationOwnershipSchema'
      responses:
        '200':
          description: transfer ownership response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/TransferOrganizationOwnershipResponseSchema
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /organization/templates:
    get:
      tags:
        - Organization
      description: returns all templates
      operationId: getAllTemplates
      responses:
        '200':
          description: templates list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAllMessageTemplatesResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /organization/templates/{id}:
    get:
      tags:
        - Organization
      description: returns a single template
      operationId: getTemplateById
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the template you want to get.
          schema:
            type: string
      responses:
        '200':
          description: template object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTemplateByIdResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /organization/phone-numbers:
    get:
      tags:
        - Organization
      description: returns all phone numbers linked to the whatsapp business account
      operationId: getAllPhoneNumbers
      responses:
        '200':
          description: phone numbers list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAllPhoneNumbersResponseSchema'
  /organization/phone-numbers/{id}:
    get:
      tags:
        - Organization
      description: returns a single phone number linked to the whatsapp business account
      operationId: getPhoneNumberById
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the phone number you want to get.
          schema:
            type: string
      responses:
        '200':
          description: phone number object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPhoneNumberByIdResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /organization/catalogs:
    get:
      tags:
        - Organization
      description: returns all catalogs
      operationId: getAllCatalogs
      responses:
        '200':
          description: catalogs list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAllCatalogsResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /organization/catalogs/sync:
    post:
      tags:
        - Organization
      description: sync a catalog
      operationId: syncCatalog
      responses:
        '200':
          description: sync catalog response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SyncProductCatalogResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /organization/whatsappBusinessAccount:
    post:
      tags:
        - Organization
      description: updates whatsapp business account details for a organization
      operationId: updateWhatsappBusinessAccountDetails
      requestBody:
        description: new whatsapp business account info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWhatsAppBusinessAccountDetailsSchema'
      responses:
        '200':
          description: whatsapp business account object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhatsAppBusinessAccountDetailsSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /contacts:
    get:
      tags:
        - Contacts
      description: returns all contacts.
      operationId: getContacts
      parameters:
        - in: query
          name: page
          description: number of records to skip
          schema:
            type: integer
            format: int64
          required: true
        - in: query
          name: per_page
          description: max number of records to return per page
          schema:
            type: integer
            format: int64
          required: true
        - in: query
          name: list_id
          description: query subscribers with a list id.
          schema:
            type: string
        - in: query
          name: order
          description: order by asc or desc
          schema:
            $ref: '#/components/schemas/OrderEnum'
        - in: query
          name: status
          description: sort by a field
          schema:
            type: string
        - in: query
          name: searchString
          description: search
          schema:
            type: string
      responses:
        '200':
          description: contacts list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetContactsResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    post:
      description: handles creation of new contacts
      operationId: createContacts
      tags:
        - Contacts
      requestBody:
        description: new contact info
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/NewContactSchema'
      responses:
        '200':
          description: contact object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateNewContactResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    delete:
      description: handles contact deletion
      operationId: deleteContactsByList
      tags:
        - Contacts
      parameters:
        - in: query
          name: id
          required: true
          description: contact id/s to be deleted
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: boolean
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /contacts/bulk-import:
    post:
      description: handles bulk import of contacts
      operationId: bulkImportContacts
      tags:
        - Contacts
      requestBody:
        description: new contact info
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: The CSV file to be imported
          application/json:
            schema:
              $ref: '#/components/schemas/BulkImportSchema'
      responses:
        '200':
          description: contact object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkImportResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /contacts/{id}:
    get:
      description: handles the retrieval of a single contact by id.
      operationId: getContactById
      tags:
        - Contacts
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the contact you want to get.
          schema:
            type: string
      responses:
        '200':
          description: gets a single contact.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetContactByIdResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    post:
      description: modify contact data
      operationId: updateContactById
      tags:
        - Contacts
      parameters:
        - in: path
          name: id
          required: true
          description: The id of contact to update
          schema:
            type: string
      requestBody:
        description: updated contact info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateContactSchema'
      responses:
        '200':
          description: returns updated contact.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateContactByIdResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    delete:
      description: handles contact deletion based on id
      operationId: deleteContactById
      tags:
        - Contacts
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the contacts you want to delete.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteContactByIdResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /lists:
    get:
      tags:
        - Lists
      description: returns all lists.
      operationId: getContactLists
      parameters:
        - in: query
          name: page
          description: number of records to skip
          schema:
            type: integer
            format: int64
          required: true
        - in: query
          name: per_page
          description: max number of records to return per page
          schema:
            type: integer
            format: int64
          required: true
        - in: query
          name: order
          description: order by asc or desc
          schema:
            $ref: '#/components/schemas/OrderEnum'
      responses:
        '200':
          description: list of contact lists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetContactListResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    post:
      description: handles creation of new list
      operationId: createList
      tags:
        - Lists
      requestBody:
        description: new list info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewContactListSchema'
      responses:
        '200':
          description: list object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateNewListResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /lists/{id}:
    get:
      description: handles the retrieval of a single list by id.
      operationId: getListById
      tags:
        - Lists
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the list you want to get.
          schema:
            type: string
      responses:
        '200':
          description: gets a single list.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetContactListByIdSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    post:
      description: modify list data
      operationId: updateListById
      tags:
        - Lists
      parameters:
        - in: path
          name: id
          required: true
          description: The id of list to update
          schema:
            type: string
      requestBody:
        description: updated list info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateContactListSchema'
      responses:
        '200':
          description: returns updated list.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateListByIdResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    delete:
      description: handles list deletion based on id
      operationId: deleteListById
      tags:
        - Lists
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the list you want to delete.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: boolean
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /campaigns:
    get:
      tags:
        - Campaigns
      description: returns all campaigns.
      operationId: getCampaigns
      parameters:
        - in: query
          name: page
          description: number of records to skip
          schema:
            type: integer
            format: int64
          required: true
        - in: query
          name: per_page
          description: max number of records to return per page
          schema:
            type: integer
            format: int64
          required: true
        - in: query
          name: order
          description: order by asc or desc
          schema:
            $ref: '#/components/schemas/OrderEnum'
        - in: query
          name: status
          description: sort by a field
          schema:
            $ref: '#/components/schemas/CampaignStatusEnum'
      responses:
        '200':
          description: list of campaigns
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/GetCampaignResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    post:
      description: handles creation of new campaign
      operationId: createCampaign
      tags:
        - Campaigns
      requestBody:
        description: new campaign info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewCampaignSchema'
      responses:
        '200':
          description: campaign object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateNewCampaignResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /campaigns/{id}:
    get:
      description: handles the retrieval of a single campaign by id.
      operationId: getCampaignById
      tags:
        - Campaigns
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the campaign you want to get.
          schema:
            type: string
      responses:
        '200':
          description: gets a single campaign.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCampaignByIdResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    post:
      description: modify campaign data
      operationId: updateCampaignById
      tags:
        - Campaigns
      parameters:
        - in: path
          name: id
          required: true
          description: The id of campaign to update
          schema:
            type: string
      requestBody:
        description: updated campaign info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCampaignSchema'
      responses:
        '200':
          description: returns updated campaign.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateCampaignByIdResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    delete:
      description: handles campaign deletion based on id
      operationId: deleteCampaignById
      tags:
        - Campaigns
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the campaign you want to delete.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: boolean
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /conversations:
    get:
      tags:
        - Conversations
      description: returns paginated conversations.
      operationId: getConversations
      parameters:
        - in: query
          name: page
          description: number of records to skip
          schema:
            type: integer
            format: int64
          required: true
        - in: query
          name: per_page
          description: max number of records to return per page
          schema:
            type: integer
            format: int64
          required: true
        - in: query
          name: order
          description: order by asc or desc
          schema:
            $ref: '#/components/schemas/OrderEnum'
        - in: query
          name: status
          description: sort by a field
          schema:
            $ref: '#/components/schemas/ConversationStatusEnum'
        - name: contact_id
          in: query
          description: query conversations with a contact id.
          schema:
            type: string
        - name: campaign_id
          in: query
          description: query conversations with a campaign id.
          schema:
            type: string
        - name: list_id
          in: query
          description: query conversations with a list id.
          schema:
            type: string
        - name: message_id
          in: query
          description: query conversations with a message id.
          schema:
            type: string
      responses:
        '200':
          description: list of conversations
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetConversationsResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    post:
      tags:
        - Conversations
      description: handles creation of new conversations
      operationId: createConversation
      requestBody:
        description: new conversation info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateConversationSchema'
      responses:
        '200':
          description: conversation object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateConversationResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /conversation/{id}:
    get:
      tags:
        - Conversations
      description: returns a single conversation
      operationId: getConversationById
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the conversation you want to get.
          schema:
            type: string
      responses:
        '200':
          description: conversation object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetConversationByIdResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    post:
      tags:
        - Conversations
      description: update a conversation
      operationId: updateConversationById
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the conversation you want to update.
          schema:
            type: string
      requestBody:
        description: updated conversation info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateConversationSchema'
      responses:
        '200':
          description: conversation object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateConversationByIdResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    delete:
      tags:
        - Conversations
      description: delete a conversation
      operationId: deleteConversationById
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the conversation you want to delete.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteConversationByIdResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /conversation/{id}/assign:
    post:
      tags:
        - Conversations
      description: assign a conversation to a user
      operationId: assignConversation
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the conversation you want to assign.
          schema:
            type: string
      requestBody:
        description: assign conversation info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssignConversationSchema'
      responses:
        '200':
          description: conversation object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssignConversationResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /conversation/{id}/unassign:
    post:
      tags:
        - Conversations
      description: unassign a conversation from a user
      operationId: unassignConversation
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the conversation you want to unassign.
          schema:
            type: string
      requestBody:
        description: assign conversation info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UnassignConversationSchema'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnassignConversationResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /conversation/{id}/messages:
    get:
      tags:
        - Conversations
      description: returns all messages in a conversation.
      operationId: getConversationMessages
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the conversation you want to get messages from.
          schema:
            type: string
        - in: query
          name: page
          description: number of records to skip
          schema:
            type: integer
            format: int64
          required: true
        - in: query
          name: per_page
          description: max number of records to return per page
          schema:
            type: integer
            format: int64
          required: true
        - in: query
          name: order
          description: order by asc or desc
          schema:
            $ref: '#/components/schemas/OrderEnum'
      responses:
        '200':
          description: list of messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetConversationMessagesResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    post:
      tags:
        - Conversations
      description: send a message in a conversation
      operationId: sendMessageInConversation
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the conversation you want to send a message to.
          schema:
            type: string
      requestBody:
        description: new message info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewMessageSchema'
      responses:
        '200':
          description: message object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendMessageInConversationResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /conversation/{id}/upload:
    post:
      tags:
        - Conversations
      description: upload a file in a conversation
      operationId: uploadFileInConversation
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the conversation you want to upload a file to.
          schema:
            type: string
      requestBody:
        description: new file info
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: The file to be uploaded
      responses:
        '200':
          description: file object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadFileInConversationResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /conversation/{id}/read:
    post:
      tags:
        - Conversations
      description: mark a conversation as read
      operationId: markConversationAsRead
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the conversation you want to mark as read.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarkConversationAsReadResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /conversation/{id}/generate-summary:
    get:
      tags:
        - Conversations
      description: generate summary for a conversation
      operationId: generateConversationSummary
      parameters:
        - in: path
          name: id
          required: true
          description: The id value of the conversation you want to generate summary for.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateConversationSummaryResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /messages:
    get:
      tags:
        - Messages
      description: returns all messages.
      operationId: getMessages
      parameters:
        - in: query
          name: page
          description: number of records to skip
          schema:
            type: integer
            format: int64
        - in: query
          name: per_page
          description: max number of records to return per page
          schema:
            type: integer
            format: int64
        - in: query
          name: order
          description: order by asc or desc
          schema:
            $ref: '#/components/schemas/OrderEnum'
        - in: query
          name: status
          description: status of the message
          schema:
            type: string
            enum:
              - read
              - unread
              - sent
              - failed
        - in: query
          name: direction
          description: direction of the message
          schema:
            $ref: '#/components/schemas/MessageDirectionEnum'
        - name: contact_id
          in: query
          description: query messages with a contact id.
          schema:
            type: string
        - name: campaign_id
          in: query
          description: query messages with a campaign id.
          schema:
            type: string
        - name: list_id
          in: query
          description: query messages with a list id.
          schema:
            type: string
        - name: conversation_id
          in: query
          description: query messages with a conversation id.
          schema:
            type: string
      responses:
        '200':
          description: list of messages
          content:
            application/json:
              schema:
                type: object
                properties:
                  messages:
                    type: array
                    items:
                      $ref: '#/components/schemas/MessageSchema'
                  paginationMeta:
                    $ref: '#/components/schemas/PaginationMeta'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /integrations:
    get:
      tags:
        - Integrations
      description: returns all integrations.
      operationId: getIntegrations
      parameters:
        - in: query
          name: page
          description: number of records to skip
          schema:
            type: integer
            format: int64
        - in: query
          name: per_page
          description: max number of records to return per page
          schema:
            type: integer
            format: int64
        - in: query
          name: order
          description: order by asc or desc
          schema:
            $ref: '#/components/schemas/OrderEnum'
        - in: query
          name: status
          description: status of the integration
          schema:
            $ref: '#/components/schemas/IntegrationStatusEnum'
      responses:
        '200':
          description: list of integrations
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetIntegrationResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /analytics/aggregate-counts:
    get:
      tags:
        - Analytics
      description: returns aggregate counts of all analytics.
      operationId: getAggregateCounts
      parameters:
        - in: query
          name: from
          description: starting range of time span to get analytics for
          schema:
            type: string
            format: date-time
          required: true
        - in: query
          name: to
          description: ending range of time span to get analytics for
          schema:
            type: string
            format: date-time
          required: true
      responses:
        '200':
          description: messaging analytics graph data points
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DashboardAggregateCountResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /analytics/campaigns:
    get:
      tags:
        - Analytics
      description: returns aggregate campaign analytics
      operationId: getAggregateCampaignAnalytics
      parameters:
        - in: query
          name: from
          description: starting range of time span to get analytics for
          schema:
            type: string
            format: date-time
          required: true
        - in: query
          name: to
          description: ending range of time span to get analytics for
          schema:
            type: string
            format: date-time
          required: true
      responses:
        '200':
          description: messaging analytics graph data points
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GetAggregateCampaignAnalyticsResponseSchema
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /analytics/conversations:
    get:
      tags:
        - Analytics
      description: returns conversation analytics.
      operationId: getConversationAnalytics
      parameters:
        - in: query
          name: from
          description: starting range of time span to get analytics for
          schema:
            type: string
            format: date-time
        - in: query
          name: to
          description: ending range of time span to get analytics for
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: conversations analytics graph data points
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetConversationAnalyticsResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /analytics/campaign/{campaignId}:
    get:
      tags:
        - Analytics
      description: returns campaign analytics.
      operationId: getCampaignAnalyticsById
      parameters:
        - in: path
          name: campaignId
          required: true
          description: The id value of the campaign you want to get analytics for.
          schema:
            type: string
      responses:
        '200':
          description: campaign analytics graph data points
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignAnalyticsResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /knowledge-base:
    get:
      tags:
        - Knowledge Base
      summary: Get knowledge base items
      description: Get knowledge base items
      operationId: getKnowledgeBaseItems
      responses:
        '200':
          description: Knowledge base items fetched successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetKnowledgeBaseItemsResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
    post:
      tags:
        - Knowledge Base
      summary: Create knowledge base item
      description: Create knowledge base item
      operationId: createKnowledgeBaseItem
      requestBody:
        description: knowledge base item
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateKnowledgeBaseItemSchema'
      responses:
        '200':
          description: Knowledge base item created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateKnowledgeBaseItemResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
  /knowledge-base/{id}:
    delete:
      tags:
        - Knowledge Base
      summary: Delete knowledge base item by id
      description: Delete knowledge base item by id
      operationId: deleteKnowledgeBaseItemById
      parameters:
        - name: id
          in: path
          description: The id of the knowledge base item
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Knowledge base item deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteKnowledgeBaseItemResponseSchema'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponseSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponseSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseSchema'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponseSchema'
components:
  schemas:
    OrderEnum:
      type: string
      enum:
        - asc
        - desc
    ConversationStatusEnum:
      type: string
      enum:
        - Active
        - Closed
        - Deleted
    UserPermissionLevelEnum:
      type: string
      enum:
        - Owner
        - Member
    InviteStatusEnum:
      type: string
      enum:
        - Pending
        - Redeemed
    CampaignStatusEnum:
      type: string
      enum:
        - Draft
        - Scheduled
        - Running
        - Paused
        - Cancelled
        - Finished
    UserAccountStatusEnum:
      type: string
      enum:
        - Active
        - Deleted
        - Suspended
    MessageStatusEnum:
      type: string
      enum:
        - Read
        - Unread
        - Sent
        - Delivered
        - UnDelivered
        - Failed
        - Received
    MessageDirectionEnum:
      type: string
      enum:
        - InBound
        - OutBound
    MessageTypeEnum:
      type: string
      enum:
        - Text
        - Image
        - Video
        - Audio
        - Document
        - Sticker
        - Location
        - Contacts
        - Reaction
        - Address
        - Interactive
        - LocationRequest
        - Template
        - ListReply
        - ButtonReply
        - Order
    ContactStatusEnum:
      type: string
      enum:
        - Active
        - Inactive
        - Blocked
    RolePermissionEnum:
      type: string
      enum:
        - Get:OrganizationMember
        - Create:OrganizationMember
        - Update:OrganizationMember
        - Delete:OrganizationMember
        - Get:Campaign
        - Create:Campaign
        - Update:Campaign
        - Delete:Campaign
        - Get:Conversation
        - Update:Conversation
        - Delete:Conversation
        - Assign:Conversation
        - Unassign:Conversation
        - Get:List
        - Create:List
        - Update:List
        - Delete:List
        - Get:Tag
        - Create:Tag
        - Update:Tag
        - Delete:Tag
        - Get:ApiKey
        - Regenerate:ApiKey
        - Get:AppSettings
        - Update:AppSettings
        - Get:Contact
        - Create:Contact
        - Update:Contact
        - Delete:Contact
        - BulkImport:Contacts
        - Get:PrimaryAnalytics
        - Get:SecondaryAnalytics
        - Get:CampaignAnalytics
        - Update:Organization
        - Get:OrganizationRole
        - Create:OrganizationRole
        - Update:OrganizationRole
        - Delete:OrganizationRole
        - Update:IntegrationSettings
        - Get:MessageTemplates
        - Get:PhoneNumbers
    IntegrationStatusEnum:
      type: string
      enum:
        - Active
        - Inactive
    ConversationInitiatedByEnum:
      type: string
      enum:
        - Contact
        - Campaign
        - OrganizationMember
    AiChatStatusEnum:
      type: string
      enum:
        - Active
        - Inactive
    AiChatVisibilityEnum:
      type: string
      enum:
        - Public
        - Private
    AiChatMessageVoteEnum:
      type: string
      enum:
        - Upvote
        - Downvote
    AiModelEnum:
      type: string
      enum:
        - Gpt4
        - GptO1
        - GptO3Mini
        - Gpt4oMini
        - Mistral
        - Gpt4o
        - Gemini1.5Pro
        - Claude3.5
    IntegrationSchema:
      type: object
      properties:
        uniqueId:
          type: string
        name:
          type: string
        type:
          type: string
        slug:
          type: string
        icon:
          type: string
        description:
          type: string
        isPremium:
          type: boolean
        createdAt:
          type: string
          format: date-time
        status:
          $ref: '#/components/schemas/IntegrationStatusEnum'
      required:
        - uniqueId
        - name
        - type
        - slug
        - icon
        - description
        - createdAt
        - status
        - isPremium
    IntegrationFeatureFlags:
      type: object
      properties:
        isSlackIntegrationEnabled:
          type: boolean
        isCustomChatBoxIntegrationEnabled:
          type: boolean
        isOpenAiIntegrationEnabled:
          type: boolean
      required:
        - isSlackIntegrationEnabled
        - isCustomChatBoxIntegrationEnabled
        - isOpenAiIntegrationEnabled
    SystemFeatureFlags:
      type: object
      properties:
        isCloudEdition:
          type: boolean
        isEnterpriseEdition:
          type: boolean
        isRoleBasedAccessControlEnabled:
          type: boolean
        isMultiOrganizationEnabled:
          type: boolean
        isApiAccessEnabled:
          type: boolean
        isAiIntegrationEnabled:
          type: boolean
        isPluginIntegrationMarketplaceEnabled:
          type: boolean
      required:
        - isRoleBasedAccessControlEnabled
        - isMultiOrganizationEnabled
        - isApiAccessEnabled
        - isAiIntegrationEnabled
        - isPluginIntegrationMarketplaceEnabled
        - isCloudEdition
        - isEnterpriseEdition
    FeatureFlags:
      type: object
      properties:
        SystemFeatureFlags:
          $ref: '#/components/schemas/SystemFeatureFlags'
      required:
        - SystemFeatureFlags
    DiscoverSourceEnum:
      type: string
      enum:
        - LinkedIn
        - Reddit
        - Facebook
        - X
        - Instagram
        - Youtube
        - Google
        - Referral
        - Other
    IndustryEnum:
      type: string
      enum:
        - EcommerceD2C
        - RetailWholesale
        - EducationEdTech
        - FinanceFinTech
        - HealthcareWellness
        - RealEstatePropertyManagement
        - MarketingAdvertising
        - TravelHospitality
        - Automotive
        - ITSoftwareServices
        - LegalConsultingServices
        - MediaEntertainment
        - SaaSB2b
        - Other
    UserFunctionEnum:
      type: string
      enum:
        - FounderBusinessOwner
        - MarketingGrowth
        - SalesCustomerAcquisition
        - CustomerSupportSuccess
        - ProductOperations
        - DeveloperIT
        - Other
    UserSchema:
      type: object
      properties:
        uniqueId:
          type: string
        username:
          type: string
        email:
          type: string
        name:
          type: string
        createdAt:
          type: string
          format: date-time
        profilePicture:
          type: string
        phoneNumber:
          type: string
        currentOrganizationAccessLevel:
          $ref: '#/components/schemas/UserPermissionLevelEnum'
        organization:
          $ref: '#/components/schemas/OrganizationSchema'
        featureFlags:
          $ref: '#/components/schemas/FeatureFlags'
        isOwner:
          type: boolean
        discoverSource:
          $ref: '#/components/schemas/DiscoverSourceEnum'
        userFunction:
          $ref: '#/components/schemas/UserFunctionEnum'
        industry:
          $ref: '#/components/schemas/IndustryEnum'
      required:
        - uniqueId
        - username
        - email
        - name
        - createdAt
        - isOwner
    GetUserResponseSchema:
      type: object
      properties:
        user:
          $ref: '#/components/schemas/UserSchema'
      required:
        - user
    OrganizationSchema:
      type: object
      properties:
        uniqueId:
          type: string
        name:
          type: string
        description:
          type: string
        createdAt:
          type: string
          format: date-time
        websiteUrl:
          type: string
        logoUrl:
          type: string
        faviconUrl:
          type: string
        businessAccountId:
          type: string
        whatsappBusinessAccountDetails:
          $ref: '#/components/schemas/WhatsAppBusinessAccountDetailsSchema'
        IsAutoHandlingConversationsEnabled:
          type: boolean
        isOnboardingCompleted:
          type: boolean
      required:
        - uniqueId
        - name
        - createdAt
        - IsAutoHandlingConversationsEnabled
        - isOnboardingCompleted
    OrganizationMemberSchema:
      type: object
      properties:
        uniqueId:
          type: string
        createdAt:
          type: string
          format: date-time
        accessLevel:
          $ref: '#/components/schemas/UserPermissionLevelEnum'
        name:
          type: string
        email:
          type: string
        roles:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationRoleSchema'
      required:
        - uniqueId
        - createdAt
        - accessLevel
        - name
        - email
        - roles
    LoginRequestBodySchema:
      type: object
      properties:
        username:
          type: string
        password:
          type: string
      required:
        - username
        - password
    LoginResponseBodySchema:
      type: object
      properties:
        token:
          type: string
        isOnboardingCompleted:
          type: boolean
      required:
        - token
        - isOnboardingCompleted
    LoginWithOauthIsRegisterRequiredResponse:
      type: object
      properties:
        isRegisterRequired:
          type: string
      required:
        - isRegisterRequired
    LoginWithOauthSuccessResponse:
      type: object
      properties:
        isRegisterRequired:
          type: string
        token:
          type: string
        isOnboardingCompleted:
          type: boolean
      required:
        - isRegisterRequired
        - token
        - isOnboardingCompleted
    LoginWithOauthResponseBodySchema:
      oneOf:
        - $ref: '#/components/schemas/LoginWithOauthSuccessResponse'
        - $ref: '#/components/schemas/LoginWithOauthIsRegisterRequiredResponse'
      discriminator:
        propertyName: isRegisterRequired
        mapping:
          'true': '#/components/schemas/LoginWithOauthIsRegisterRequiredResponse'
          'false': '#/components/schemas/LoginWithOauthSuccessResponse'
    RegisterRequestBodySchema:
      type: object
      properties:
        username:
          type: string
        email:
          type: string
        password:
          type: string
        name:
          type: string
        organizationInviteSlug:
          type: string
        utmSource:
          type: string
        utmMedium:
          type: string
        utmCampaign:
          type: string
      required:
        - username
        - email
        - password
        - name
    RegisterRequestResponseBodySchema:
      type: object
      properties:
        isOtpSent:
          type: boolean
      required:
        - isOtpSent
    VerifyOtpRequestBodySchema:
      type: object
      properties:
        username:
          type: string
        email:
          type: string
        password:
          type: string
        name:
          type: string
        organizationInviteSlug:
          type: string
        otp:
          type: string
      required:
        - otp
        - username
        - email
        - password
        - name
    VerifyOtpResponseBodySchema:
      type: object
      properties:
        token:
          type: string
      required:
        - token
    GetMetaDataResponseSchema:
      type: object
      properties:
        metaTitle:
          type: string
        metaDescription:
          type: string
        faviconUrl:
          type: string
    OrganizationMemberInviteSchema:
      type: object
      properties:
        uniqueId:
          type: string
        email:
          type: string
        accessLevel:
          $ref: '#/components/schemas/UserPermissionLevelEnum'
        createdAt:
          type: string
          format: date-time
        status:
          $ref: '#/components/schemas/InviteStatusEnum'
        organizationName:
          type: string
      required:
        - uniqueId
        - email
        - accessLevel
        - createdAt
        - status
        - organizationName
    CreateNewOrganizationInviteSchema:
      type: object
      properties:
        email:
          type: string
        accessLevel:
          $ref: '#/components/schemas/UserPermissionLevelEnum'
      required:
        - email
        - accessLevel
    CreateInviteResponseSchema:
      type: object
      properties:
        invite:
          $ref: '#/components/schemas/OrganizationMemberInviteSchema'
      required:
        - invite
    JoinOrganizationRequestBodySchema:
      type: object
      properties:
        inviteSlug:
          type: string
      required:
        - inviteId
        - password
    JoinOrganizationResponseBodySchema:
      type: object
      properties:
        token:
          type: string
      required:
        - token
    UnassignConversationResponseSchema:
      type: object
      properties:
        data:
          type: boolean
      required:
        - data
    UnassignConversationSchema:
      type: object
      properties:
        userId:
          type: string
      required:
        - userId
    AssignConversationSchema:
      type: object
      properties:
        organizationMemberId:
          type: string
      required:
        - organizationMemberId
    AssignConversationResponseSchema:
      type: object
      properties:
        data:
          type: boolean
      required:
        - data
    RegenerateApiKeyResponseSchema:
      type: object
      properties:
        apiKey:
          $ref: '#/components/schemas/ApiKeySchema'
    GetOrganizationMemberInvitesResponseSchema:
      type: object
      properties:
        invites:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationMemberInviteSchema'
        paginationMeta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - invites
        - paginationMeta
    DeleteInviteResponseSchema:
      type: object
      properties:
        data:
          type: boolean
      required:
        - data
    ApiKeySchema:
      type: object
      properties:
        uniqueId:
          type: string
        key:
          type: string
        createdAt:
          type: string
          format: date-time
      required:
        - uniqueId
        - key
        - createdAt
    GetApiKeysResponseSchema:
      type: object
      properties:
        apiKey:
          $ref: '#/components/schemas/ApiKeySchema'
      required:
        - apiKey
    SwitchOrganizationResponseSchema:
      type: object
      properties:
        token:
          type: string
      required:
        - token
    GetCampaignResponseSchema:
      type: object
      properties:
        campaigns:
          type: array
          items:
            $ref: '#/components/schemas/CampaignSchema'
        paginationMeta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - campaigns
        - paginationMeta
    CreateNewContactResponseSchema:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    CreateNewCampaignResponseSchema:
      type: object
      properties:
        campaign:
          $ref: '#/components/schemas/CampaignSchema'
      required:
        - campaign
    UpdateCampaignByIdResponseSchema:
      type: object
      properties:
        isUpdated:
          type: boolean
      required:
        - isUpdated
    NewOrganizationTagSchema:
      type: object
      properties:
        label:
          type: string
      required:
        - label
    UpdateOrganizationMemberRoleSchema:
      type: object
      properties:
        updatedRoleIds:
          type: array
          items:
            type: string
      required:
        - updatedRoleIds
    GetOrganizationTagsResponseSchema:
      type: object
      properties:
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagSchema'
        paginationMeta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - tags
        - paginationMeta
    CreateNewOrganizationTagResponseSchema:
      type: object
      properties:
        tag:
          $ref: '#/components/schemas/TagSchema'
      required:
        - tag
    GetContactListResponseSchema:
      type: object
      properties:
        lists:
          type: array
          items:
            $ref: '#/components/schemas/ContactListSchema'
        paginationMeta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - lists
        - paginationMeta
    GetTemplateByIdResponseSchema:
      type: object
      properties:
        template:
          $ref: '#/components/schemas/MessageTemplateSchema'
      required:
        - template
    GetContactsResponseSchema:
      type: object
      properties:
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/ContactSchema'
        paginationMeta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - contacts
        - paginationMeta
    GetContactByIdResponseSchema:
      type: object
      properties:
        contact:
          $ref: '#/components/schemas/ContactSchema'
      required:
        - contact
    GetContactListByIdSchema:
      type: object
      properties:
        list:
          $ref: '#/components/schemas/ContactListSchema'
      required:
        - list
    GetCampaignByIdResponseSchema:
      type: object
      properties:
        campaign:
          $ref: '#/components/schemas/CampaignSchema'
      required:
        - campaign
    NewOrganizationSchema:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        websiteUrl:
          type: string
      required:
        - name
    UpdateOrganizationSchema:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        websiteUrl:
          type: string
      required:
        - name
    CreateNewOrganizationResponseSchema:
      type: object
      properties:
        organization:
          $ref: '#/components/schemas/OrganizationSchema'
      required:
        - organization
    GetOrganizationsResponseSchema:
      type: object
      properties:
        organizations:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationSchema'
        paginationMeta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - organizations
        - paginationMeta
    GetOrganizationByIdResponseSchema:
      type: object
      properties:
        organization:
          $ref: '#/components/schemas/OrganizationSchema'
      required:
        - organization
    UpdateOrganizationByIdResponseSchema:
      type: object
      properties:
        isUpdated:
          type: boolean
      required:
        - isUpdated
    DeleteOrganizationResponseSchema:
      type: object
      properties:
        data:
          type: boolean
      required:
        - data
    UpdateOrganizationResponseSchema:
      type: object
      properties:
        organization:
          $ref: '#/components/schemas/OrganizationSchema'
      required:
        - organization
    GetOrganizationRolesResponseSchema:
      type: object
      properties:
        roles:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationRoleSchema'
        paginationMeta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - roles
        - paginationMeta
    UpdateOrganizationSettingsResponseSchema:
      type: object
      properties:
        setting:
          type: object
          properties:
            key:
              type: string
            value:
              type: string
    GetOrganizationMembersResponseSchema:
      type: object
      properties:
        members:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationMemberSchema'
        paginationMeta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - members
        - paginationMeta
    GetOrganizationMemberRolesResponseSchema:
      type: object
      properties:
        roles:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationRoleSchema'
        paginationMeta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - roles
        - paginationMeta
    GetOrganizationMemberByIdResponseSchema:
      type: object
      properties:
        member:
          $ref: '#/components/schemas/OrganizationMemberSchema'
      required:
        - member
    CreateOrganizationMemberResponseSchema:
      type: object
      properties:
        member:
          $ref: '#/components/schemas/OrganizationMemberSchema'
      required:
        - member
    UpdateOrganizationMemberByIdResponseSchema:
      type: object
      properties:
        member:
          $ref: '#/components/schemas/OrganizationMemberSchema'
      required:
        - member
    DeleteOrganizationMemberByIdResponseSchema:
      type: object
      properties:
        data:
          type: boolean
      required:
        - data
    GetRoleByIdResponseSchema:
      type: object
      properties:
        role:
          $ref: '#/components/schemas/OrganizationRoleSchema'
      required:
        - role
    CreateNewRoleResponseSchema:
      type: object
      properties:
        role:
          $ref: '#/components/schemas/OrganizationRoleSchema'
      required:
        - role
    RoleUpdateSchema:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/RolePermissionEnum'
      required:
        - name
        - permissions
    UpdateRoleByIdResponseSchema:
      type: object
      properties:
        role:
          $ref: '#/components/schemas/OrganizationRoleSchema'
      required:
        - role
    DeleteRoleByIdResponseSchema:
      type: object
      properties:
        data:
          type: boolean
      required:
        - data
    ConversationWithoutContactSchema:
      type: object
      properties:
        uniqueId:
          type: string
        contactId:
          type: string
        campaignId:
          type: string
        organizationId:
          type: string
        initiatedBy:
          $ref: '#/components/schemas/ConversationInitiatedByEnum'
        messages:
          type: array
          items:
            $ref: '#/components/schemas/MessageSchema'
        createdAt:
          type: string
          format: date-time
        status:
          $ref: '#/components/schemas/ConversationStatusEnum'
      required:
        - uniqueId
        - contactId
        - initiatedBy
        - organizationId
        - messages
        - status
        - createdAt
    ContactSchema:
      type: object
      properties:
        uniqueId:
          type: string
        name:
          type: string
        phone:
          type: string
        attributes:
          type: object
        createdAt:
          type: string
          format: date-time
        lists:
          type: array
          items:
            $ref: '#/components/schemas/ContactListSchema'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagSchema'
        conversations:
          type: array
          items:
            $ref: '#/components/schemas/ConversationWithoutContactSchema'
        status:
          $ref: '#/components/schemas/ContactStatusEnum'
      required:
        - uniqueId
        - name
        - phone
        - attributes
        - createdAt
        - lists
        - status
        - tags
    NewContactSchema:
      type: object
      properties:
        name:
          type: string
        phone:
          type: string
        status:
          $ref: '#/components/schemas/ContactStatusEnum'
        attributes:
          type: object
        listsIds:
          type: array
          items:
            type: string
      required:
        - name
        - phone
        - attributes
        - listsIds
        - status
    NewOrganizationRoleSchema:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/RolePermissionEnum'
      required:
        - name
        - permissions
    OrganizationRoleSchema:
      type: object
      properties:
        uniqueId:
          type: string
        name:
          type: string
        description:
          type: string
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/RolePermissionEnum'
      required:
        - uniqueId
        - name
        - permissions
    UpdateContactSchema:
      type: object
      properties:
        name:
          type: string
        status:
          $ref: '#/components/schemas/ContactStatusEnum'
        phone:
          type: string
        attributes:
          type: object
        lists:
          type: array
          items:
            type: string
      required:
        - name
        - phone
        - status
        - attributes
        - lists
    UpdateContactByIdResponseSchema:
      type: object
      properties:
        contact:
          $ref: '#/components/schemas/ContactSchema'
      required:
        - contact
    TagSchema:
      type: object
      properties:
        label:
          type: string
        uniqueId:
          type: string
      required:
        - label
        - uniqueId
    ContactListSchema:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        numberOfContacts:
          type: integer
        numberOfCampaignsSent:
          type: integer
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagSchema'
        uniqueId:
          type: string
        createdAt:
          type: string
          format: date-time
      required:
        - name
        - uniqueId
        - createdAt
        - numberOfContacts
        - numberOfCampaignsSent
        - tags
        - description
    NewContactListSchema:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        tags:
          type: array
          items:
            type: string
        contactIds:
          type: array
          items:
            type: string
      required:
        - name
        - tags
    CreateNewListResponseSchema:
      type: object
      properties:
        list:
          $ref: '#/components/schemas/ContactListSchema'
      required:
        - list
    UpdateContactListSchema:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        tags:
          type: array
          items:
            type: string
      required:
        - name
        - tags
    UpdateListByIdResponseSchema:
      type: object
      properties:
        list:
          $ref: '#/components/schemas/ContactListSchema'
      required:
        - list
    PaginationMeta:
      type: object
      properties:
        page:
          type: integer
          format: int64
        per_page:
          type: integer
          format: int64
        total:
          type: integer
      required:
        - page
        - per_page
        - total
    UpdateOrganizationMemberSchema:
      type: object
      properties:
        accessLevel:
          $ref: '#/components/schemas/UserPermissionLevelEnum'
      required:
        - email
    CampaignSchema:
      type: object
      properties:
        uniqueId:
          type: string
        name:
          type: string
        description:
          type: string
        organizationId:
          type: string
        status:
          $ref: '#/components/schemas/CampaignStatusEnum'
        sentAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
        scheduledAt:
          type: string
          format: date-time
        lists:
          type: array
          items:
            $ref: '#/components/schemas/ContactListSchema'
        templateMessageId:
          type: string
        isLinkTrackingEnabled:
          type: boolean
        phoneNumberInUse:
          type: string
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagSchema'
        templateComponentParameters:
          $ref: '#/components/schemas/TemplateComponentParameters'
        stats:
          $ref: '#/components/schemas/CampaignAnalyticsResponseSchema'
        progress:
          type: object
          properties:
            totalMessages:
              type: number
            sent:
              type: number
          required:
            - totalMessages
            - sent
      required:
        - uniqueId
        - name
        - status
        - lists
        - tags
        - isLinkTrackingEnabled
        - createdAt
    NewCampaignSchema:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        listIds:
          type: array
          items:
            type: string
        templateMessageId:
          type: string
        phoneNumberToUse:
          type: string
        isLinkTrackingEnabled:
          type: boolean
        scheduledAt:
          type: string
          format: date-time
        tags:
          type: array
          items:
            type: string
        templateComponentParameters:
          $ref: '#/components/schemas/TemplateComponentParameters'
      required:
        - name
        - listIds
        - isLinkTrackingEnabled
        - tags
        - phoneNumberToUse
        - templateMessageId
    TemplateParameterInput:
      type: object
      description: |
        A single template parameter input. It can be either static or dynamic.
      properties:
        nameOrIndex:
          type: string
          description: The name or index identifying the parameter.
        label:
          type: string
          description: The display label for the parameter.
        parameterType:
          type: string
          description: Specifies whether the parameter is static or dynamic.
          enum:
            - static
            - dynamic
        dynamicField:
          type: string
          description: >-
            For dynamic parameters, the field name to resolve (e.g.
            'firstName').
        staticValue:
          type: string
          description: The static value to be used if applicable.
        example:
          type: string
          description: An example value for the parameter.
        placeholder:
          type: string
          description: Placeholder text to guide the user input.
      required:
        - nameOrIndex
        - label
        - parameterType
    TemplateProductSection:
      type: object
      properties:
        title:
          type: string
        productItems:
          type: array
          items:
            type: object
            properties:
              productRetailerId:
                type: string
            required:
              - productRetailerId
      required:
        - productItems
        - title
    TemplateComponentParameters:
      type: object
      description: >
        Object representing template component parameters. It consists of
        separate arrays for header, body, and button parameters.
      properties:
        header:
          type: array
          description: Parameters for header components.
          items:
            $ref: '#/components/schemas/TemplateParameterInput'
        body:
          type: array
          description: Parameters for body components.
          items:
            $ref: '#/components/schemas/TemplateParameterInput'
        buttons:
          type: array
          description: Parameters for button components.
          items:
            $ref: '#/components/schemas/TemplateParameterInput'
        catalogId:
          type: string
        productRetailerId:
          type: string
        productSections:
          type: array
          items:
            $ref: '#/components/schemas/TemplateProductSection'
      required:
        - header
        - body
        - buttons
        - productSections
    UpdateCampaignSchema:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        listIds:
          type: array
          items:
            type: string
        templateMessageId:
          type: string
        enableLinkTracking:
          type: boolean
        tags:
          type: array
          items:
            type: string
        status:
          $ref: '#/components/schemas/CampaignStatusEnum'
        phoneNumber:
          type: string
        templateComponentParameters:
          $ref: '#/components/schemas/TemplateComponentParameters'
        scheduledAt:
          type: string
          format: date-time
      required:
        - name
        - listIds
        - enableLinkTracking
        - tags
    ContactWithoutConversationSchema:
      type: object
      properties:
        uniqueId:
          type: string
        name:
          type: string
        phone:
          type: string
        attributes:
          type: object
        createdAt:
          type: string
          format: date-time
        status:
          $ref: '#/components/schemas/ContactStatusEnum'
      required:
        - uniqueId
        - name
        - phone
        - attributes
        - createdAt
        - status
    ConversationSchema:
      type: object
      properties:
        contact:
          $ref: '#/components/schemas/ContactWithoutConversationSchema'
        uniqueId:
          type: string
        contactId:
          type: string
        campaignId:
          type: string
        organizationId:
          type: string
        initiatedBy:
          $ref: '#/components/schemas/ConversationInitiatedByEnum'
        messages:
          type: array
          items:
            $ref: '#/components/schemas/MessageSchema'
        createdAt:
          type: string
          format: date-time
        numberOfUnreadMessages:
          type: integer
        totalMessages:
          type: integer
        status:
          $ref: '#/components/schemas/ConversationStatusEnum'
        assignedTo:
          $ref: '#/components/schemas/OrganizationMemberSchema'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagSchema'
      required:
        - uniqueId
        - contactId
        - initiatedBy
        - organizationId
        - messages
        - status
        - tags
        - createdAt
        - contact
        - numberOfUnreadMessages
    GetConversationByIdResponseSchema:
      type: object
      properties:
        conversation:
          $ref: '#/components/schemas/ConversationSchema'
      required:
        - conversation
    GetConversationMessagesResponseSchema:
      type: object
      properties:
        messages:
          type: array
          items:
            $ref: '#/components/schemas/MessageSchema'
        paginationMeta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - messages
        - paginationMeta
    GetConversationsResponseSchema:
      type: object
      properties:
        conversations:
          type: array
          items:
            $ref: '#/components/schemas/ConversationSchema'
        paginationMeta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - conversations
        - paginationMeta
    UpdateConversationSchema:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/ConversationStatusEnum'
      required:
        - status
    UpdateConversationByIdResponseSchema:
      type: object
      properties:
        conversation:
          $ref: '#/components/schemas/ConversationSchema'
      required:
        - conversation
    DeleteConversationByIdResponseSchema:
      type: object
      properties:
        data:
          type: boolean
      required:
        - data
    DeleteContactByIdResponseSchema:
      type: object
      properties:
        data:
          type: boolean
      required:
        - data
    BaseMessage:
      type: object
      description: >
        The base message object that contains common properties for all message
        types.
      properties:
        uniqueId:
          type: string
          description: Unique identifier of the message.
        conversationId:
          type: string
          description: ID of the conversation.
        direction:
          $ref: '#/components/schemas/MessageDirectionEnum'
          description: >
            Direction of the message – whether it was received (inbound) or sent
            (outbound).
        status:
          $ref: '#/components/schemas/MessageStatusEnum'
          description: Message status.
        messageType:
          type: string
          description: Discriminator field used to determine the concrete message type.
        createdAt:
          type: string
          format: date-time
          description: Time when the message was created.
        replyToMessageId:
          type: string
          description: ID of the message to which this message is a reply.
        whatsAppMessageId:
          type: string
          description: ID of the message in WhatsApp.
      required:
        - uniqueId
        - conversationId
        - direction
        - status
        - messageType
        - createdAt
        - whatsAppMessageId
    TextMessageData:
      type: object
      properties:
        text:
          type: string
          description: The actual text message.
      required:
        - text
    TextMessage:
      allOf:
        - $ref: '#/components/schemas/BaseMessage'
        - type: object
          properties:
            messageType:
              type: string
              enum:
                - Text
            messageData:
              $ref: '#/components/schemas/TextMessageData'
          required:
            - messageData
    AudioMessageData:
      type: object
      properties:
        id:
          type: string
          description: Audio file identifier.
        link:
          type: string
          format: uri
          description: URL for the audio file.
      required:
        - id
    AudioMessage:
      allOf:
        - $ref: '#/components/schemas/BaseMessage'
        - type: object
          properties:
            messageType:
              type: string
              enum:
                - Audio
            messageData:
              $ref: '#/components/schemas/AudioMessageData'
          required:
            - messageData
    VideoMessageData:
      type: object
      properties:
        id:
          type: string
          description: Video file identifier.
        link:
          type: string
          format: uri
          description: URL for the video file.
        caption:
          type: string
      required:
        - id
    VideoMessage:
      allOf:
        - $ref: '#/components/schemas/BaseMessage'
        - type: object
          properties:
            messageType:
              type: string
              enum:
                - Video
            messageData:
              $ref: '#/components/schemas/VideoMessageData'
          required:
            - messageData
    ImageMessageData:
      type: object
      properties:
        id:
          type: string
          description: Image file identifier.
        link:
          type: string
          format: uri
          description: URL for the image file.
        caption:
          type: string
      required:
        - id
    ImageMessage:
      allOf:
        - $ref: '#/components/schemas/BaseMessage'
        - type: object
          properties:
            messageType:
              type: string
              enum:
                - Image
            messageData:
              $ref: '#/components/schemas/ImageMessageData'
          required:
            - messageData
    DocumentMessageData:
      type: object
      properties:
        id:
          type: string
          description: Document file identifier.
        link:
          type: string
          format: uri
          description: URL for the document file.
        fileName:
          type: string
          description: Name of the document file.
        caption:
          type: string
          description: (Optional) Caption for the document.
      required:
        - id
        - fileName
    DocumentMessage:
      allOf:
        - $ref: '#/components/schemas/BaseMessage'
        - type: object
          properties:
            messageType:
              type: string
              enum:
                - Document
            messageData:
              $ref: '#/components/schemas/DocumentMessageData'
          required:
            - messageData
    StickerMessageData:
      type: object
      properties:
        id:
          type: string
          description: Sticker identifier.
        link:
          type: string
          format: uri
          description: URL for the sticker file.
      required:
        - id
    StickerMessage:
      allOf:
        - $ref: '#/components/schemas/BaseMessage'
        - type: object
          properties:
            messageType:
              type: string
              enum:
                - Sticker
            messageData:
              $ref: '#/components/schemas/StickerMessageData'
          required:
            - messageData
    ReactionMessageData:
      type: object
      properties:
        reaction:
          type: string
          description: Reaction emoji.
        messageId:
          type: string
          description: ID of the message to which the reaction was added.
      required:
        - reaction
    ReactionMessage:
      allOf:
        - $ref: '#/components/schemas/BaseMessage'
        - type: object
          properties:
            messageType:
              type: string
              enum:
                - Reaction
            messageData:
              $ref: '#/components/schemas/ReactionMessageData'
          required:
            - messageData
    TemplateMessageData:
      type: object
      properties:
        templateId:
          type: string
          description: ID of the template to use.
        parameters:
          $ref: '#/components/schemas/TemplateComponentParameters'
      required:
        - templateId
        - parameters
    TemplateMessage:
      allOf:
        - $ref: '#/components/schemas/BaseMessage'
        - type: object
          properties:
            messageType:
              type: string
              enum:
                - Template
            messageData:
              $ref: '#/components/schemas/TemplateMessageData'
          required:
            - messageData
    ButtonReplyMessageData:
      type: object
      properties:
        id:
          type: string
          description: ID of the button.
        title:
          type: string
          description: Title of the button.
      required:
        - id
        - title
    ButtonReply:
      allOf:
        - $ref: '#/components/schemas/BaseMessage'
        - type: object
          properties:
            messageType:
              type: string
              enum:
                - ButtonReply
            messageData:
              $ref: '#/components/schemas/ButtonReplyMessageData'
          required:
            - messageData
    ListReplyMessageData:
      type: object
      properties:
        id:
          type: string
          description: ID of the list.
        title:
          type: string
          description: Title of the list.
        description:
          type: string
          description: Description of the list.
      required:
        - id
        - title
        - description
    ListReply:
      allOf:
        - $ref: '#/components/schemas/BaseMessage'
        - type: object
          properties:
            messageType:
              type: string
              enum:
                - ListReply
            messageData:
              $ref: '#/components/schemas/ListReplyMessageData'
          required:
            - messageData
    OrderProductItem:
      type: object
      properties:
        productRetailerId:
          type: string
          description: ID of the product.
        quantity:
          type: integer
          description: Quantity of the product.
        currency:
          type: string
          description: Currency of the product.
        itemPrice:
          type: number
          description: Price of the product.
      required:
        - productRetailerId
        - quantity
        - currency
        - itemPrice
    OrderMessageData:
      type: object
      properties:
        catalogId:
          type: string
          description: ID of the catalog.
        productItems:
          type: array
          items:
            $ref: '#/components/schemas/OrderProductItem'
        text:
          type: string
      required:
        - catalogId
        - productItems
    Order:
      allOf:
        - $ref: '#/components/schemas/BaseMessage'
        - type: object
          properties:
            messageType:
              type: string
              enum:
                - Order
            messageData:
              $ref: '#/components/schemas/OrderMessageData'
          required:
            - messageData
    InteractiveMessageType:
      type: string
      enum:
        - ProductList
        - Product
        - Catalog
        - List
        - Button
    ProductInteractiveMessageData:
      type: object
      properties:
        subType:
          type: string
          enum:
            - Product
        bodyText:
          type: string
        catalogId:
          type: string
        productRetailerId:
          type: string
        footerText:
          type: string
      required:
        - catalogId
        - productRetailerId
        - subType
    ProductListInteractiveMessageData:
      type: object
      properties:
        subType:
          type: string
          enum:
            - ProductList
        sections:
          type: array
          items:
            type: object
            properties:
              title:
                type: string
              products:
                type: array
                items:
                  type: object
                  properties:
                    productRetailerId:
                      type: string
        catalogId:
          type: string
        productRetailerId:
          type: string
        bodyText:
          type: string
        footerText:
          type: string
        headerText:
          type: string
      required:
        - catalogId
        - subType
        - sections
        - productRetailerId
        - bodyText
    CatalogInteractiveMessageData:
      type: object
      properties:
        subType:
          type: string
          enum:
            - Catalog
        catalogName:
          type: string
        thumbnailProductRetailerId:
          type: string
        bodyText:
          type: string
        footerText:
          type: string
      required:
        - catalogName
        - subType
        - thumbnailProductRetailerId
    ListInteractiveMessageData:
      type: object
      description: >-
        A rich list‑style message with a top‑level call‑to‑action button
        (`ctaButtonText`) that opens sections of choices.
      properties:
        subType:
          type: string
          enum:
            - List
          description: Must be `"List"`.
        bodyText:
          type: string
          description: Main message body (up to 4096 chars).
          maxLength: 4096
        ctaButtonText:
          type: string
          description: Text on the CTA button (up to 60 chars).
          maxLength: 60
        headerText:
          type: string
          description: Optional header above the list (up to 60 chars).
          maxLength: 60
        footerText:
          type: string
          description: Optional footer below the list (up to 60 chars).
          maxLength: 60
        sections:
          type: array
          description: Up to 10 sections, with up to 10 total rows across all sections.
          items:
            type: object
            properties:
              title:
                type: string
                description: Section title (up to 24 chars).
                maxLength: 24
              rows:
                type: array
                description: Entries in this section.
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      description: Identifier for this row (up to 200 chars).
                      maxLength: 200
                    title:
                      type: string
                      description: Row label (up to 24 chars).
                      maxLength: 24
                    description:
                      type: string
                      description: Row detail (up to 72 chars).
                      maxLength: 72
                minItems: 1
            required:
              - title
              - rows
          minItems: 1
          maxItems: 10
      required:
        - subType
        - bodyText
        - ctaButtonText
        - sections
      additionalProperties: false
    QuickReplyButtonInteractiveMessageData:
      type: object
      description: A set of up to 3 quick‑reply buttons the user can tap to reply.
      properties:
        subType:
          type: string
          enum:
            - Button
          description: Must be `"Button"`.
        bodyText:
          type: string
          description: Main message body (up to 1024 chars).
          maxLength: 1024
        buttons:
          type: array
          description: Up to 3 buttons.
          items:
            type: object
            properties:
              id:
                type: string
                description: Internal ID for this button (up to 256 chars).
                maxLength: 256
              title:
                type: string
                description: Button label (up to 20 chars).
                maxLength: 20
            required:
              - id
              - title
          minItems: 1
          maxItems: 3
        headerText:
          type: string
          description: Optional header above buttons (up to 60 chars).
          maxLength: 60
        footerText:
          type: string
          description: Optional footer below buttons (up to 60 chars).
          maxLength: 60
      required:
        - subType
        - bodyText
        - buttons
      additionalProperties: false
    InteractiveMessageData:
      oneOf:
        - $ref: '#/components/schemas/ProductInteractiveMessageData'
        - $ref: '#/components/schemas/ProductListInteractiveMessageData'
        - $ref: '#/components/schemas/CatalogInteractiveMessageData'
        - $ref: '#/components/schemas/ListInteractiveMessageData'
        - $ref: '#/components/schemas/QuickReplyButtonInteractiveMessageData'
      discriminator:
        propertyName: subType
        mapping:
          Product: '#/components/schemas/ProductInteractiveMessageData'
          ProductList: '#/components/schemas/ProductListInteractiveMessageData'
          Catalog: '#/components/schemas/CatalogInteractiveMessageData'
          List: '#/components/schemas/ListInteractiveMessageData'
          Button: '#/components/schemas/QuickReplyButtonInteractiveMessageData'
    InteractiveMessage:
      allOf:
        - $ref: '#/components/schemas/BaseMessage'
        - type: object
          properties:
            messageType:
              type: string
              enum:
                - Interactive
            messageData:
              $ref: '#/components/schemas/InteractiveMessageData'
          required:
            - messageData
            - messageType
    LocationMessageData:
      type: object
      properties:
        latitude:
          type: number
          format: double
          description: Latitude of the location.
        longitude:
          type: number
          format: double
          description: Longitude of the location.
        address:
          type: string
          description: (Optional) Address of the location.
        name:
          type: string
          description: (Optional) Name of the location.
      required:
        - latitude
        - longitude
    LocationMessage:
      allOf:
        - $ref: '#/components/schemas/BaseMessage'
        - type: object
          properties:
            messageType:
              type: string
              enum:
                - Location
            messageData:
              $ref: '#/components/schemas/LocationMessageData'
          required:
            - messageData
    MessageSchema:
      description: >
        The message object returned from the API (or retrieved from the
        database) with a discriminator to determine the concrete type.
      oneOf:
        - $ref: '#/components/schemas/TextMessage'
        - $ref: '#/components/schemas/AudioMessage'
        - $ref: '#/components/schemas/LocationMessage'
        - $ref: '#/components/schemas/VideoMessage'
        - $ref: '#/components/schemas/ImageMessage'
        - $ref: '#/components/schemas/DocumentMessage'
        - $ref: '#/components/schemas/StickerMessage'
        - $ref: '#/components/schemas/ReactionMessage'
        - $ref: '#/components/schemas/TemplateMessage'
        - $ref: '#/components/schemas/InteractiveMessage'
        - $ref: '#/components/schemas/ListReply'
        - $ref: '#/components/schemas/ButtonReply'
        - $ref: '#/components/schemas/Order'
      discriminator:
        propertyName: messageType
        mapping:
          Text: '#/components/schemas/TextMessage'
          Audio: '#/components/schemas/AudioMessage'
          Location: '#/components/schemas/LocationMessage'
          Video: '#/components/schemas/VideoMessage'
          Image: '#/components/schemas/ImageMessage'
          Document: '#/components/schemas/DocumentMessage'
          Sticker: '#/components/schemas/StickerMessage'
          Reaction: '#/components/schemas/ReactionMessage'
          Template: '#/components/schemas/TemplateMessage'
          Interactive: '#/components/schemas/InteractiveMessage'
          ListReply: '#/components/schemas/ListReply'
          ButtonReply: '#/components/schemas/ButtonReply'
          Order: '#/components/schemas/Order'
    NewMessageDataSchema:
      type: object
      description: |
        OneOf-based union for new message data, distinguished by `messageType`.
      discriminator:
        propertyName: messageType
        mapping:
          Text: '#/components/schemas/TextMessageData'
          Audio: '#/components/schemas/AudioMessageData'
          Video: '#/components/schemas/VideoMessageData'
          Image: '#/components/schemas/ImageMessageData'
          Document: '#/components/schemas/DocumentMessageData'
          Sticker: '#/components/schemas/StickerMessageData'
          Reaction: '#/components/schemas/ReactionMessageData'
          Location: '#/components/schemas/LocationMessageData'
          Template: '#/components/schemas/TemplateMessageData'
          Interactive: '#/components/schemas/InteractiveMessageData'
      required:
        - messageType
      properties:
        messageType:
          type: string
          description: The type for this new message data.
      oneOf:
        - $ref: '#/components/schemas/TextMessageData'
        - $ref: '#/components/schemas/AudioMessageData'
        - $ref: '#/components/schemas/VideoMessageData'
        - $ref: '#/components/schemas/ImageMessageData'
        - $ref: '#/components/schemas/DocumentMessageData'
        - $ref: '#/components/schemas/StickerMessageData'
        - $ref: '#/components/schemas/ReactionMessageData'
        - $ref: '#/components/schemas/LocationMessageData'
        - $ref: '#/components/schemas/TemplateMessageData'
        - $ref: '#/components/schemas/InteractiveMessageData'
    NewMessageSchema:
      description: >
        Request payload for sending a new message. The payload includes the
        messageType, createdAt date, and a messageData field whose structure
        depends on the messageType.
      type: object
      required:
        - createdAt
        - messageData
      properties:
        createdAt:
          type: string
          format: date-time
        replyToMessageId:
          type: string
        messageData:
          $ref: '#/components/schemas/NewMessageDataSchema'
    SendMessageInConversationResponseSchema:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/MessageSchema'
      required:
        - message
    ErrorSchema:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    TransferOrganizationOwnershipSchema:
      type: object
      properties:
        newOwnerId:
          type: string
      required:
        - newOwnerId
    TransferOrganizationOwnershipResponseSchema:
      type: object
      properties:
        isTransferred:
          type: boolean
      required:
        - isTransferred
    BulkImportSchema:
      type: object
      properties:
        listIds:
          type: array
          items:
            type: string
        delimiter:
          type: string
    BulkImportResponseSchema:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    AggregateMessageStatsDataPointsSchema:
      type: object
      properties:
        totalMessages:
          type: integer
        messagesSent:
          type: integer
        messagesFailed:
          type: integer
        messagesDelivered:
          type: integer
        messagesUndelivered:
          type: integer
        messagesRead:
          type: integer
        messagesUnread:
          type: integer
      required:
        - totalMessages
        - messagesSent
        - messagesFailed
        - messagesDelivered
        - messagesUndelivered
        - messagesRead
        - messagesUnread
    AggregateConversationStatsDataPointsSchema:
      type: object
      properties:
        totalConversations:
          type: integer
        conversationsActive:
          type: integer
        conversationsClosed:
          type: integer
        conversationsPending:
          type: integer
      required:
        - totalConversations
        - conversationsActive
        - conversationsClosed
        - conversationsPending
    AggregateCampaignStatsDataPointsSchema:
      type: object
      properties:
        totalCampaigns:
          type: integer
        campaignsDraft:
          type: integer
        campaignsScheduled:
          type: integer
        campaignsRunning:
          type: integer
        campaignsPaused:
          type: integer
        campaignsCancelled:
          type: integer
        campaignsFinished:
          type: integer
      required:
        - totalCampaigns
        - campaignsDraft
        - campaignsScheduled
        - campaignsRunning
        - campaignsPaused
        - campaignsCancelled
        - campaignsFinished
    AggregateContactStatsDataPointsSchema:
      type: object
      properties:
        totalContacts:
          type: integer
        contactsActive:
          type: integer
        contactsBlocked:
          type: integer
      required:
        - totalContacts
        - contactsActive
        - contactsBlocked
    AggregateAnalyticsSchema:
      type: object
      properties:
        messageStats:
          $ref: '#/components/schemas/AggregateMessageStatsDataPointsSchema'
        conversationStats:
          $ref: '#/components/schemas/AggregateConversationStatsDataPointsSchema'
        campaignStats:
          $ref: '#/components/schemas/AggregateCampaignStatsDataPointsSchema'
        contactStats:
          $ref: '#/components/schemas/AggregateContactStatsDataPointsSchema'
      required:
        - messageStats
        - conversationStats
        - campaignStats
        - contactStats
    MessageAnalyticGraphDataPointSchema:
      type: object
      properties:
        date:
          type: string
          format: date-time
        label:
          type: string
        sent:
          type: integer
        delivered:
          type: integer
        replied:
          type: integer
        read:
          type: integer
      required:
        - date
        - label
        - sent
        - replied
        - read
        - delivered
    MessageTypeDistributionGraphDataPointSchema:
      type: object
      properties:
        type:
          type: string
        sent:
          type: integer
        received:
          type: integer
      required:
        - type
        - sent
        - received
    DateToCountGraphDataPointSchema:
      type: object
      properties:
        date:
          type: string
          format: date-time
        label:
          type: string
        count:
          type: integer
      required:
        - date
        - label
        - count
    ConversationAnalyticsDataPointSchema:
      type: object
      properties:
        date:
          type: string
          format: date-time
        label:
          type: string
        numberOfActiveConversation:
          type: integer
        numberOfNewConversationOpened:
          type: integer
      required:
        - date
        - label
        - numberOfActiveConversation
        - numberOfNewConversationOpened
    DashboardAggregateCountResponseSchema:
      type: object
      properties:
        aggregateAnalytics:
          $ref: '#/components/schemas/AggregateAnalyticsSchema'
      required:
        - aggregateAnalytics
    GetConversationAnalyticsResponseSchema:
      type: object
      properties:
        analytics:
          $ref: '#/components/schemas/ConversationAggregateAnalytics'
      required:
        - analytics
    ConversationAggregateAnalytics:
      type: object
      properties:
        avgResponseTimeInMinutes:
          type: number
          format: double
        totalConversations:
          type: integer
        conversationsActive:
          type: integer
        conversationsClosed:
          type: integer
        conversationsPending:
          type: integer
        serviceConversations:
          type: integer
        inboundToOutboundRatio:
          type: number
          format: double
        conversationsAnalytics:
          type: array
          items:
            $ref: '#/components/schemas/ConversationAnalyticsDataPointSchema'
        messageTypeTrafficDistributionAnalytics:
          type: array
          items:
            $ref: '#/components/schemas/MessageTypeDistributionGraphDataPointSchema'
      required:
        - totalConversations
        - conversationsActive
        - conversationsClosed
        - conversationsPending
        - serviceConversations
        - inboundToOutboundRatio
        - conversationsAnalytics
        - messageTypeTrafficDistributionAnalytics
        - avgResponseTimeInMinutes
    GetAggregateCampaignAnalyticsResponseSchema:
      type: object
      properties:
        analytics:
          $ref: '#/components/schemas/CampaignAnalyticsResponseSchema'
      required:
        - analytics
    CampaignAnalyticsResponseSchema:
      type: object
      properties:
        totalRecipients:
          type: integer
        messagesSent:
          type: integer
        messagesFailed:
          type: integer
        messagesDelivered:
          type: integer
        messagesUndelivered:
          type: integer
        messagesRead:
          type: integer
        totalMessages:
          type: integer
        conversationInitiated:
          type: integer
        responseRate:
          type: number
          format: double
        openRate:
          type: number
          format: double
        engagementRate:
          type: number
          format: double
        totalLinkClicks:
          type: integer
        engagementTrends:
          type: array
          items:
            $ref: '#/components/schemas/DateToCountGraphDataPointSchema'
        linkClicksData:
          type: array
          items:
            $ref: '#/components/schemas/DateToCountGraphDataPointSchema'
        messageAnalytics:
          type: array
          items:
            $ref: '#/components/schemas/MessageAnalyticGraphDataPointSchema'
      required:
        - totalRecipients
        - messagesSent
        - messagesFailed
        - messagesDelivered
        - messagesUndelivered
        - messagesRead
        - totalMessages
        - totalLinkClicks
        - conversationInitiated
        - linkClicksData
        - responseRate
        - openRate
        - engagementRate
        - messageAnalytics
        - engagementTrends
    GetIntegrationResponseSchema:
      type: object
      properties:
        integrations:
          type: array
          items:
            $ref: '#/components/schemas/IntegrationSchema'
        paginationMeta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - integrations
        - paginationMeta
    UpdateOrganizationMemberRoleByIdResponseSchema:
      type: object
      properties:
        isRoleUpdated:
          type: boolean
      required:
        - isRoleUpdated
    UpdateWhatsAppBusinessAccountDetailsSchema:
      type: object
      properties:
        businessAccountId:
          type: string
        code:
          type: string
        phoneNumberId:
          type: string
      required:
        - businessAccountId
        - code
        - phoneNumberId
    WhatsAppBusinessAccountStatusVerificationStatusEnum:
      type: string
      enum:
        - Verified
        - Pending
        - Rejected
        - UnVerified
    WhatsAppBusinessAccountDetailsSchema:
      type: object
      properties:
        businessAccountId:
          type: string
        phoneNumberId:
          type: string
        accessToken:
          type: string
        webhookSecret:
          type: string
        verificationStatus:
          $ref: >-
            #/components/schemas/WhatsAppBusinessAccountStatusVerificationStatusEnum
        isPhoneNumberRegisteredToCloudApi:
          type: boolean
      required:
        - businessAccountId
        - phoneNumberId
        - verificationStatus
        - isPhoneNumberRegisteredToCloudApi
    MessageTemplateSchema:
      type: object
      properties:
        id:
          type: string
        category:
          $ref: '#/components/schemas/MessageTemplateCategory'
        components:
          type: array
          items:
            $ref: '#/components/schemas/WhatsAppBusinessHSMWhatsAppHSMComponent'
        correct_category:
          type: string
        cta_url_link_tracking_opted_out:
          type: boolean
        language:
          type: string
        library_template_name:
          type: string
        message_send_ttl_seconds:
          type: integer
        name:
          type: string
        previous_category:
          type: string
        quality_score:
          $ref: '#/components/schemas/TemplateMessageQualityScore'
        rejected_reason:
          type: string
        status:
          $ref: '#/components/schemas/MessageTemplateStatus'
      required:
        - id
        - name
        - category
        - language
        - status
    GetMessageTemplateByIdResponseSchema:
      $ref: '#/components/schemas/MessageTemplateSchema'
    GetAllMessageTemplatesResponseSchema:
      type: array
      items:
        $ref: '#/components/schemas/MessageTemplateSchema'
    PhoneNumberSchema:
      type: object
      properties:
        verified_name:
          type: string
        display_phone_number:
          type: string
        id:
          type: string
        quality_rating:
          type: string
        code_verification_status:
          type: object
          properties:
            status:
              type: string
        platform_type:
          type: string
      required:
        - phone_number
        - country_code
        - country
        - type
        - verified_name
        - display_phone_number
        - id
        - quality_rating
        - code_verification_status
        - platform_type
    GetAllPhoneNumbersResponseSchema:
      type: array
      items:
        $ref: '#/components/schemas/PhoneNumberSchema'
    GetPhoneNumberByIdResponseSchema:
      $ref: '#/components/schemas/PhoneNumberSchema'
    UpdateUserSchema:
      type: object
      properties:
        name:
          type: string
        profilePicture:
          type: string
        phoneNumber:
          type: string
        discoverSource:
          $ref: '#/components/schemas/DiscoverSourceEnum'
        userFunction:
          $ref: '#/components/schemas/UserFunctionEnum'
        industry:
          $ref: '#/components/schemas/IndustryEnum'
      required:
        - name
    UpdateUserResponseSchema:
      type: object
      properties:
        isUpdated:
          type: boolean
      required:
        - isUpdated
    MessageTemplateStatus:
      type: string
      enum:
        - APPROVED
        - REJECTED
        - PENDING
    MessageTemplateCategory:
      type: string
      enum:
        - UTILITY
        - MARKETING
        - AUTHENTICATION
    TemplateMessageButtonType:
      type: string
      enum:
        - QUICK_REPLY
        - URL
        - PHONE_NUMBER
        - COPY_CODE
        - MPM
        - CATALOG
    MessageTemplateComponentType:
      type: string
      enum:
        - GREETING
        - HEADER
        - BODY
        - FOOTER
        - BUTTONS
        - CAROUSEL
        - LIMITED_TIME_OFFER
    MessageTemplateComponentFormat:
      type: string
      enum:
        - TEXT
        - IMAGE
        - DOCUMENT
        - VIDEO
        - LOCATION
    TemplateMessageComponentButton:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/TemplateMessageButtonType'
        text:
          type: string
        phone_number:
          type: string
        example:
          type: array
          items:
            type: string
        url:
          type: string
    TemplateMessageComponentExample:
      type: object
      properties:
        header_handle:
          type: array
          items:
            type: string
          description: For media headers (IMAGE, VIDEO, DOCUMENT).
        header_text:
          type: array
          items:
            type: string
          description: For positional header text examples.
        header_text_named_params:
          type: array
          description: For named parameters in header components.
          items:
            type: object
            properties:
              param_name:
                type: string
              example:
                type: string
            required:
              - param_name
              - example
        body_text:
          type: array
          items:
            type: array
            items:
              type: string
          description: For positional examples in body components.
        body_text_named_params:
          type: array
          description: For named parameters in body components.
          items:
            type: object
            properties:
              param_name:
                type: string
              example:
                type: string
            required:
              - param_name
              - example
    TemplateMessageLimitedTimeOfferParameter:
      type: object
      description: Limited time offer parameters, if applicable.
      properties:
        offer_code:
          type: string
        expiry_minutes:
          type: integer
    WhatsAppBusinessHSMWhatsAppHSMComponent:
      type: object
      properties:
        add_security_recommendation:
          type: boolean
        buttons:
          type: array
          items:
            $ref: '#/components/schemas/TemplateMessageComponentButton'
        cards:
          type: array
          items:
            type: object
        code_expiration_minutes:
          type: integer
        example:
          $ref: '#/components/schemas/TemplateMessageComponentExample'
        format:
          $ref: '#/components/schemas/MessageTemplateComponentFormat'
        limited_time_offer:
          $ref: '#/components/schemas/TemplateMessageLimitedTimeOfferParameter'
        text:
          type: string
        type:
          $ref: '#/components/schemas/MessageTemplateComponentType'
    TemplateMessageQualityScore:
      type: object
      properties:
        date:
          type: integer
        reasons:
          type: array
          items:
            type: string
        score:
          type: integer
    NotificationSchema:
      type: object
      properties:
        uniqueId:
          type: string
        title:
          type: string
        description:
          type: string
        type:
          type: string
        ctaUrl:
          type: string
        createdAt:
          type: string
          format: date-time
        read:
          type: boolean
        organizationId:
          type: string
      required:
        - uniqueId
        - title
        - description
        - type
        - createdAt
        - read
        - organiztionId
    GetUserNotificationsResponseSchema:
      type: object
      properties:
        unreadCount:
          type: integer
        notifications:
          type: array
          items:
            $ref: '#/components/schemas/NotificationSchema'
        paginationMeta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - notifications
        - paginationMeta
        - unreadCount
    AiChatMessageRoleEnum:
      type: string
      enum:
        - User
        - System
        - Assistant
        - Data
    AiChatMessageSchema:
      type: object
      properties:
        uniqueId:
          type: string
        createdAt:
          type: string
          format: date-time
        role:
          $ref: '#/components/schemas/AiChatMessageRoleEnum'
        content:
          type: string
      required:
        - uniqueId
        - createdAt
        - content
        - role
    AiChatSchema:
      type: object
      properties:
        uniqueId:
          type: string
        createdAt:
          type: string
          format: date-time
        title:
          type: string
        description:
          type: string
      required:
        - uniqueId
        - title
        - createdAt
    GetAiChatByIdResponseSchema:
      type: object
      properties:
        chat:
          $ref: '#/components/schemas/AiChatSchema'
      required:
        - chat
    GetAiChatMessagesResponseSchema:
      type: object
      properties:
        messages:
          type: array
          items:
            $ref: '#/components/schemas/AiChatMessageSchema'
        paginationMeta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - messages
        - paginationMeta
    AiChatMessageVoteCreateSchema:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/AiChatMessageVoteEnum'
        messageId:
          type: string
      required:
        - vote
        - messageId
    CreateAiChatMessageVoteResponseSchema:
      type: object
      properties:
        vote:
          $ref: '#/components/schemas/AiChatMessageVoteSchema'
      required:
        - vote
    GetAiChatVotesResponseSchema:
      type: object
      properties:
        votes:
          type: array
          items:
            $ref: '#/components/schemas/AiChatMessageVoteSchema'
        paginationMeta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - votes
        - paginationMeta
    AiChatMessageVoteSchema:
      type: object
      properties:
        uniqueId:
          type: string
        messageId:
          type: string
        vote:
          $ref: '#/components/schemas/AiChatMessageVoteEnum'
        createdAt:
          type: string
          format: date-time
      required:
        - uniqueId
        - vote
        - createdAt
        - messageId
    GetAiChatsResponseSchema:
      type: object
      properties:
        chats:
          type: array
          items:
            $ref: '#/components/schemas/AiChatSchema'
        paginationMeta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - chats
        - paginationMeta
    AiChatQuerySchema:
      type: object
      properties:
        query:
          type: string
      required:
        - query
    SegmentationRecommendation:
      type: object
      properties:
        lists:
          type: array
          items:
            $ref: '#/components/schemas/ContactListSchema'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagSchema'
      required:
        - lists
        - tags
    GetSegmentationRecommendationsResponse:
      type: object
      properties:
        recommendations:
          type: array
          items:
            $ref: '#/components/schemas/SegmentationRecommendation'
      required:
        - recommendations
    GetResponseSuggestionsResponse:
      type: object
      properties:
        suggestions:
          type: array
          items:
            type: string
      required:
        - suggestions
    GetOrganizationInviteBySlugResponseSchema:
      type: object
      properties:
        invite:
          $ref: '#/components/schemas/OrganizationMemberInviteSchema'
      required:
        - invite
    AcceptOrganizationInviteResponseSchema:
      type: object
      properties:
        token:
          type: string
      required:
        - token
    NotFoundErrorResponseSchema:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    InternalServerErrorResponseSchema:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    RateLimitErrorResponseSchema:
      type: object
      properties:
        message:
          type: string
        remaining:
          type: integer
        reset:
          type: integer
      required:
        - message
        - remaining
        - reset
    BadRequestErrorResponseSchema:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    UnauthorizedErrorResponseSchema:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    ResetPasswordInitResponseBodySchema:
      type: object
      properties:
        isOtpSent:
          type: boolean
      required:
        - isOtpSent
    ResetPasswordVerifyResponseBodySchema:
      type: object
      properties:
        isVerified:
          type: boolean
      required:
        - isVerified
    ResetPasswordCompleteResponseBodySchema:
      type: object
      properties:
        isPasswordReset:
          type: boolean
      required:
        - isPasswordReset
    UploadFileInConversationResponseSchema:
      type: object
      properties:
        mediaId:
          type: string
        mediaUrl:
          type: string
      required:
        - mediaId
        - mediaUrl
    MarkConversationAsReadResponseSchema:
      type: object
      properties:
        isRead:
          type: boolean
      required:
        - isRead
    CountryEnum:
      type: string
      enum:
        - United States
        - European Union
        - Japan
        - United Kingdom
        - Australia
        - Canada
        - Switzerland
        - China
        - Sweden
        - New Zealand
        - India
        - Russia
        - Brazil
        - South Africa
        - Mexico
        - Singapore
        - Hong Kong
        - Norway
        - South Korea
        - Turkey
        - Indonesia
        - Thailand
        - Malaysia
        - Philippines
        - Poland
        - Denmark
        - Hungary
        - Czech Republic
        - Israel
        - Chile
        - Pakistan
        - United Arab Emirates
        - Colombia
        - Saudi Arabia
        - Taiwan
        - Vietnam
        - Nigeria
        - Bangladesh
        - Egypt
        - Kazakhstan
        - Qatar
        - Kenya
        - Sri Lanka
        - Peru
        - Ukraine
        - Romania
        - Zambia
        - Oman
    CurrencyEnum:
      type: string
      enum:
        - USD
        - EUR
        - JPY
        - GBP
        - AUD
        - CAD
        - CHF
        - CNY
        - SEK
        - NZD
        - INR
        - RUB
        - BRL
        - ZAR
        - MXN
        - SGD
        - HKD
        - NOK
        - KRW
        - TRY
        - IDR
        - THB
        - MYR
        - PHP
        - PLN
        - DKK
        - HUF
        - CZK
        - ILS
        - CLP
        - PKR
        - AED
        - COP
        - SAR
        - TWD
        - VND
        - NGN
        - BDT
        - EGP
        - KZT
        - QAR
        - KES
        - LKR
        - PEN
        - UAH
        - RON
        - ZMW
        - OMR
    PlanValidityEnum:
      type: string
      enum:
        - Monthly
        - Yearly
    PlanTypeEnum:
      type: string
      enum:
        - Subscription
        - OneTime
    SubscriptionStatusEnum:
      type: string
      enum:
        - Active
        - Cancelled
        - Upgraded
    PurchaseGatewayEnum:
      type: string
      enum:
        - Stripe
        - Razorpay
        - Paypal
    PurchaseStatusEnum:
      type: string
      enum:
        - Paid
        - Refunded
    PricingPlanTierEnum:
      type: string
      enum:
        - Pro
        - Scale
        - Starter
        - ScalePlus
        - ScaleMax
        - Enterprise
    PricingPlan:
      type: object
      properties:
        uniqueId:
          type: string
        title:
          type: string
        description:
          type: string
        validity:
          $ref: '#/components/schemas/PlanValidityEnum'
        priceString:
          type: string
        ctaText:
          type: string
        shouldCtaBeDisabled:
          type: boolean
        actualPriceInLowestCurrencyUnits:
          type: number
          format: float
        finalPriceInLowestCurrencyUnits:
          type: number
          format: float
        discountCouponApplied:
          $ref: '#/components/schemas/DiscountCoupon'
        currency:
          $ref: '#/components/schemas/CurrencyEnum'
        currencySymbol:
          type: string
          default: $
        isPopular:
          type: boolean
        tier:
          $ref: '#/components/schemas/PricingPlanTierEnum'
      required:
        - uniqueId
        - title
        - validity
        - isPopular
        - tier
        - currency
        - currencySymbol
        - actualPriceInLowestCurrencyUnits
        - finalPriceInLowestCurrencyUnits
        - ctaText
        - priceString
        - shouldCtaBeDisabled
        - description
    DiscountCoupon:
      type: object
      properties:
        uniqueId:
          type: string
        title:
          type: string
        code:
          type: string
        percentageDiscount:
          type: number
          format: float
      required:
        - uniqueId
        - title
        - code
        - percentageDiscount
    CheckoutResponseSchema:
      type: object
      properties:
        razorpaySessionId:
          type: string
        verificationToken:
          type: string
      required:
        - razorpaySessionId
        - verificationToken
    GetPricingPlansResponseSchema:
      type: object
      properties:
        plans:
          type: array
          items:
            $ref: '#/components/schemas/PricingPlan'
      required:
        - plans
    VerifyPaymentResponseSchema:
      type: object
      properties:
        isVerified:
          type: boolean
      required:
        - isVerified
    CancelSubscriptionResponseSchema:
      type: object
      properties:
        isCancelled:
          type: boolean
      required:
        - isCancelled
    RefundPaymentResponseSchema:
      type: object
      properties:
        isRefundedInitiated:
          type: boolean
      required:
        - isRefunded
    SubscriptionDetails:
      type: object
      properties:
        uniqueId:
          type: string
        tier:
          $ref: '#/components/schemas/PricingPlanTierEnum'
        status:
          $ref: '#/components/schemas/SubscriptionStatusEnum'
        gateway:
          $ref: '#/components/schemas/PurchaseGatewayEnum'
        willBeCancelledAtEndOfPeriod:
          type: boolean
        validTill:
          type: string
          format: date-time
        validityDuration:
          $ref: '#/components/schemas/PlanValidityEnum'
        isRefundAllowed:
          type: boolean
      required:
        - uniqueId
        - tier
        - status
        - gateway
        - willBeCancelledAtEndOfPeriod
        - validTill
        - validityDuration
        - isRefundAllowed
    GetSubscriptionDetailsResponseSchema:
      type: object
      properties:
        subscriptionDetails:
          $ref: '#/components/schemas/SubscriptionDetails'
      required:
        - subscriptionDetails
    LoginWithOAuthRequestBodySchema:
      type: object
      properties:
        provider:
          type: string
        token:
          type: string
      required:
        - provider
        - token
    OauthRegisterRequestBodySchema:
      type: object
      properties:
        token:
          type: string
        username:
          type: string
        name:
          type: string
        utmSource:
          type: string
        utmMedium:
          type: string
        utmCampaign:
          type: string
        organizationInviteSlug:
          type: string
      required:
        - username
        - name
        - token
    OauthRegisterResponseSchema:
      type: object
      properties:
        token:
          type: string
      required:
        - token
    CatalogProductSchema:
      type: object
      properties:
        uniqueId:
          type: string
        title:
          type: string
        retailerId:
          type: string
        description:
          type: string
        category:
          type: string
        condition:
          type: string
        priceString:
          type: string
        catalogId:
          type: string
        finalPriceString:
          type: string
        currency:
          $ref: '#/components/schemas/CurrencyEnum'
        url:
          type: string
        color:
          type: string
        images:
          type: array
          items:
            type: string
        availability:
          type: string
        metaProductId:
          type: string
        inventoryCount:
          type: integer
      required:
        - uniqueId
        - title
        - finalPriceString
        - currency
        - priceString
        - retailerId
        - url
        - images
        - availability
        - metaProductId
        - catalogId
    ProductCatalogSchema:
      type: object
      properties:
        uniqueId:
          type: string
        lastSyncedOn:
          type: string
          format: dat-time
        name:
          type: string
        description:
          type: string
        status:
          type: string
        metaCatalogId:
          type: string
        productsCount:
          type: integer
        products:
          type: array
          items:
            $ref: '#/components/schemas/CatalogProductSchema'
      required:
        - uniqueId
        - lastSyncedOn
        - name
        - products
        - productsCount
        - status
        - metaCatalogId
    GetAllCatalogsResponseSchema:
      type: object
      properties:
        catalogs:
          type: array
          items:
            $ref: '#/components/schemas/ProductCatalogSchema'
      required:
        - catalogs
    SyncProductCatalogResponseSchema:
      type: object
      properties:
        isSynced:
          type: boolean
    GetOrganizationDescriptionResponseSchema:
      type: object
      properties:
        description:
          type: string
      required:
        - description
    UpdateUserOnboardingDataRequestBodySchema:
      type: object
      properties:
        discoverSource:
          $ref: '#/components/schemas/DiscoverSourceEnum'
        userFunction:
          $ref: '#/components/schemas/UserFunctionEnum'
        industry:
          $ref: '#/components/schemas/IndustryEnum'
    UpdateUserOnboardingDataResponseSchema:
      type: object
      properties:
        isUpdated:
          type: boolean
      required:
        - isUpdated
    ReportFrontendErrorRequestBodySchema:
      type: object
      properties:
        error:
          type: string
        stackTrace:
          type: string
        userId:
          type: string
        organizationId:
          type: string
    ReportFrontendErrorResponseSchema:
      type: object
      properties:
        isReported:
          type: boolean
      required:
        - isReported
    OrganizationPredictiveInsightResponseSchema:
      type: object
      properties:
        type:
          type: string
        description:
          type: string
        confidence:
          type: number
          format: float
        data:
          type: object
          additionalProperties: true
        createdAt:
          type: string
          format: date-time
      required:
        - type
        - description
        - confidence
        - data
        - createdAt
    GetOrganizationInsightsResponseSchema:
      type: object
      properties:
        insights:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationPredictiveInsightResponseSchema'
      required:
        - insights
    GenerateConversationSummaryResponseSchema:
      type: object
      properties:
        summary:
          type: string
        keyPoints:
          type: array
          items:
            type: string
        mainTopics:
          type: array
          items:
            type: string
        intents:
          type: array
          items:
            type: string
        behavioralAnalysis:
          type: array
          items:
            type: string
        conversationFlow:
          type: array
          items:
            type: string
      required:
        - summary
        - keyPoints
        - mainTopics
        - intents
        - behavioralAnalysis
        - conversationFlow
    CompleteSmartOnboardingResponseSchema:
      type: object
      properties:
        isCompleted:
          type: boolean
      required:
        - isCompleted
    ConversationAutoHandlingRequestSchema:
      type: object
      properties:
        isEnabled:
          type: boolean
      required:
        - isEnabled
    ConversationAutoHandlingResponseSchema:
      type: object
      properties:
        isEnabled:
          type: boolean
      required:
        - isEnabled
    QuickStartMenuItem:
      type: object
      properties:
        title:
          type: string
        description:
          type: string
        ctaUrl:
          type: string
        ctaLabel:
          type: string
      required:
        - title
        - description
        - ctaUrl
        - ctaLabel
    QuickStartMenuResponseSchema:
      type: object
      properties:
        menu:
          type: array
          items:
            $ref: '#/components/schemas/QuickStartMenuItem'
      required:
        - menu
    KnowledgeBaseItem:
      type: object
      properties:
        uniqueId:
          type: string
        title:
          type: string
        content:
          type: string
        url:
          type: string
        type:
          type: string
          enum:
            - Document
            - Url
            - Text
            - Media
        status:
          type: string
          enum:
            - Created
            - Processing
            - Indexed
            - Deleted
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - uniqueId
        - title
        - content
        - url
        - type
        - status
        - createdAt
        - updatedAt
    GetKnowledgeBaseItemsResponseSchema:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgeBaseItem'
        paginationMeta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - items
        - paginationMeta
    DeleteKnowledgeBaseItemResponseSchema:
      type: object
      properties:
        isDeleted:
          type: boolean
      required:
        - isDeleted
    CreateKnowledgeBaseItemSchema:
      type: object
      properties:
        title:
          type: string
        description:
          type: string
        url:
          type: string
        type:
          type: string
          enum:
            - Document
            - Url
            - Text
            - Media
        resyncScheduleFrequency:
          type: string
          enum:
            - Never
            - Daily
            - Weekly
            - Monthly
        scrapeFullWebsite:
          type: boolean
        fileName:
          type: string
      required:
        - title
        - url
        - type
    CreateKnowledgeBaseItemResponseSchema:
      type: object
      properties:
        uniqueId:
          type: string
      required:
        - uniqueId
    GetUploadUrlResponseSchema:
      type: object
      properties:
        uploadUrl:
          type: string
        getUrl:
          type: string
      required:
        - uploadUrl
        - getUrl
    CreateConversationSchema:
      type: object
      properties:
        contactId:
          type: string
      required:
        - contactId
    CreateConversationResponseSchema:
      type: object
      properties:
        uniqueId:
          type: string
      required:
        - uniqueId
