Ajouter des destinations à une passerelle Devin Connect
curl --request POST \
--url https://api.devin.ai/v3beta1/enterprise/devin-connect/gateways/{gateway_id}/destinations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destinations": [
{
"hostname": "<string>",
"ipv4": "<string>"
}
]
}
'import requests
url = "https://api.devin.ai/v3beta1/enterprise/devin-connect/gateways/{gateway_id}/destinations"
payload = { "destinations": [
{
"hostname": "<string>",
"ipv4": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({destinations: [{hostname: '<string>', ipv4: '<string>'}]})
};
fetch('https://api.devin.ai/v3beta1/enterprise/devin-connect/gateways/{gateway_id}/destinations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.devin.ai/v3beta1/enterprise/devin-connect/gateways/{gateway_id}/destinations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'destinations' => [
[
'hostname' => '<string>',
'ipv4' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.devin.ai/v3beta1/enterprise/devin-connect/gateways/{gateway_id}/destinations"
payload := strings.NewReader("{\n \"destinations\": [\n {\n \"hostname\": \"<string>\",\n \"ipv4\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.devin.ai/v3beta1/enterprise/devin-connect/gateways/{gateway_id}/destinations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"destinations\": [\n {\n \"hostname\": \"<string>\",\n \"ipv4\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3beta1/enterprise/devin-connect/gateways/{gateway_id}/destinations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"destinations\": [\n {\n \"hostname\": \"<string>\",\n \"ipv4\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"destinations": [
{
"hostname": "<string>",
"ipv4": "<string>"
}
],
"gateway_id": "<string>",
"kind": "tunnel",
"name": "<string>",
"connected": true,
"last_connected_at": 123
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}Devin Connect (Entreprise) [Bêta]
Ajouter des destinations à une passerelle Devin Connect
Ajouter des destinations à la liste de la passerelle en conservant les destinations existantes.
Renvoie 409 lorsqu’une destination est déjà desservie par une autre passerelle et 422 si l’ajout ferait dépasser à la passerelle la limite de 256 destinations.
POST
/
v3beta1
/
enterprise
/
devin-connect
/
gateways
/
{gateway_id}
/
destinations
Ajouter des destinations à une passerelle Devin Connect
curl --request POST \
--url https://api.devin.ai/v3beta1/enterprise/devin-connect/gateways/{gateway_id}/destinations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destinations": [
{
"hostname": "<string>",
"ipv4": "<string>"
}
]
}
'import requests
url = "https://api.devin.ai/v3beta1/enterprise/devin-connect/gateways/{gateway_id}/destinations"
payload = { "destinations": [
{
"hostname": "<string>",
"ipv4": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({destinations: [{hostname: '<string>', ipv4: '<string>'}]})
};
fetch('https://api.devin.ai/v3beta1/enterprise/devin-connect/gateways/{gateway_id}/destinations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.devin.ai/v3beta1/enterprise/devin-connect/gateways/{gateway_id}/destinations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'destinations' => [
[
'hostname' => '<string>',
'ipv4' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.devin.ai/v3beta1/enterprise/devin-connect/gateways/{gateway_id}/destinations"
payload := strings.NewReader("{\n \"destinations\": [\n {\n \"hostname\": \"<string>\",\n \"ipv4\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.devin.ai/v3beta1/enterprise/devin-connect/gateways/{gateway_id}/destinations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"destinations\": [\n {\n \"hostname\": \"<string>\",\n \"ipv4\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3beta1/enterprise/devin-connect/gateways/{gateway_id}/destinations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"destinations\": [\n {\n \"hostname\": \"<string>\",\n \"ipv4\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"destinations": [
{
"hostname": "<string>",
"ipv4": "<string>"
}
],
"gateway_id": "<string>",
"kind": "tunnel",
"name": "<string>",
"connected": true,
"last_connected_at": 123
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}Ajoute des destinations à une passerelle Devin Connect, sans supprimer celles vers lesquelles elle route déjà le trafic. Il s’agit de la liste que le bouton « Ajouter une destination » modifie dans la webapp. Pour définir toute la liste en une seule fois, utilisez Remplacer les destinations d’une passerelle.
Autorisations
Nécessite un utilisateur de service ou un jeton d’accès personnel disposant de l’autorisationManageEnterpriseSettings au niveau Enterprise. Devin Connect doit être activé pour l’Enterprise ; à défaut, l’endpoint renvoie 403.
Comportement
- Chaque destination est soit
{"hostname": "scm.corp.example"}(un nom d’hôte exact, sans caractères génériques), soit{"ipv4": "10.20.0.0/16"}(une adresse IPv4 ou un bloc CIDR). Les noms d’hôte sont convertis en minuscules et perdent leur point final éventuel ; une adresse unique devient un CIDR/32. - Les destinations déjà routées par la passerelle restent inchangées : une requête peut donc être répétée sans risque.
- Une destination ne peut appartenir qu’à une seule passerelle. L’ajout d’une destination déjà routée par une autre passerelle renvoie
409. - Une passerelle contient au maximum 256 destinations. Tout ajout qui dépasserait cette limite renvoie
422. - Le routage d’une destination ne suffit pas pour que les sessions puissent l’atteindre : le profil de sécurité de la session doit également l’autoriser. Consultez Gérer les destinations avec l’API pour réaliser les deux étapes ensemble.
- Votre passerelle impose également son propre
config.yaml: une nouvelle destination ne fonctionne donc qu’une fois autorisée dans ce fichier. - Les modifications sont enregistrées dans le journal d’audit sous
update_gateway_hostnames.
Corps
application/json
Ajoute des destinations à une passerelle en conservant celles déjà configurées.
Réponse
Réponse réussie
Une passerelle Devin Connect et les destinations dont le trafic est acheminé via celle-ci.

