Remove Connection
curl --request DELETE \
--url https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/connectionimport requests
url = "https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection', 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.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$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.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection"
req, _ := http.NewRequest("DELETE", url, nil)
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.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"message": "<string>",
"action": "<string>",
"id": "<string>",
"status": "<string>",
"respondedAt": "<string>"
}User Connection Operations
Remove Connection
Remove, withdraw, or decline a connection by user ID
DELETE
/
:projectId
/
api
/
v7
/
users
/
:userId
/
connection
Remove Connection
curl --request DELETE \
--url https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/connectionimport requests
url = "https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection', 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.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$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.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection"
req, _ := http.NewRequest("DELETE", url, nil)
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.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/connection")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"message": "<string>",
"action": "<string>",
"id": "<string>",
"status": "<string>",
"respondedAt": "<string>"
}Removes the connection relationship between the authenticated user and the specified user. The behavior depends on the current connection state:
When declined:
- Pending (sent by current user) — withdraws the request (record is deleted).
- Pending (sent by other user) — declines the request (status updated to
"declined"). - Accepted — disconnects both users (record is deleted).
Path Parameters
string
required
The Sublay user ID (UUID) of the other user.
Response
On success, returns HTTP200.
When withdrawn or disconnected:
string
Human-readable description of the action taken.
string
"withdraw" or "disconnect".string
Connection record ID.
string
"declined".string
ISO timestamp of when the request was declined.
Error Responses
Self-Disconnect — 400
Self-Disconnect — 400
{
"error": "Cannot disconnect from yourself",
"code": "connection/self-disconnect"
}
No Connection Found — 404
No Connection Found — 404
{
"error": "No connection found between these users that can be removed.",
"code": "connection/not-found"
}
See Also
useRemoveConnectionByUserIdhook- Remove Connection by ID — remove by connection ID instead

