GET
/
api
/
v1
/
chat
/
blocks
List blocked users
curl --request GET \
  --url https://api.example.com/api/v1/chat/blocks
import requests

url = "https://api.example.com/api/v1/chat/blocks"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://api.example.com/api/v1/chat/blocks', 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.example.com/api/v1/chat/blocks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);

$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.example.com/api/v1/chat/blocks"

req, _ := http.NewRequest("GET", url, nil)

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.example.com/api/v1/chat/blocks")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/api/v1/chat/blocks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body

Overview

Returns the users the authenticated caller has directed-blocked (callerUserId → blockedUserId), newest block first. Each entry is enriched with the blocked user’s display info (firstName, lastName, avatarUrl) using the same user-profile lookup the conversation inbox uses, so the block list renders without a per-row follow-up call. Use each entry’s userId to unblock via DELETE /api/v1/chat/blocks/:userId. The list is directed: it only contains blocks the caller created. Blocks that other users created against the caller are not returned.

Authentication

Bearer <accessToken> required. requireOnboarded middleware applied.

Path parameters

None.

Query parameters

None. The endpoint returns the caller’s full block list (no pagination).

Request body

None.

Response — 200 OK

FieldTypeNotes
blockedUsersarrayThe blocked users, newest block first. Empty array [] when the caller has blocked no one.
blockedUsers[].userIdstring24-char hex ObjectId of the blocked user. Pass this to DELETE /api/v1/chat/blocks/:userId to unblock.
blockedUsers[].firstNamestring | nullBlocked user’s first name. null if unset or the user record is gone.
blockedUsers[].lastNamestring | nullBlocked user’s last name. null if unset or the user record is gone.
blockedUsers[].avatarUrlstring | nullBlocked user’s avatar URL. null if unset or the user record is gone.
blockedUsers[].blockedAtstringISO-8601 timestamp the block was created.

Example response (two blocks)

{
  "blockedUsers": [
    {
      "userId": "66400a8f1c2b4d5e6f7a8b01",
      "firstName": "Carol",
      "lastName": "Clark",
      "avatarUrl": "https://cdn.swappr.co.uk/avatars/carol.jpg",
      "blockedAt": "2026-06-14T10:32:11.482Z"
    },
    {
      "userId": "66400a8f1c2b4d5e6f7a8b02",
      "firstName": "Bob",
      "lastName": "Brown",
      "avatarUrl": null,
      "blockedAt": "2026-06-13T18:04:57.219Z"
    }
  ]
}

Example response (no blocks)

{
  "blockedUsers": []
}

Example response (blocked user record removed)

If a blocked user’s account is gone, the row is still returned (so the caller can still unblock) with null profile fields:
{
  "blockedUsers": [
    {
      "userId": "66400a8f1c2b4d5e6f7a8b03",
      "firstName": null,
      "lastName": null,
      "avatarUrl": null,
      "blockedAt": "2026-06-12T09:15:00.000Z"
    }
  ]
}

Error responses

StatusCodeMeaning
401UNAUTHENTICATEDMissing, malformed, or expired access token.
403ONBOARDING_INCOMPLETECaller has not finished onboarding.

See also

curl

curl https://api.swappr.co.uk/api/v1/chat/blocks \
  -H "Authorization: Bearer $ACCESS_TOKEN"