Add Entity Reaction
curl --request POST \
--url https://api.sublay.io/v8/:projectId/entities/:entityId/reactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reactionType": "<string>",
"userId": "<string>"
}
'import requests
url = "https://api.sublay.io/v8/:projectId/entities/:entityId/reactions"
payload = {
"reactionType": "<string>",
"userId": "<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({reactionType: '<string>', userId: '<string>'})
};
fetch('https://api.sublay.io/v8/:projectId/entities/:entityId/reactions', 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/entities/:entityId/reactions",
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([
'reactionType' => '<string>',
'userId' => '<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/entities/:entityId/reactions"
payload := strings.NewReader("{\n \"reactionType\": \"<string>\",\n \"userId\": \"<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/entities/:entityId/reactions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reactionType\": \"<string>\",\n \"userId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/entities/:entityId/reactions")
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 \"reactionType\": \"<string>\",\n \"userId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyEntity Endpoints
Add Entity Reaction
Add or update a reaction on an entity
Add Entity Reaction
curl --request POST \
--url https://api.sublay.io/v8/:projectId/entities/:entityId/reactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reactionType": "<string>",
"userId": "<string>"
}
'import requests
url = "https://api.sublay.io/v8/:projectId/entities/:entityId/reactions"
payload = {
"reactionType": "<string>",
"userId": "<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({reactionType: '<string>', userId: '<string>'})
};
fetch('https://api.sublay.io/v8/:projectId/entities/:entityId/reactions', 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/entities/:entityId/reactions",
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([
'reactionType' => '<string>',
'userId' => '<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/entities/:entityId/reactions"
payload := strings.NewReader("{\n \"reactionType\": \"<string>\",\n \"userId\": \"<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/entities/:entityId/reactions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reactionType\": \"<string>\",\n \"userId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/entities/:entityId/reactions")
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 \"reactionType\": \"<string>\",\n \"userId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyRequires the
entities bundle. A project without the entities bundle returns 403 database/tables-not-available. See Bundles.reactionCounts map is updated accordingly. Sending the reaction the user already has changes nothing: the response is the same 200 with the entity, counts stay as they are, and no notification is sent.
Authentication required.
Path Parameters
string
required
The UUID of the entity to react to.
Body Parameters
string
required
The type of reaction to add. One of:
upvote, downvote, like, love, wow, sad, angry, funny.string
Override which user the reaction is attributed to. Service or master key only. Useful for backfilling reactions from an external system.
Response
Returns the updated Entity object with the newreactionCounts map.
The entity owner receives an in-app notification when someone reacts to their entity. Milestone notifications are also sent at reaction count thresholds (e.g., 10, 50, 100 reactions).
Error Responses
Missing User — 400
Missing User — 400
{ "error": "Missing user ID", "code": "entity/missing-user-id" }
userId override is provided.Not Found — 404
Not Found — 404
{ "error": "Entity not found.", "code": "entity/not-found" }

