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

# Save SIP Config

> Save the SIP trunk configuration for an agent.

Tuner connects to the trunk to verify the details before saving. The
configuration is only stored if the check succeeds, so a successful response
means the trunk is reachable.



## OpenAPI

````yaml https://api.usetuner.ai/public/openapi.json put /api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/sip-config
openapi: 3.1.0
info:
  title: My Public API
  version: 1.0.0
servers:
  - url: https://api.usetuner.ai
security: []
tags:
  - name: calls
    x-group: Calls
  - name: workspaces
    x-group: Workspaces
  - name: agent-settings
    x-group: Agent Settings
  - name: agents
    x-group: Agents
  - name: simulation
    x-group: Simulation
  - name: providers
    x-group: Providers
paths:
  /api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/sip-config:
    put:
      tags:
        - agent-settings
      summary: Save SIP Config
      description: >-
        Save the SIP trunk configuration for an agent.


        Tuner connects to the trunk to verify the details before saving. The

        configuration is only stored if the check succeeds, so a successful
        response

        means the trunk is reachable.
      operationId: >-
        upsert_sip_config_api_v1_workspaces__workspace_id__agents__agent_id__settings_sip_config_put
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: integer
            description: Tuner's internal numeric ID for the agent.
            title: Agent Id
          description: Tuner's internal numeric ID for the agent.
        - name: workspace_id
          in: path
          required: true
          schema:
            type: integer
            description: Workspace ID. Find this in Workspace > General Settings.
            title: Workspace Id
          description: Workspace ID. Find this in Workspace > General Settings.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SipConfigUpsertRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SipConfigResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              example:
                detail: Not authenticated
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: You do not have access to this workspace.
          content:
            application/json:
              example:
                detail: User does not have access to workspace 42
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Agent not found.
          content:
            application/json:
              example:
                detail: Agent with ID 17 not found
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            The SIP connectivity check failed — the trunk could not be reached
            or did not answer the verification call.
          content:
            application/json:
              example:
                detail: >-
                  SIP verification failed: SIP verification timed out after 10s
                  — endpoint did not answer
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: The SIP connectivity check timed out after 12 seconds.
          content:
            application/json:
              example:
                detail: SIP probe timed out
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Bearer: []
components:
  schemas:
    SipConfigUpsertRequest:
      properties:
        sip_url:
          type: string
          maxLength: 500
          minLength: 1
          title: Sip Url
          description: SIP URI, e.g. sip:user@host:5060
        sip_username:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
          title: Sip Username
        sip_password:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Sip Password
      type: object
      required:
        - sip_url
      title: SipConfigUpsertRequest
    SipConfigResponse:
      properties:
        id:
          type: integer
          title: Id
        settings_id:
          type: integer
          title: Settings Id
        workspace_id:
          type: integer
          title: Workspace Id
        sip_url:
          type: string
          title: Sip Url
        sip_username:
          anyOf:
            - type: string
            - type: 'null'
          title: Sip Username
        sip_password:
          anyOf:
            - type: string
            - type: 'null'
          title: Sip Password
        is_sip_verified:
          type: boolean
          title: Is Sip Verified
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - settings_id
        - workspace_id
        - sip_url
        - sip_username
        - sip_password
        - is_sip_verified
        - created_at
        - updated_at
      title: SipConfigResponse
    ErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable description of what went wrong.
      type: object
      required:
        - detail
      title: ErrorResponse
      description: Error body returned when a request fails.
  securitySchemes:
    Bearer:
      type: http
      description: >-
        Use Tuner API key (tr_api_...) or user session token. Find your API key
        in Workspace Settings > API Keys.
      scheme: bearer

````