> ## Documentation Index
> Fetch the complete documentation index at: https://docs.adsera.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Take Over a Chat

> Takes the chat with this customer away from the Meta AI Agent, so your team or your system answers it. Requires the Meta AI Agent to be enabled for your account and set up on the number.



## OpenAPI

````yaml POST /api/pub/wa/business-agent/threads/take
openapi: 3.1.0
info:
  title: AdsEra REST API
  description: >-
    Welcome to the AdsEra REST API. Use our API to integrate powerful,
    multi-channel communication (Email and WhatsApp) directly into your
    applications. Automate transactional messages, trigger marketing campaigns,
    manage your audience, and track performance programmatically.
  contact:
    name: Shubham
    email: shubham@adsera.in
  version: 1.0.0
servers:
  - url: https://app.adsera.in
    description: Production Server
security:
  - AppIdAuth: []
    AppSecretAuth: []
paths:
  /api/pub/wa/business-agent/threads/take:
    post:
      tags:
        - Meta AI Agent
      summary: Take Over a Chat
      description: >-
        Takes the chat with this customer away from the Meta AI Agent, so your
        team or your system answers it. Requires the Meta AI Agent to be enabled
        for your account and set up on the number.
      operationId: takeThread
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ThreadRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    description: Who answers the chat now.
        '400':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessAgentError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessAgentError'
        '404':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessAgentError'
        '409':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessAgentError'
        '500':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessAgentError'
components:
  schemas:
    ThreadRequest:
      type: object
      required:
        - phoneId
        - to
      properties:
        phoneId:
          type: string
          description: The Meta phone number ID of your WhatsApp number.
        to:
          type: string
          description: >-
            Customer phone number with country code. The contact must exist in
            AdsEra.
    BusinessAgentError:
      type: object
      properties:
        success:
          type: boolean
          example: false
        code:
          type: string
          enum:
            - FEATURE_DISABLED
            - META_NOT_FOUND
            - NOT_ONBOARDED
            - INVALID_INPUT
            - TAKE_NOT_ALLOWED
            - SERVER_ERROR
        message:
          type: string
    ErrorResponse:
      type: object
      properties:
        status:
          type: integer
          example: 500
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Internal Server Error!
  responses:
    Unauthorized:
      description: Unauthorized. The API keys are missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 401
            success: false
            error: 'Unauthorized: Please provide valid API credentials.'
  securitySchemes:
    AppIdAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Your application's unique ID.
    AppSecretAuth:
      type: apiKey
      in: header
      name: x-api-secret
      description: Your application's secret key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.