Guide
Webhooks
PRESHos sends a signed HTTPS POST to your endpoint when a subscribed event happens anywhere in the workspace: in the app, through the API, from an agent, or by an automation. Workspace admins manage endpoints in Settings → Developer → Webhooks.
| Event | When |
|---|---|
work_item.created | A work item of any type was created. |
work_item.field_changed | Fields on a work item changed. changed_fields lists them; status changes are a separate event. |
work_item.status_changed | A work item moved to another workflow status. |
approval.decided | A reviewer decided an approval: decision is approved, rejected, cancelled or changes_requested. work_item is null for legacy deliverable approvals. |
team_workspace.task_created | A task was created in a team workspace. team_workspace_id, task_id and task_key identify it. |
team_workspace.task_status_changed | A team workspace task moved to another state. status is todo, working, for_review, done or cancelled. |
team_workspace.task_assigned | A team workspace task was assigned. owner_user_id and agent_seat_id say to whom. |
team_workspace.review_recorded | A reviewer recorded an outcome on a team workspace task: outcome is pass or changes_requested. |
team_workspace.thread_posted | A person posted in a team workspace's shared thread. Agent posts and cards do not fire this event. |
team_workspace.objective_status_changed | A person set or accepted a new status for a team workspace objective. status.from and status.to are on_track, at_risk, off_track or done. |
team_workspace.question_asked | An agent in a team workspace asked a member a question and is waiting. to_user_id is the member asked. |
eval.experiment.finished | An eval experiment reached its end. experiment_id, suite_id and status (completed, failed or canceled). Fetch the experiment for its results. |
eval.gate.evaluated | A finished experiment was checked against a gate of its suite. outcome is passed, failed or insufficient_evidence; blocks is true for a failed blocking gate. |
Send test event delivers a ping event to check an endpoint. Endpoints never receive ping otherwise.
Payloads are deliberately thin: ids, the event type, changed field names and status ids, never field values. Fetch the record with your API key, so your integration only sees what its key may read.
{
"id": "evt_5b2f0c8d9e1a4b7c8d9e0f1a2b3c4d5e",
"type": "work_item.status_changed",
"api_version": "v1",
"created_at": "2026-10-01T15:04:05.000Z",
"workspace_id": 9,
"data": {
"object_type": "work-items",
"record_id": "48213",
"work_item_type_id": "deliverable",
"status": { "from": "t9-status-open", "to": "t9-status-review" },
"actor": { "type": "user", "user_id": 17 }
}
}work_item.field_changed carries changed_fields. approval.decided carries approval_id, decision (approved, rejected, cancelled or changes_requested) and the work_item it reviews (null for legacy deliverable approvals). Then call GET /v1/objects/{object_type}/records/{record_id} with object_type and record_id.
Headers: PRESHos-Signature, PRESHos-Event-Id, PRESHos-Event-Type, Content-Type: application/json, User-Agent: PRESHos-Webhooks/1.0.
Each endpoint has its own signing secret (whsec_…), shown once when you add the endpoint or rotate it, and stored only in the PRESHos Secrets Vault. The PRESHos-Signature header is t=<unix seconds>,v1=<hex>, where v1 is HMAC-SHA256 of "<t>.<raw request body>" with the secret. The header can carry more than one v1: accept the event if any of them matches. Verify against the raw body before parsing it, and reject timestamps more than 5 minutes old.
import crypto from 'node:crypto';
export function verifyPreshosWebhook(rawBody, header, secret, toleranceSeconds = 300) {
const parts = header.split(',').map((part) => part.trim().split('='));
const timestamp = Number(parts.find(([key]) => key === 't')?.[1]);
if (!timestamp || Math.abs(Date.now() / 1000 - timestamp) > toleranceSeconds) return false;
const wanted = crypto.createHmac('sha256', secret).update(`${timestamp}.${rawBody}`).digest();
return parts
.filter(([key]) => key === 'v1')
.some(([, value]) => {
const given = Buffer.from(value, 'hex');
return given.length === wanted.length && crypto.timingSafeEqual(given, wanted);
});
}Rotating a secret. After you rotate in Settings, deliveries carry two v1 signatures for 24 hours: one with the new secret and one with the previous secret. Switch your receiver to the new secret within that window and nothing is dropped.
- Respond with any
2xxstatus within 10 seconds. Do the work asynchronously; PRESHos does not read response bodies. - A failed delivery (non-2xx, timeout, or connection error) is retried 6 times after 1 min, 5 min, 30 min, 2 h, 8 h, 24 h (7 attempts in all). Redirects are not followed.
- Deliveries can arrive more than once and out of order. Use the event
id(also inPRESHos-Event-Id) to skip duplicates, and re-read the record rather than trusting event order. - An endpoint that keeps failing (15 deliveries in a row, with no success for 3 days) is disabled. Re-enable it in Settings → Developer → Webhooks; Recent deliveries shows each attempt's status.
- Endpoints must be public HTTPS URLs on the standard port (443). Private, loopback and link-local addresses are refused.
// Express: keep the raw body for signature checks.
app.post('/preshos/webhooks', express.raw({ type: 'application/json' }), async (req, res) => {
const body = req.body.toString('utf8');
if (!verifyPreshosWebhook(body, req.get('PRESHos-Signature') ?? '', process.env.PRESHOS_WEBHOOK_SECRET)) {
return res.sendStatus(400);
}
res.sendStatus(200); // acknowledge first, then work
const event = JSON.parse(body);
if (event.type.startsWith('work_item.')) {
const record = await fetch(`https://api.preshos.com/v1/objects/${event.data.object_type}/records/${event.data.record_id}`, {
headers: { Authorization: `Bearer ${process.env.PRESHOS_API_KEY}` },
}).then((response) => response.json());
// … sync record.data
}
});