Search Users
curl --request POST \
--url https://api.sublay.io/v8/:projectId/search/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"limit": 123,
"actingUserId": "<string>"
}
'import requests
url = "https://api.sublay.io/v8/:projectId/search/users"
payload = {
"query": "<string>",
"limit": 123,
"actingUserId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: '<string>', limit: 123, actingUserId: '<string>'})
};
fetch('https://api.sublay.io/v8/:projectId/search/users', 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/search/users",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => '<string>',
'limit' => 123,
'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/search/users"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"limit\": 123,\n \"actingUserId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.sublay.io/v8/:projectId/search/users")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"limit\": 123,\n \"actingUserId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/search/users")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"limit\": 123,\n \"actingUserId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodySearch Endpoints
Search Users
Semantic search over project users
Search Users
curl --request POST \
--url https://api.sublay.io/v8/:projectId/search/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"limit": 123,
"actingUserId": "<string>"
}
'import requests
url = "https://api.sublay.io/v8/:projectId/search/users"
payload = {
"query": "<string>",
"limit": 123,
"actingUserId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: '<string>', limit: 123, actingUserId: '<string>'})
};
fetch('https://api.sublay.io/v8/:projectId/search/users', 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/search/users",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => '<string>',
'limit' => 123,
'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/search/users"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"limit\": 123,\n \"actingUserId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.sublay.io/v8/:projectId/search/users")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"limit\": 123,\n \"actingUserId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/search/users")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"limit\": 123,\n \"actingUserId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyPerforms vector-similarity search over user profiles in the project using AI embeddings. Returns the most semantically relevant user profiles for the given query.
Requires a paid plan with semantic search enabled.
Authentication required. Send a user’s access token as
Returned when a user token, or a request with no credentials, sends
Returned when a service key names an
Authorization: Bearer <token> — missing token → 401, invalid/expired token → 403 (refresh and retry). A service key is accepted too, and searches as the user named in actingUserId, or with no viewer when it names nobody.
When the search has a viewer — the signed-in user, or the user a service key names in actingUserId — users with a block between them and the viewer, in either direction, are left out. Block filtering requires the moderation bundle.
Body Parameters
Service key only: the user to search as. The results are exactly what that user’s own access token would get. Leave it out to search with no viewer. A user token always acts as its own user and must not send it (
400 search/acting-user-not-allowed).Response
Returns an array of result objects ordered by similarity:[
{
"similarity": 0.91,
"record": { ...User object... }
}
]
Error Responses
Authentication Required — 401 / 403
Authentication Required — 401 / 403
The endpoint requires an authenticated user. A missing token returns a bare
401; an invalid or expired token returns a bare 403 — refresh the access token and retry.Acting User Not Allowed — 400
Acting User Not Allowed — 400
{ "error": "actingUserId is only accepted with a service key. A user's own token always acts as that user.", "code": "search/acting-user-not-allowed" }
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.User Not Found — 404
User Not Found — 404
{ "error": "No user with this actingUserId exists in this project.", "code": "search/user-not-found" }
actingUserId that isn’t a user in this project.Plan Required — 403
Plan Required — 403
{ "error": "Semantic search requires a paid plan", "code": "project/plan-required" }

