Decline Connection
curl --request PATCH \
--url https://api.sublay.io/v8/:projectId/connections/:connectionId/decline \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"actingUserId": "<string>"
}
'import requests
url = "https://api.sublay.io/v8/:projectId/connections/:connectionId/decline"
payload = { "actingUserId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({actingUserId: '<string>'})
};
fetch('https://api.sublay.io/v8/:projectId/connections/:connectionId/decline', 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/v8/:projectId/connections/:connectionId/decline",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'actingUserId' => '<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.sublay.io/v8/:projectId/connections/:connectionId/decline"
payload := strings.NewReader("{\n \"actingUserId\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sublay.io/v8/:projectId/connections/:connectionId/decline")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"actingUserId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/connections/:connectionId/decline")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"actingUserId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>",
"respondedAt": "<string>"
}Connection Endpoints
Decline Connection
Decline a pending connection request
Decline Connection
curl --request PATCH \
--url https://api.sublay.io/v8/:projectId/connections/:connectionId/decline \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"actingUserId": "<string>"
}
'import requests
url = "https://api.sublay.io/v8/:projectId/connections/:connectionId/decline"
payload = { "actingUserId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({actingUserId: '<string>'})
};
fetch('https://api.sublay.io/v8/:projectId/connections/:connectionId/decline', 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/v8/:projectId/connections/:connectionId/decline",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'actingUserId' => '<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.sublay.io/v8/:projectId/connections/:connectionId/decline"
payload := strings.NewReader("{\n \"actingUserId\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sublay.io/v8/:projectId/connections/:connectionId/decline")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"actingUserId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/connections/:connectionId/decline")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"actingUserId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>",
"respondedAt": "<string>"
}Declines a pending connection request. Only the receiver of the original request can decline it. The connection record status is updated to
"declined" rather than being deleted.
Path Parameters
string
required
The ID (UUID) of the pending connection record to decline.
Body Parameters
string
Service key only, and required with one: the user this request acts as. Must be the receiver of the request. A user token always acts as its own user and must not send it (
400 connection/acting-user-not-allowed).Response
On success, returns HTTP200:
string
Connection record ID.
string
"declined".string
ISO timestamp of when the request was declined.
Error Responses
Not Found — 404
Not Found — 404
{
"error": "Pending connection request not found.",
"code": "connection/not-found"
}
Unauthorized — 403
Unauthorized — 403
{
"error": "Only the receiver can decline a connection request.",
"code": "connection/unauthorized"
}
Missing User — 400
Missing User — 400
A service key sent no
actingUserId.{
"error": "A service key must send actingUserId: the user this request acts as.",
"code": "connection/missing-user-id"
}
Acting User Not Allowed — 400
Acting User Not Allowed — 400
A user token sent
actingUserId, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.{
"error": "actingUserId is only accepted with a service key. A user's own token always acts as that user.",
"code": "connection/acting-user-not-allowed"
}
User Not Found — 404
User Not Found — 404
Returned when a service key names an
actingUserId that isn’t a user in this project.{ "error": "No user with this actingUserId exists in this project.", "code": "connection/user-not-found" }
Unsupported Parameter — 400
Unsupported Parameter — 400
The request sent With a user token, or with no credentials:
userId. On this route the user a service key acts as is actingUserId.With a service key:{
"error": "`userId` was renamed to `actingUserId`: send the user this service key acts as in `actingUserId`.",
"code": "connection/unsupported-param",
"param": "userId"
}
{
"error": "`userId` isn't accepted here: a user's own token always acts as that user.",
"code": "connection/unsupported-param",
"param": "userId"
}

