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

# Update Phone Number

> Changes which environment inbound calls on this number run on. Send null for production.



## OpenAPI

````yaml PATCH /agents/{id}/phone-numbers/{phoneId}
openapi: 3.1.0
info:
  title: RevRing Voice AI API
  description: >-
    RevRing Voice AI platform API for managing AI voice agents, phone calls, SIP
    trunks, and analytics. Build intelligent voice applications that can handle
    inbound and outbound phone calls with AI-powered conversational agents.
  version: 1.0.0
  contact:
    name: RevRing Support
    url: https://revring.ai
servers:
  - url: https://api.revring.ai/v1
    description: Production API
security:
  - apiKeyAuth: []
tags:
  - name: Messaging Connections
    description: Connect messaging providers so agents can send text messages
  - name: Messages
    description: Send text messages and read your message log
  - name: Conversations
    description: List and clear managed conversation threads
  - name: SIP Trunks
    description: Manage SIP trunks for connecting agents to the phone network
  - name: Agents
    description: Manage AI voice agents and their configuration
  - name: Agent Folders
    description: Organize agents into folders for dashboard navigation
  - name: Calls
    description: Manage and query phone calls
  - name: Analytics
    description: Get analytics and metrics about your calls
  - name: Knowledge Bases
    description: >-
      Manage knowledge bases and sources for agent retrieval-augmented
      generation
  - name: Test Suites
    description: Manage test suites, test cases, and test runs for agent evaluation
  - name: Voices
    description: Browse the voices available to your organization for agent speech
  - name: Webhooks
    description: Webhook delivery settings for your organization
paths:
  /agents/{id}/phone-numbers/{phoneId}:
    parameters:
      - name: id
        in: path
        required: true
        description: Agent ID
        schema:
          type: string
          format: uuid
      - name: phoneId
        in: path
        required: true
        description: Phone number ID
        schema:
          type: string
          format: uuid
    patch:
      tags:
        - Agents
      summary: Update Phone Number
      description: >-
        Changes which environment inbound calls on this number run on. Send null
        for production.
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - environment
              properties:
                environment:
                  type: string
                  nullable: true
                  pattern: ^[a-z][a-z0-9-]{0,31}$
      responses:
        '200':
          description: Phone number
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/AgentPhoneNumber'
        '400':
          description: invalid_body | environment_not_found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
components:
  schemas:
    AgentPhoneNumber:
      type: object
      properties:
        id:
          type: string
          format: uuid
        e164:
          type: string
          pattern: ^\+[1-9]\d{1,14}$
          description: Phone number in E.164 format
        environment:
          type: string
          nullable: true
          description: >-
            Agent environment inbound calls on this number run on; null means
            production (see Versions and Publishing)
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - e164
        - createdAt
        - updatedAt
  responses:
    UnauthorizedError:
      description: Authentication required or API key invalid
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: unauthorized
    NotFoundError:
      description: Resource not found
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: not_found
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. Generate API keys from the RevRing
        dashboard.

````

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