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

# Update a peer

> Modifies the configuration of an existing peer, such as its subnets or routing behavior.



## OpenAPI

````yaml /api/en/managed-vpn.yaml put /vpn/instances/{instanceId}/peers/{peerId}
openapi: 3.0.3
info:
  title: Altostrat Managed VPN API
  version: 1.0.0
  description: >-
    Manage SDX managed VPN instances, peers, site subnets, regions, and
    user-facing client configuration through the public `/vpn` gateway path.
servers:
  - url: https://v1.api.altostrat.io
    description: Altostrat Production API
security: []
tags:
  - name: Instances
    description: Manage VPN instances, which are the core server deployments.
  - name: Peers
    description: Manage peers, which are the clients and sites connecting to an instance.
  - name: Utilities
    description: Helper endpoints for retrieving supplementary data like server regions.
  - name: Client Configuration
    description: Retrieve user-facing VPN client configuration bundles.
paths:
  /vpn/instances/{instanceId}/peers/{peerId}:
    put:
      tags:
        - Peers
      summary: Update a peer
      description: >-
        Modifies the configuration of an existing peer, such as its subnets or
        routing behavior.
      operationId: updateInstancePeer
      parameters:
        - name: instanceId
          in: path
          required: true
          description: The unique identifier (UUID) for the VPN instance.
          schema:
            type: string
            format: uuid
            example: d290f1ee-6c54-4b01-90e6-d701748f0851
        - name: peerId
          in: path
          required: true
          description: The unique identifier (UUID) for the peer.
          schema:
            type: string
            format: uuid
            example: 550e8400-e29b-41d4-a716-446655440000
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PeerUpdate'
      responses:
        '200':
          description: The peer was updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Peer'
        '400':
          description: Bad Request - The request was malformed or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden - Insufficient scopes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: The specified instance or peer was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth:
            - vpn:update
components:
  schemas:
    PeerUpdate:
      type: object
      properties:
        subnets:
          type: array
          description: An updated list of subnets for a `site` peer.
          items:
            type: string
            example: 192.168.100.0/24
        route_all:
          type: boolean
          description: An updated `route_all` setting for a `client` peer.
          example: true
    Peer:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The unique identifier for the peer.
          example: 550e8400-e29b-41d4-a716-446655440000
        type:
          type: string
          enum:
            - client
            - site
          description: >-
            The type of peer. `client` represents an individual user, while
            `site` represents a site-to-site connection.
          example: client
        user_id:
          type: string
          format: uuid
          nullable: true
          description: The unique identifier for the user, if the peer is of type `client`.
          example: a1b2c3d4-e5f6-7890-1234-567890abcdef
        site_id:
          type: string
          format: uuid
          nullable: true
          description: The unique identifier for the site, if the peer is of type `site`.
          example: c3d5e2a0-88c9-4f7f-9f7b-6a1e2b4c5d6e
        subnets:
          type: array
          description: >-
            A list of subnets (in CIDR notation) that this peer routes. Only
            applicable for `site` peers.
          items:
            type: string
            example: 192.168.100.0/24
        route_all:
          type: boolean
          description: >-
            If true, all of the client's traffic will be routed through the VPN.
            Only applicable for `client` peers.
          example: false
        protocol:
          type: string
          enum:
            - wireguard
            - openvpn
          description: The VPN protocol used by this peer.
          example: wireguard
        connected:
          type: boolean
          description: Indicates if the peer is currently connected.
          example: false
        connected_from:
          type: string
          format: ipv4
          nullable: true
          description: The public IP address of the connected peer.
          example: null
        token:
          type: string
          nullable: true
          description: >-
            A short-lived token for `client` peers to retrieve their
            configuration files. Not for direct API use.
          example: eyJpdiI6...
        token_ttl:
          type: integer
          description: The time-to-live for the token in seconds.
          example: 3600
        created_at:
          type: string
          format: date-time
          description: The timestamp when the peer was created.
          example: '2025-10-29T12:45:00Z'
    ErrorResponse:
      type: object
      properties:
        type:
          type: string
          description: A broad category for the error (e.g., 'invalid_request_error').
          example: invalid_request_error
        code:
          type: string
          description: A short, unique string identifying the specific error.
          example: parameter_missing
        message:
          type: string
          description: A human-readable description of what went wrong.
          example: The 'name' parameter is required for this request.
        doc_url:
          type: string
          description: >-
            A direct link to the documentation page for this specific error
            code.
          example: https://docs.altostrat.io/errors/parameter_missing
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your bearer token in the format: Bearer {token}'

````