> ## 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.

# End Call

> Terminates an active WhatsApp call. Transitions the call status to `END` and records the `endTimestamp`. This endpoint does not require plan validation and can always be called to terminate a call.



## OpenAPI

````yaml POST /api/pub/wa/call/end
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/call/end:
    post:
      tags:
        - Call
      summary: End Call
      description: >-
        Terminates an active WhatsApp call. Transitions the call status to `END`
        and records the `endTimestamp`. This endpoint does not require plan
        validation and can always be called to terminate a call.
      requestBody:
        description: End call payload
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EndCallRequest'
      responses:
        '200':
          description: Call terminated. Status is now `END`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallActionResponse'
              example:
                status: 200
                success: true
                error: null
                msg: Call ended.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          description: Internal Server Error or Meta API failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                status: 500
                success: false
                error: Unable to terminate call with Meta.
      security:
        - AppIdAuth: []
          AppSecretAuth: []
components:
  schemas:
    EndCallRequest:
      type: object
      description: Payload for ending an active call.
      properties:
        id:
          type: string
          description: The `_id` of the WaCall record to terminate.
          example: 64f1a2b3c4d5e6f7a8b9c0d1
      required:
        - id
    CallActionResponse:
      type: object
      description: Generic success response for call action endpoints.
      properties:
        status:
          type: integer
          example: 200
        success:
          type: boolean
          example: true
        error:
          type: 'null'
          example: null
        msg:
          type: string
          example: Call accepted.
    ErrorResponse:
      type: object
      properties:
        status:
          type: integer
          example: 500
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Internal Server Error!
  responses:
    BadRequest:
      description: >-
        Bad Request. A required field is missing or an item is in an invalid
        state.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            MissingTemplate:
              value:
                status: 400
                success: false
                error: Template id not provided!
            TemplateNotApproved:
              value:
                status: 400
                success: false
                error: Template is not approved!
            WabaNotConnected:
              value:
                status: 400
                success: false
                error: WhatsApp Account Not Connected or Exist!
    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.'
    NotFound:
      description: >-
        Not Found. The requested resource (template, contact) could not be
        found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 404
            success: false
            error: Template not found!
  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.

````