Add destinations to a Devin Connect gateway
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 (Enterprise) [Beta]
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.
POST
/
v3beta1
/
enterprise
/
devin-connect
/
gateways
/
{gateway_id}
/
destinations
Add destinations to a Devin Connect gateway
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"
}Adds destinations to a Devin Connect 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.
Permissions
Requires a service user or personal access token with theManageEnterpriseSettings 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/32CIDR. - 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 must also allow it. See 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 as
update_gateway_hostnames.
Body
application/json
Adds destinations to one gateway, keeping the ones it already has.
Response
Successful Response
A Devin Connect gateway and the destinations routed through it.

