Match Users
curl --request POST \
--url https://api.sublay.io/v8/:projectId/match/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mode": "<string>",
"query": "<string>",
"limit": 123,
"spaceId": "<string>",
"includeChildSpaces": true,
"includeSampleContent": true,
"excludeSelf": true
}
'import requests
url = "https://api.sublay.io/v8/:projectId/match/users"
payload = {
"mode": "<string>",
"query": "<string>",
"limit": 123,
"spaceId": "<string>",
"includeChildSpaces": True,
"includeSampleContent": True,
"excludeSelf": True
}
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({
mode: '<string>',
query: '<string>',
limit: 123,
spaceId: '<string>',
includeChildSpaces: true,
includeSampleContent: true,
excludeSelf: true
})
};
fetch('https://api.sublay.io/v8/:projectId/match/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/match/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([
'mode' => '<string>',
'query' => '<string>',
'limit' => 123,
'spaceId' => '<string>',
'includeChildSpaces' => true,
'includeSampleContent' => true,
'excludeSelf' => true
]),
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/match/users"
payload := strings.NewReader("{\n \"mode\": \"<string>\",\n \"query\": \"<string>\",\n \"limit\": 123,\n \"spaceId\": \"<string>\",\n \"includeChildSpaces\": true,\n \"includeSampleContent\": true,\n \"excludeSelf\": true\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/match/users")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"<string>\",\n \"query\": \"<string>\",\n \"limit\": 123,\n \"spaceId\": \"<string>\",\n \"includeChildSpaces\": true,\n \"includeSampleContent\": true,\n \"excludeSelf\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/match/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 \"mode\": \"<string>\",\n \"query\": \"<string>\",\n \"limit\": 123,\n \"spaceId\": \"<string>\",\n \"includeChildSpaces\": true,\n \"includeSampleContent\": true,\n \"excludeSelf\": true\n}"
response = http.request(request)
puts response.read_bodySearch Endpoints
Match Users
Match people by activity-derived interest facets
Match Users
curl --request POST \
--url https://api.sublay.io/v8/:projectId/match/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mode": "<string>",
"query": "<string>",
"limit": 123,
"spaceId": "<string>",
"includeChildSpaces": true,
"includeSampleContent": true,
"excludeSelf": true
}
'import requests
url = "https://api.sublay.io/v8/:projectId/match/users"
payload = {
"mode": "<string>",
"query": "<string>",
"limit": 123,
"spaceId": "<string>",
"includeChildSpaces": True,
"includeSampleContent": True,
"excludeSelf": True
}
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({
mode: '<string>',
query: '<string>',
limit: 123,
spaceId: '<string>',
includeChildSpaces: true,
includeSampleContent: true,
excludeSelf: true
})
};
fetch('https://api.sublay.io/v8/:projectId/match/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/match/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([
'mode' => '<string>',
'query' => '<string>',
'limit' => 123,
'spaceId' => '<string>',
'includeChildSpaces' => true,
'includeSampleContent' => true,
'excludeSelf' => true
]),
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/match/users"
payload := strings.NewReader("{\n \"mode\": \"<string>\",\n \"query\": \"<string>\",\n \"limit\": 123,\n \"spaceId\": \"<string>\",\n \"includeChildSpaces\": true,\n \"includeSampleContent\": true,\n \"excludeSelf\": true\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/match/users")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"<string>\",\n \"query\": \"<string>\",\n \"limit\": 123,\n \"spaceId\": \"<string>\",\n \"includeChildSpaces\": true,\n \"includeSampleContent\": true,\n \"excludeSelf\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/match/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 \"mode\": \"<string>\",\n \"query\": \"<string>\",\n \"limit\": 123,\n \"spaceId\": \"<string>\",\n \"includeChildSpaces\": true,\n \"includeSampleContent\": true,\n \"excludeSelf\": true\n}"
response = http.request(request)
puts response.read_bodyRanks other users against an asker’s interests, using activity-derived interest facets — clusters of what each user has actually engaged with over time, not a static profile. The endpoint returns a structured match breakdown (who, how strongly, and on which facets), optionally with sample content that illustrates each overlap.
Matching runs in two modes:
Breakdown fields
passive— match against the asker’s own interest facets. Answers “who is like me?” No free-text; the asker’s top facets are the query.directed— match against a free-textquerytopic. Answers “who is into biotech?” The query is embedded and ranked against candidate facets.
Requires a paid plan, the
ai-search bundle, the interest-matching bundle, and interestMatching.enabled set on the project. See the Interest Matching guide for setup.Authentication
The endpoint requires an authenticated user. A missing token is rejected with a bare401 before the controller runs; an invalid or expired token is rejected with 403 (refresh and retry). Both modes act on behalf of that user:
passiveranks candidates against the asker’s own facets — the authenticated user is the query.directedranks candidates against a free-textquery, still on behalf of the authenticated user.
401 auth/user-required if none is resolved.
Body Parameters
string
required
"passive" or "directed".string
The free-text topic to match against. Required in
directed mode; rejected in passive mode.number
default:"20"
Maximum number of matched users to return. Maximum
50.string
Restrict candidates to users active in this space.
boolean
default:"false"
Only applies with
spaceId. When true, candidates active anywhere in the space’s subtree are eligible. Ignored without spaceId.boolean
default:"false"
Gate 2 of the two-gate sample exposure. When
true and the project setting interestMatching.exposeSampleContent is on, each matched facet includes a few illustrative content snippets from the candidate. Requesting samples while the project setting is off returns 403 match/sample-content-disabled.boolean
default:"true"
Exclude the asker from the results.
Response
Returns the{ results: [...] } envelope (a deliberate divergence from search/*, which return bare arrays). Results are ordered by descending score.
{
"results": [
{
"user": { "id": "usr_...", "name": "..." },
"score": 3.14,
"matchedFacets": [
{
"similarity": 0.62,
"askerFacet": { "id": "fac_...", "hotness": 4.2 },
"candidateFacet": { "id": "fac_...", "hotness": 3.8 },
"sampleContent": [
{
"sourceType": "entity",
"recordId": "ent_...",
"content": "…",
"similarity": 0.71
}
]
}
]
}
]
}
score— the aggregate match score. Inpassivemode this is additive over the top matched facet-pairs (two moderate overlaps can outrank one very strong overlap); indirectedmode it is the single best facet’ssimilarity · weight(hotness).matchedFacets[].similarity— cosine similarity of the facet pair.matchedFacets[].askerFacet— the asker’s side of the pair. Present inpassivemode; omitted indirectedmode (there is no asker facet — the query is the anchor) and for the cold-start bio fallback.matchedFacets[].candidateFacet— the candidate’s facet: itsidand lazily-decayedhotness.matchedFacets[].sampleContent— present only when both sample gates are satisfied. Never contains moderation-removed, soft-deleted, or private-DM content.
Cold-start fallback
Inpassive mode, if the asker has no facet above the significance threshold, the endpoint falls back to the asker’s bio embedding (from UserEmbeddings) as a single pseudo-facet, so a brand-new user can still get matches. Cold-start matches omit askerFacet on the breakdown.
Candidate exclusions
Candidates are excluded when they are: the asker (unlessexcludeSelf: false), users with an active suspension (a future-dated suspension does not count as active), and — for a space-scoped match — users banned in that space.
Error Responses
User Required — 401
User Required — 401
{ "error": "Passive match requires an identified user", "code": "auth/user-required" }
Plan Required — 403
Plan Required — 403
{ "error": "Interest matching requires a paid plan", "code": "project/plan-required" }
Interest Matching Disabled — 403
Interest Matching Disabled — 403
{ "error": "Interest matching is not enabled for this project", "code": "project/interest-matching-disabled" }
Sample Content Disabled — 403
Sample Content Disabled — 403
{ "error": "Sample content is not enabled for this project", "code": "match/sample-content-disabled" }
Tables Not Available — 403
Tables Not Available — 403
The
interest-matching bundle is not installed.{ "code": "database/tables-not-available", "missingTables": ["UserInterestFacets"] }

