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

# AI Call Endpoint

> Retrieve the call endpoint URL for a specific AI agent. This endpoint provides the unique URL that can be used to initiate calls with the specified agent.

## AI Call Endpoint

Retrieve the call endpoint URL for a specific AI agent. This endpoint provides the unique URL that can be used to initiate calls with the specified agent.

<ParamField body="query" path="agent_id" type="string" required>
  The unique identifier of the agent (e.g., `agent_07a9005357b35d0943f7359ad9`)
</ParamField>

<ParamField body="header" path="Authorization" type="string" required>
  Bearer token in the format: `Bearer {access_token}`
</ParamField>

<ParamField body="header" path="Content-Type" type="string" required>
  Must be set to `application/json`
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl --location 'https://app.aisync.link/api/ai/agent/call-endpoint?agent_id=agent_07a9005357b35d0943f7359ad9' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer {{bearer_token}}'
  ```
</CodeGroup>

<ResponseField name="status" type="string">
  Response status (e.g., "success")
</ResponseField>

<ResponseField name="data" type="object">
  Response data object containing endpoint information
</ResponseField>

<ResponseField name="data.endpoint" type="string">
  The unique endpoint URL for initiating calls with this agent
</ResponseField>

<ResponseField name="data.Method" type="string">
  The HTTP method to use when calling the endpoint (typically "POST")
</ResponseField>

<ResponseField name="data.form_data" type="array">
  Array of form field names that must be included when making a POST request to the endpoint:

  * `phone_number`: The phone number to call
  * `email`: Contact email address
  * `first_name`: Contact's first name
  * `last_name`: Contact's last name
  * `ghl_contact_id`: GoHighLevel contact ID
  * `override_agent_id`: Agent ID override (optional)
  * `local_presence_number`: Set to "Yes" to make the call from AI local presence number, or "No" otherwise
</ResponseField>

<Note>
  Use the returned endpoint URL with POST method and include the required form\_data fields to initiate conversations with your AI agent. The endpoint is unique to each agent. When `local_presence_number` is set to "Yes", the call will be made from the AI local presence number.
</Note>


## OpenAPI

````yaml GET /api/ai/agent/call-endpoint
openapi: 3.1.0
info:
  title: AI Sync OAuth API
  description: OAuth 2.0 API for authenticating and authorizing third-party applications
  version: 1.0.0
servers:
  - url: https://app.aisync.link
    description: Production server
security: []
paths:
  /api/ai/agent/call-endpoint:
    get:
      tags:
        - AI Agents
      summary: AI Call Endpoint
      description: >-
        Retrieve the call endpoint URL for a specific AI agent. This endpoint
        provides the unique URL that can be used to initiate calls with the
        specified agent.
      operationId: getCallEndpoint
      parameters:
        - name: agent_id
          in: query
          description: >-
            The unique identifier of the agent (e.g.,
            agent_07a9005357b35d0943f7359ad9)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Call endpoint URL
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallEndpointResponse'
              example:
                status: success
                data:
                  endpoint: ''
                  Method: POST
                  form_data:
                    - phone_number
                    - email
                    - first_name
                    - last_name
                    - ghl_contact_id
                    - override_agent_id
                    - >-
                      local_presence_number=No (Yes/No)<br> [If Yes, then the
                      call will be made from AI local presence number]
        '400':
          description: Invalid agent ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid or expired token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Agent not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    CallEndpointResponse:
      type: object
      properties:
        status:
          type: string
          description: Response status (e.g., 'success')
          example: success
        data:
          type: object
          properties:
            endpoint:
              type: string
              description: The unique endpoint URL for initiating calls with this agent
              example: ''
            Method:
              type: string
              description: The HTTP method to use when calling the endpoint
              example: POST
            form_data:
              type: array
              items:
                type: string
              description: >-
                Array of form field names that must be included when making a
                POST request to the endpoint
              example:
                - phone_number
                - email
                - first_name
                - last_name
                - ghl_contact_id
                - override_agent_id
                - >-
                  local_presence_number=No (Yes/No)<br> [If Yes, then the call
                  will be made from AI local presence number]
          required:
            - endpoint
            - Method
            - form_data
      required:
        - status
        - data
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error code
        error_description:
          type: string
          description: Human-readable error description
        message:
          type: string
          description: Error message
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer token authentication. Include the access token in the
        Authorization header as 'Bearer {access_token}'

````