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

# Update a gateway

> Updates a gateway. Send only the fields you want to change.



## OpenAPI

````yaml /api-reference/rest/openapi.yaml patch /v2/sip/phone-numbers/gateways/{gatewayId}
openapi: 3.1.0
info:
  title: Zero Runtime REST API
  version: '1.0'
  description: >-
    Create, configure, version and deploy agents, and wire SIP telephony to
    them.
servers:
  - url: https://api.zeroruntime.ai
security:
  - token: []
tags:
  - name: Agents
  - name: Versions
  - name: Deployment
  - name: Phone numbers
  - name: Routing rules
  - name: Calls
  - name: Batch calls
  - name: Knowledge bases
  - name: Knowledge base folders
paths:
  /v2/sip/phone-numbers/gateways/{gatewayId}:
    patch:
      tags:
        - Phone numbers
      summary: Update a gateway
      description: Updates a gateway. Send only the fields you want to change.
      parameters:
        - name: gatewayId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                mediaEncryption:
                  $ref: '#/components/schemas/MediaEncryption'
                sipRegion:
                  $ref: '#/components/schemas/SipRegion'
                address:
                  type: string
                  description: Outbound gateways only.
                transport:
                  allOf:
                    - $ref: '#/components/schemas/Transport'
                  description: Outbound gateways only.
                auth:
                  allOf:
                    - $ref: '#/components/schemas/SipAuth'
                  description: Outbound gateways only. Send both `username` and `password`.
            examples:
              outbound:
                summary: Outbound gateway
                value:
                  name: Support SIP (EU)
                  mediaEncryption: enable
                  sipRegion: in002
                  address: sip-eu.my-carrier.com
                  transport: tls
                  auth:
                    username: sip-user
                    password: rotated-s3cr3t
              inbound:
                summary: Inbound gateway
                value:
                  name: Support SIP
                  mediaEncryption: enable
                  sipRegion: us002
      responses:
        '200':
          description: Gateway updated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Gateway updated successfully
                  gateway:
                    $ref: '#/components/schemas/Gateway'
        '400':
          description: >-
            A field isn't allowed. Numbers can't be changed here (use create and
            detach), `isShared` is fixed, and `address`, `transport` and `auth`
            are outbound only.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
components:
  schemas:
    MediaEncryption:
      type: string
      enum:
        - enable
        - disable
      default: disable
    SipRegion:
      type: string
      enum:
        - auto
        - us002
        - in002
      description: '`auto` stores no region and lets us pick.'
    Transport:
      type: string
      enum:
        - udp
        - tcp
        - tls
      default: tls
    SipAuth:
      type: object
      description: Stored only when both fields are present.
      properties:
        username:
          type: string
        password:
          type: string
    Gateway:
      type: object
      properties:
        id:
          type: string
        address:
          type:
            - string
            - 'null'
        numbers:
          type: array
          items:
            type: string
        mediaEncryption:
          $ref: '#/components/schemas/MediaEncryption'
        transport:
          $ref: '#/components/schemas/Transport'
        geoRegion:
          type: string
          example: us002
        auth:
          $ref: '#/components/schemas/SipAuth'
    Message:
      type: object
      properties:
        message:
          type: string
  securitySchemes:
    token:
      type: apiKey
      in: header
      name: Authorization
      description: Your API token, sent raw (no `Bearer` prefix).
      x-default: <auth-token>

````

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