Catch up on Hug events
A daemon catches up on its Hugs’ events (answers, expiry, cancellation) after a restart, from each Hug’s last processed event; up to 500 Hugs per call. Also says how each Hug stands, so one that ended while the daemon was away can end there too.
Daemon only: requires the daemon’s realm token (Authorization: Bearer cliq_dt_…). User tokens are refused.
POST
/
v1
/
hugs
/
get_events
Catch up on Hug events
curl --request POST \
--url https://{host}/v1/hugs/get_events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"daemon_id": "7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"cursors": [
{
"hug_id": "6c2d1e0f-9a8b-4c7d-8e6f-5a4b3c2d1e0f",
"after_seq": 0
}
]
}
'import requests
url = "https://{host}/v1/hugs/get_events"
payload = {
"daemon_id": "7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"cursors": [
{
"hug_id": "6c2d1e0f-9a8b-4c7d-8e6f-5a4b3c2d1e0f",
"after_seq": 0
}
]
}
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({
daemon_id: '7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d',
cursors: [{hug_id: '6c2d1e0f-9a8b-4c7d-8e6f-5a4b3c2d1e0f', after_seq: 0}]
})
};
fetch('https://{host}/v1/hugs/get_events', 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://{host}/v1/hugs/get_events",
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([
'daemon_id' => '7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d',
'cursors' => [
[
'hug_id' => '6c2d1e0f-9a8b-4c7d-8e6f-5a4b3c2d1e0f',
'after_seq' => 0
]
]
]),
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://{host}/v1/hugs/get_events"
payload := strings.NewReader("{\n \"daemon_id\": \"7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n \"cursors\": [\n {\n \"hug_id\": \"6c2d1e0f-9a8b-4c7d-8e6f-5a4b3c2d1e0f\",\n \"after_seq\": 0\n }\n ]\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://{host}/v1/hugs/get_events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"daemon_id\": \"7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n \"cursors\": [\n {\n \"hug_id\": \"6c2d1e0f-9a8b-4c7d-8e6f-5a4b3c2d1e0f\",\n \"after_seq\": 0\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/v1/hugs/get_events")
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 \"daemon_id\": \"7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n \"cursors\": [\n {\n \"hug_id\": \"6c2d1e0f-9a8b-4c7d-8e6f-5a4b3c2d1e0f\",\n \"after_seq\": 0\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"events": [
{
"hug_id": "6c2d1e0f-9a8b-4c7d-8e6f-5a4b3c2d1e0f",
"seq": 1,
"type": "response",
"payload": {
"response": {
"response_id": "3f2e1d0c-9b8a-4c7d-8e6f-5a4b3c2d1e0f",
"responder": {
"user_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"name": "Sapan"
},
"via": [
"security"
],
"values": {
"decision": "approve"
},
"comment": null,
"responded_at": "2026-10-07T10:20:00Z"
}
}
}
],
"hugs": [
{
"hug_id": "6c2d1e0f-9a8b-4c7d-8e6f-5a4b3c2d1e0f",
"status": "open",
"last_seq": 1
}
],
"has_more": false
}
}{
"ok": false,
"error": {
"code": "unauthorized",
"message": "Authentication required"
}
}{
"ok": false,
"error": {
"code": "forbidden",
"message": "You do not have access to do this"
}
}{
"ok": false,
"error": "daemon_id: Required",
"code": "invalid_params"
}{
"ok": false,
"error": "Internal server error",
"code": "internal_error"
}Authorizations
User PAT (cliq_tok_…, including session-scoped) or realm token (cliq_dt_…).
Body
application/json
⌘I
Catch up on Hug events
curl --request POST \
--url https://{host}/v1/hugs/get_events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"daemon_id": "7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"cursors": [
{
"hug_id": "6c2d1e0f-9a8b-4c7d-8e6f-5a4b3c2d1e0f",
"after_seq": 0
}
]
}
'import requests
url = "https://{host}/v1/hugs/get_events"
payload = {
"daemon_id": "7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"cursors": [
{
"hug_id": "6c2d1e0f-9a8b-4c7d-8e6f-5a4b3c2d1e0f",
"after_seq": 0
}
]
}
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({
daemon_id: '7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d',
cursors: [{hug_id: '6c2d1e0f-9a8b-4c7d-8e6f-5a4b3c2d1e0f', after_seq: 0}]
})
};
fetch('https://{host}/v1/hugs/get_events', 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://{host}/v1/hugs/get_events",
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([
'daemon_id' => '7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d',
'cursors' => [
[
'hug_id' => '6c2d1e0f-9a8b-4c7d-8e6f-5a4b3c2d1e0f',
'after_seq' => 0
]
]
]),
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://{host}/v1/hugs/get_events"
payload := strings.NewReader("{\n \"daemon_id\": \"7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n \"cursors\": [\n {\n \"hug_id\": \"6c2d1e0f-9a8b-4c7d-8e6f-5a4b3c2d1e0f\",\n \"after_seq\": 0\n }\n ]\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://{host}/v1/hugs/get_events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"daemon_id\": \"7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n \"cursors\": [\n {\n \"hug_id\": \"6c2d1e0f-9a8b-4c7d-8e6f-5a4b3c2d1e0f\",\n \"after_seq\": 0\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/v1/hugs/get_events")
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 \"daemon_id\": \"7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n \"cursors\": [\n {\n \"hug_id\": \"6c2d1e0f-9a8b-4c7d-8e6f-5a4b3c2d1e0f\",\n \"after_seq\": 0\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"events": [
{
"hug_id": "6c2d1e0f-9a8b-4c7d-8e6f-5a4b3c2d1e0f",
"seq": 1,
"type": "response",
"payload": {
"response": {
"response_id": "3f2e1d0c-9b8a-4c7d-8e6f-5a4b3c2d1e0f",
"responder": {
"user_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"name": "Sapan"
},
"via": [
"security"
],
"values": {
"decision": "approve"
},
"comment": null,
"responded_at": "2026-10-07T10:20:00Z"
}
}
}
],
"hugs": [
{
"hug_id": "6c2d1e0f-9a8b-4c7d-8e6f-5a4b3c2d1e0f",
"status": "open",
"last_seq": 1
}
],
"has_more": false
}
}{
"ok": false,
"error": {
"code": "unauthorized",
"message": "Authentication required"
}
}{
"ok": false,
"error": {
"code": "forbidden",
"message": "You do not have access to do this"
}
}{
"ok": false,
"error": "daemon_id: Required",
"code": "invalid_params"
}{
"ok": false,
"error": "Internal server error",
"code": "internal_error"
}