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

# Add destinations to a Devin Connect gateway

> Add destinations to the gateway's list, keeping the existing ones.

Returns 409 when a destination is already routed through another gateway
and 422 when the gateway would exceed 256 destinations.

**Adds** destinations to a [Devin Connect](https://docs.devin.ai/enterprise/deployment/devin-connect.md) gateway, keeping the ones it already routes. This is the same list that "Add destination" edits in the web app. To set the whole list at once, use [Replace gateway destinations](https://docs.devin.ai/api-reference/v3/devin-connect/put-enterprise-devin-connect-gateway-destinations.md).

## Permissions

Requires a [service user](https://docs.devin.ai/api-reference/v3/service-users/members-service-users.md) or [personal access token](https://docs.devin.ai/api-reference/personal-access-tokens.md) with the `ManageEnterpriseSettings` permission at the enterprise level. Devin Connect must be enabled for the enterprise, otherwise the endpoint returns `403`.

## Behavior

* Each destination is either `{"hostname": "scm.corp.example"}` (an exact hostname, no wildcards) or `{"ipv4": "10.20.0.0/16"}` (an IPv4 address or CIDR). Hostnames are lowercased and lose a trailing dot, and a single address becomes a `/32` CIDR.
* Destinations the gateway already routes are left as they are, so repeating a request is safe.
* A destination can belong to only one gateway. Adding one that another gateway already routes returns `409`.
* A gateway holds at most 256 destinations. An add that would go over returns `422`.
* Routing a destination does not let sessions reach it. The session's [security profile](https://docs.devin.ai/product-guides/security-profiles.md) must also allow it. See [Manage destinations with the API](https://docs.devin.ai/enterprise/deployment/devin-connect.md#manage-destinations-with-the-api) for both steps together.
* Your gateway also enforces its own `config.yaml`, so a new destination works only once that file allows it too.
* Changes are recorded in the [audit log](https://docs.devin.ai/api-reference/v3/audit-logs/enterprise-audit-logs.md) as `update_gateway_hostnames`.


## OpenAPI

````yaml v3-openapi.yaml POST /v3beta1/enterprise/devin-connect/gateways/{gateway_id}/destinations
openapi: 3.1.0
info:
  description: Devin v3 API with Service User authentication and RBAC
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3beta1/enterprise/devin-connect/gateways/{gateway_id}/destinations:
    post:
      tags:
        - devin-connect
      summary: Add destinations to a Devin Connect gateway
      description: |-
        Add destinations to the gateway's list, keeping the existing ones.

        Returns 409 when a destination is already routed through another gateway
        and 422 when the gateway would exceed 256 destinations.
      operationId: >-
        handle_add_devin_connect_gateway_destinations_v3beta1_enterprise_devin_connect_gateways__gateway_id__destinations_post
      parameters:
        - in: path
          name: gateway_id
          required: true
          schema:
            title: Gateway Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DevinConnectDestinationsAddRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DevinConnectGateway'
          description: Successful Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Conflict
        '410':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Gone
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Unprocessable Content
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Too Many Requests
components:
  schemas:
    DevinConnectDestinationsAddRequest:
      description: Adds destinations to one gateway, keeping the ones it already has.
      properties:
        destinations:
          description: >-
            Destinations to add. Ones the gateway already carries are left as
            they are. The gateway may hold at most 256 in total, and a
            destination may belong to only one gateway.
          items:
            $ref: '#/components/schemas/DevinConnectDestination'
          title: Destinations
          type: array
      required:
        - destinations
      title: DevinConnectDestinationsAddRequest
      type: object
    DevinConnectGateway:
      description: A Devin Connect gateway and the destinations routed through it.
      properties:
        connected:
          anyOf:
            - type: boolean
            - type: 'null'
          description: Whether a tunnel gateway is connected now; null for direct
          title: Connected
        destinations:
          description: Destinations routed through this gateway
          items:
            $ref: '#/components/schemas/DevinConnectDestination'
          title: Destinations
          type: array
        gateway_id:
          description: Gateway id
          title: Gateway Id
          type: string
        kind:
          description: >-
            tunnel: the customer gateway dials in; direct: Devin dials the
            gateway (e.g. over AWS PrivateLink)
          enum:
            - tunnel
            - direct
          title: Kind
          type: string
        last_connected_at:
          anyOf:
            - type: integer
            - type: 'null'
          description: When a tunnel gateway last reported in
          title: Last Connected At
        name:
          description: Gateway name
          title: Name
          type: string
      required:
        - gateway_id
        - name
        - kind
        - destinations
      title: DevinConnectGateway
      type: object
    ProblemDetail:
      description: >-
        RFC 9457 application/problem+json error body for the v3 API.


        detail is retained from the legacy {"detail": ...} body for back-compat;
        the

        other members are additive. errors carries field-level validation
        failures

        (422 only).
      properties:
        detail:
          anyOf:
            - type: string
            - type: 'null'
          description: A human-readable explanation specific to this occurrence.
          title: Detail
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Machine-readable code for blocked-action refusals (e.g.
            "user_frozen", "migrated_session").
          title: Error Code
        errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          description: Field-level validation errors (422 responses only).
          title: Errors
        instance:
          anyOf:
            - type: string
            - type: 'null'
          description: A URI reference (the request path) for this occurrence.
          title: Instance
        status:
          description: The HTTP status code.
          title: Status
          type: integer
        title:
          description: A short, human-readable summary of the problem type.
          title: Title
          type: string
        type:
          default: about:blank
          description: A URI reference identifying the problem type.
          title: Type
          type: string
      required:
        - title
        - status
      title: ProblemDetail
      type: object
    DevinConnectDestination:
      description: 'One destination: exactly one of ``hostname`` or ``ipv4``.'
      properties:
        hostname:
          anyOf:
            - type: string
            - type: 'null'
          description: Exact DNS name (no wildcards), e.g. git.corp.example
          title: Hostname
        ipv4:
          anyOf:
            - type: string
            - type: 'null'
          description: IPv4 address or CIDR, e.g. 10.20.0.0/16; a bare address is a /32
          title: Ipv4
      title: DevinConnectDestination
      type: object
  securitySchemes:
    bearerAuth:
      description: 'Service User credential (prefix: cog_)'
      scheme: bearer
      type: http

````

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