Get Block Status
curl --request GET \
--url https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/block \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/block"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/block', 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/block",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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/block"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/block")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/block")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"blocked": true,
"blockId": "<string>",
"createdAt": "<string>"
}User Block Operations
Get Block Status
Check whether the acting user blocks a specific user
Get Block Status
curl --request GET \
--url https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/block \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/block"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/block', 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/block",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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/block"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/block")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/api/v6/:projectId/api/v7/users/:userId/block")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"blocked": true,
"blockId": "<string>",
"createdAt": "<string>"
}Returns only the acting user’s outbound block state — whether I block
:userId. This powers a block/unblock toggle in your app’s UI.
This endpoint is outbound-only by design. It never reveals the inbound direction (whether
:userId has blocked the caller). Exposing the inbound state would let a blocked user poll this endpoint to discover a block — the exact disclosure the feature exists to prevent.Requires the
moderation bundle. A project without the moderation bundle returns 403 database/tables-not-available. See Bundles.Path Parameters
string
required
The Sublay user ID (UUID) of the user to check block status against (the target).
Query Parameters
string
The user whose outbound state is being checked (the blocker). Only service/master keys may supply an
actingUserId other than the caller’s own; with a user token the blocker is derived from the token.Response
On success, returns HTTP200.
boolean
true if the acting user blocks the target user; otherwise false.string
ID of the block record. Present only when
blocked is true.string
ISO timestamp of when the block was created. Present only when
blocked is true.Error Responses
Self-Check — 400
Self-Check — 400
{
"error": "Cannot check block status with yourself.",
"code": "block/self-check"
}

