> ## 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.

# Agregar destinos a un gateway de Devin Connect

> Agrega destinos a la lista del gateway y conserva los existentes.

Devuelve 409 cuando un destino ya está enrutado a través de otro gateway
y 422 si se supera el límite de 256 destinos del gateway.

**Agrega** destinos a un gateway de [Devin Connect](https://docs.devin.ai/es/enterprise/deployment/devin-connect.md) y conserva los que ya enruta. Es la misma lista que se edita con "Add destination" en la web app. Para definir la lista completa de una sola vez, usa [Reemplazar los destinos del gateway](https://docs.devin.ai/es/api-reference/v3/devin-connect/put-enterprise-devin-connect-gateway-destinations.md).

## Permisos

Requiere un [usuario de servicio](https://docs.devin.ai/es/api-reference/v3/service-users/members-service-users.md) o un [token de acceso personal](https://docs.devin.ai/es/api-reference/personal-access-tokens.md) con el permiso `ManageEnterpriseSettings` a nivel empresarial. Devin Connect debe estar habilitado para la empresa; de lo contrario, el endpoint devuelve un error `403`.

## Comportamiento

* Cada destino es `{"hostname": "scm.corp.example"}` (un nombre de host exacto, sin comodines) o `{"ipv4": "10.20.0.0/16"}` (una dirección IPv4 o un CIDR). Los nombres de host se convierten a minúsculas y se les elimina el punto final, y una dirección individual se convierte en un CIDR `/32`.
* Los destinos que el gateway ya enruta no se modifican, por lo que es seguro repetir una solicitud.
* Un destino solo puede pertenecer a un gateway. Si se agrega uno que otro gateway ya enruta, se devuelve `409`.
* Un gateway admite como máximo 256 destinos. Si al agregar destinos se supera ese límite, se devuelve `422`.
* Enrutar un destino no basta para que las sesiones puedan acceder a él: el [perfil de seguridad](https://docs.devin.ai/es/product-guides/security-profiles.md) de la sesión también debe permitirlo. Consulta [Gestionar destinos con la API](https://docs.devin.ai/es/enterprise/deployment/devin-connect.md#manage-destinations-with-the-api) para ver ambos pasos en conjunto.
* Tu gateway también hace cumplir su propio `config.yaml`, por lo que un nuevo destino solo funciona cuando ese archivo también lo permite.
* Los cambios se registran en el [registro de auditoría](https://docs.devin.ai/es/api-reference/v3/audit-logs/enterprise-audit-logs.md) como `update_gateway_hostnames`.


## OpenAPI

````yaml es/v3-openapi.yaml POST /v3beta1/enterprise/devin-connect/gateways/{gateway_id}/destinations
openapi: 3.1.0
info:
  description: API de Devin v3 con autenticación mediante usuario de servicio y 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: Agregar destinos a un gateway de Devin Connect
      description: |-
        Agrega destinos a la lista del gateway y conserva los existentes.

        Devuelve 409 cuando un destino ya está enrutado a través de otro gateway
        y 422 si se supera el límite de 256 destinos del gateway.
      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: Respuesta satisfactoria
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: No autorizado
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Prohibido
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: No Encontrado
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Conflicto
        '410':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Ya no disponible
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Contenido no procesable
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Demasiadas solicitudes
components:
  schemas:
    DevinConnectDestinationsAddRequest:
      description: Agrega destinos a un gateway y conserva los que ya tiene.
      properties:
        destinations:
          description: >-
            Destinos que se agregarán. Los que el gateway ya tiene se mantienen
            sin cambios. El gateway puede tener como máximo 256 en total, y cada
            destino solo puede pertenecer a un gateway.
          items:
            $ref: '#/components/schemas/DevinConnectDestination'
          title: Destinations
          type: array
      required:
        - destinations
      title: DevinConnectDestinationsAddRequest
      type: object
    DevinConnectGateway:
      description: Un gateway de Devin Connect y los destinos enrutados a través de él.
      properties:
        connected:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            Indica si un gateway de túnel está conectado actualmente; null para
            direct
          title: Connected
        destinations:
          description: Destinos enrutados a través de este gateway
          items:
            $ref: '#/components/schemas/DevinConnectDestination'
          title: Destinations
          type: array
        gateway_id:
          description: ID del gateway
          title: Gateway Id
          type: string
        kind:
          description: >-
            tunnel: el gateway del cliente inicia la conexión; direct: Devin
            inicia la conexión con el gateway (p. ej., a través de AWS
            PrivateLink)
          enum:
            - tunnel
            - direct
          title: Kind
          type: string
        last_connected_at:
          anyOf:
            - type: integer
            - type: 'null'
          description: Última vez que se comunicó un gateway de túnel
          title: Last Connected At
        name:
          description: Nombre del gateway
          title: Name
          type: string
      required:
        - gateway_id
        - name
        - kind
        - destinations
      title: DevinConnectGateway
      type: object
    ProblemDetail:
      description: >-
        Cuerpo de error RFC 9457 application/problem+json para la API v3.


        detail se conserva del cuerpo heredado {"detail": ...} por
        compatibilidad con versiones anteriores; los

        otros miembros son adicionales. errors contiene errores de validación

        a nivel de campo (solo 422).
      properties:
        detail:
          anyOf:
            - type: string
            - type: 'null'
          description: Explicación legible para humanos específica de esta ocurrencia.
          title: Detail
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Código legible por máquina que indica el rechazo de una acción
            bloqueada (p. ej., "user_frozen", "migrated_session").
          title: Error Code
        errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          description: Errores de validación por campo (solo en respuestas 422).
          title: Errors
        instance:
          anyOf:
            - type: string
            - type: 'null'
          description: Una referencia URI (la ruta de la solicitud) para esta ocurrencia.
          title: Instance
        status:
          description: El código de estado HTTP.
          title: Status
          type: integer
        title:
          description: Un breve resumen del tipo de problema, legible para humanos.
          title: Title
          type: string
        type:
          default: about:blank
          description: Una referencia URI que identifica el tipo de problema.
          title: Type
          type: string
      required:
        - title
        - status
      title: ProblemDetail
      type: object
    DevinConnectDestination:
      description: >-
        Un destino: se debe especificar exactamente uno de los campos
        ``hostname`` o ``ipv4``.
      properties:
        hostname:
          anyOf:
            - type: string
            - type: 'null'
          description: Nombre DNS exacto (sin comodines), p. ej., git.corp.example
          title: Hostname
        ipv4:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Dirección IPv4 o bloque CIDR, p. ej., 10.20.0.0/16; una dirección
            sin prefijo equivale a /32
          title: Ipv4
      title: DevinConnectDestination
      type: object
  securitySchemes:
    bearerAuth:
      description: 'Credencial de usuario de servicio (prefijo: cog_)'
      scheme: bearer
      type: http

````

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