Connections
Delete a Connection
Deletes a connection. It must not be referenced by an active routing rule.
DELETE
/
connections
/
{connection_id}
Delete a Connection
curl --request DELETE \
--url https://api-sandbox.y.uno/v1/connections/{connection_id} \
--header 'PRIVATE-SECRET-KEY: <api-key>' \
--header 'PUBLIC-API-KEY: <api-key>' \
--header 'X-Account-Code: <x-account-code>'import requests
url = "https://api-sandbox.y.uno/v1/connections/{connection_id}"
headers = {
"X-Account-Code": "<x-account-code>",
"PUBLIC-API-KEY": "<api-key>",
"PRIVATE-SECRET-KEY": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {
'X-Account-Code': '<x-account-code>',
'PUBLIC-API-KEY': '<api-key>',
'PRIVATE-SECRET-KEY': '<api-key>'
}
};
fetch('https://api-sandbox.y.uno/v1/connections/{connection_id}', 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-sandbox.y.uno/v1/connections/{connection_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"PRIVATE-SECRET-KEY: <api-key>",
"PUBLIC-API-KEY: <api-key>",
"X-Account-Code: <x-account-code>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.y.uno/v1/connections/{connection_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-Account-Code", "<x-account-code>")
req.Header.Add("PUBLIC-API-KEY", "<api-key>")
req.Header.Add("PRIVATE-SECRET-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api-sandbox.y.uno/v1/connections/{connection_id}")
.header("X-Account-Code", "<x-account-code>")
.header("PUBLIC-API-KEY", "<api-key>")
.header("PRIVATE-SECRET-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/connections/{connection_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-Account-Code"] = '<x-account-code>'
request["PUBLIC-API-KEY"] = '<api-key>'
request["PRIVATE-SECRET-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"type": "auth_error",
"code": "NOT_AUTHENTICATED",
"message": "Not authenticated"
}{
"type": "not_found",
"code": "CONNECTION_NOT_FOUND",
"message": "Connection '...' was not found"
}{
"type": "conflict",
"code": "CONNECTION_IN_USE",
"message": "Connection '...' is still referenced by an active routing rule"
}Deletes a connection you previously created. The connection moves to
DELETED status and stops being available to routing. Returns 204 No Content on success.
A connection that is still referenced by an active routing rule cannot be deleted — the request fails with
409 CONNECTION_IN_USE. Detach it from your routes first, then retry.Path Parameters
string
required
The id returned by Create a Connection. Must belong to the account your API key is scoped to.
Headers
string
required
UUID of the account the connection belongs to.
Response
Returns204 No Content with an empty body.
curl -X DELETE 'https://api.y.uno/v1/connections/f1a3c4d5-7b8e-4a2c-9d1e-3f4a5b6c7d8e' \
-H 'public-api-key: <YOUR_PUBLIC_KEY>' \
-H 'private-secret-key: <YOUR_SECRET_KEY>' \
-H 'X-Account-Code: a1b2c3d4-e5f6-7890-abcd-ef1234567890'
{
"type": "conflict",
"code": "CONNECTION_IN_USE",
"message": "Connection 'f1a3c4d5-7b8e-4a2c-9d1e-3f4a5b6c7d8e' is still referenced by an active routing rule",
"details": { "connection_id": "f1a3c4d5-7b8e-4a2c-9d1e-3f4a5b6c7d8e" }
}
{
"type": "not_found",
"code": "CONNECTION_NOT_FOUND",
"message": "Connection '...' was not found",
"details": { "connection_id": "..." }
}
Errors
| HTTP | code |
|---|---|
401 | NOT_AUTHENTICATEDMissing or invalid API key. |
404 | CONNECTION_NOT_FOUNDUnknown connection_id, or the id belongs to a different account. |
409 | CONNECTION_IN_USEThe connection is still referenced by an active routing rule. |
Was this page helpful?
⌘I
Delete a Connection
curl --request DELETE \
--url https://api-sandbox.y.uno/v1/connections/{connection_id} \
--header 'PRIVATE-SECRET-KEY: <api-key>' \
--header 'PUBLIC-API-KEY: <api-key>' \
--header 'X-Account-Code: <x-account-code>'import requests
url = "https://api-sandbox.y.uno/v1/connections/{connection_id}"
headers = {
"X-Account-Code": "<x-account-code>",
"PUBLIC-API-KEY": "<api-key>",
"PRIVATE-SECRET-KEY": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {
'X-Account-Code': '<x-account-code>',
'PUBLIC-API-KEY': '<api-key>',
'PRIVATE-SECRET-KEY': '<api-key>'
}
};
fetch('https://api-sandbox.y.uno/v1/connections/{connection_id}', 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-sandbox.y.uno/v1/connections/{connection_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"PRIVATE-SECRET-KEY: <api-key>",
"PUBLIC-API-KEY: <api-key>",
"X-Account-Code: <x-account-code>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.y.uno/v1/connections/{connection_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-Account-Code", "<x-account-code>")
req.Header.Add("PUBLIC-API-KEY", "<api-key>")
req.Header.Add("PRIVATE-SECRET-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api-sandbox.y.uno/v1/connections/{connection_id}")
.header("X-Account-Code", "<x-account-code>")
.header("PUBLIC-API-KEY", "<api-key>")
.header("PRIVATE-SECRET-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/connections/{connection_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-Account-Code"] = '<x-account-code>'
request["PUBLIC-API-KEY"] = '<api-key>'
request["PRIVATE-SECRET-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"type": "auth_error",
"code": "NOT_AUTHENTICATED",
"message": "Not authenticated"
}{
"type": "not_found",
"code": "CONNECTION_NOT_FOUND",
"message": "Connection '...' was not found"
}{
"type": "conflict",
"code": "CONNECTION_IN_USE",
"message": "Connection '...' is still referenced by an active routing rule"
}