Authorize a realtime channel
curl --request POST \
--url https://api.usepatchwork.co/v1/loom/realtime/auth \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel_name": "private-thread-3fa85f64-5717-4562-b3fc-2c963f66afa6",
"socket_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channel_name: 'private-thread-3fa85f64-5717-4562-b3fc-2c963f66afa6',
socket_id: '<string>'
})
};
fetch('https://api.usepatchwork.co/v1/loom/realtime/auth', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.usepatchwork.co/v1/loom/realtime/auth"
payload = {
"channel_name": "private-thread-3fa85f64-5717-4562-b3fc-2c963f66afa6",
"socket_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"status": "error",
"error": {
"message": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}{
"status": "error",
"error": {
"message": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}Realtime
Authorize a realtime channel
Sign a Pusher subscription for private-thread-{id}. The token must own the thread. Used by the browser SDK after realtime/config.
POST
/
v1
/
loom
/
realtime
/
auth
Authorize a realtime channel
curl --request POST \
--url https://api.usepatchwork.co/v1/loom/realtime/auth \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel_name": "private-thread-3fa85f64-5717-4562-b3fc-2c963f66afa6",
"socket_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channel_name: 'private-thread-3fa85f64-5717-4562-b3fc-2c963f66afa6',
socket_id: '<string>'
})
};
fetch('https://api.usepatchwork.co/v1/loom/realtime/auth', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.usepatchwork.co/v1/loom/realtime/auth"
payload = {
"channel_name": "private-thread-3fa85f64-5717-4562-b3fc-2c963f66afa6",
"socket_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"status": "error",
"error": {
"message": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}{
"status": "error",
"error": {
"message": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}Authorizations
Identify accepts a workspace API key (sk_…). Loom accepts either a short-lived session token (direct) or a workspace API key (relay).
Headers
Makes this POST safe to retry. The first call does the work and its response is stored; a retry with the same key returns that stored response with Idempotency-Replayed: true, without charging again. Same key with a different body is rejected. Keys expire after 24 hours.
Maximum string length:
255Body
application/json
Response
Channel authorization payload from Pusher.