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

# Set WhatsApp Answering Agent

> Choose the Bolna agent that answers WhatsApp voice calls on a connected number. The number goes live as soon as the agent is set.



## OpenAPI

````yaml POST /whatsapp/numbers/{number_id}/map-agent
openapi: 3.1.0
info:
  title: Bolna API
  description: >-
    Use and leverage Bolna Voice AI using APIs through HTTP requests from any
    language in your applications and workflows.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.bolna.ai
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: SIP trunks
    description: >-
      Bring-your-own-carrier SIP trunks, their gateways, carrier IPs and
      numbers.
paths:
  /whatsapp/numbers/{number_id}/map-agent:
    post:
      description: >-
        Choose the agent that answers WhatsApp calls on this number. The number
        must be in the `calling_enabled` or `live` state, and becomes `live`.
        Calling it again on a live number switches the answering agent.
      parameters:
        - in: path
          name: number_id
          required: true
          schema:
            type: string
          description: The `number_id` returned when the number was connected
      requestBody:
        content:
          application/json:
            schema:
              required:
                - agent_id
              properties:
                agent_id:
                  type: string
                  format: uuid
                  description: >-
                    The `id` of the agent that answers calls on this number. Any
                    of your agents can be used, whatever its telephony provider.
                  example: 3c90c3cc-0d44-4b50-8888-8dd25736052a
        required: true
      responses:
        '200':
          description: Agent linked, the number is live
          content:
            application/json:
              example:
                number_id: 9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d
                agent_id: 3c90c3cc-0d44-4b50-8888-8dd25736052a
                state: live
        '400':
          description: invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: agent not found for this account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: number not found for this account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            calling is not enabled on the number yet, or the number is already
            on Bolna as a regular phone number, from another telephony provider
            or on another account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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