PublicXDevelopers Open PublicX

Webhooks

PublicX sends one HTTPS POST to your endpoint for each event your company may see.

Setting up an endpoint

curl -X POST https://api.publicx.ai/v1/webhook-endpoints \
  -H "Authorization: Bearer $PUBLICX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/publicx", "event_types": ["saved_tender.stage_changed"], "filters": {"stages": ["go"]}}'

What your endpoint receives

POST /publicx HTTP/1.1
Content-Type: application/json
User-Agent: PublicX-Webhooks/1
webhook-id: evt_01JDZ3Q6M8T4X2F7K9V0B5N1RC
webhook-timestamp: 1795429443
webhook-signature: v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4=
{
  "id": "evt_01JDZ3Q6M8T4X2F7K9V0B5N1RC",
  "type": "saved_tender.stage_changed",
  "api_version": "2027-01-01",
  "timestamp": "2026-11-23T10:14:03.512Z",
  "company_id": "4b1e...",
  "data": {
    "tender": { "id": "6f1c...", "name": "...", "entity": "...", "deadline_at": "...", "app_url": "..." },
    "saved_tender": { "stage": "go", "previous_stage": "analysis", "updated_at": "..." },
    "actor": { "type": "user", "id": "9a7d...", "name": "Ana Costa" }
  }
}

Event types

Type When Scope Starter
tender.matched A new tender matches one of your company's shared saved searches tenders:read Yes
saved_tender.created A tender is saved to your pipeline saved:read
saved_tender.stage_changed A saved tender moves to another stage saved:read
saved_tender.deleted A tender leaves your pipeline saved:read
saved_tender.result_published The award result of a saved tender is published saved:read
tender.deadline_approaching 14, 7, 3 and 1 days before a saved tender's deadline saved:read Yes
tender.deadline_changed A saved tender's deadline changes saved:read Yes
tender.deadline_passed A saved tender's deadline passes saved:read Yes
analysis.completed The AI analysis of a saved tender against your company is ready saved:read
document.created, document.updated, document.deleted A proposal document changes documents:read
certificate.expiring A certificate in your company documents is about to expire documents:read
board.task_created, board.task_updated, board.task_deleted A board task changes boards:read
board.comment_created Someone comments on a board task boards:read
renewal.due A contract you watch is about to end and may be tendered again saved:read
renewal.published The new tender for a contract you watch is published saved:read
radar.recommended The Tender Radar recommends a tender Settings only Yes
award.published A contract is awarded to a buyer or competitor you follow Settings only

Verifying a signature

Every request is signed following Standard Webhooks. Its libraries (Go, Python, JavaScript, PHP, Java, Ruby, C#, Rust, Elixir) do all of this for you.

Node:

import crypto from "node:crypto";

function verify(secret, headers, rawBody) {
  const id = headers["webhook-id"], ts = headers["webhook-timestamp"];
  if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false;
  const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
  const want = crypto.createHmac("sha256", key).update(`${id}.${ts}.`).update(rawBody).digest();
  return headers["webhook-signature"].split(" ").some((entry) => {
    const [version, sig] = entry.split(",");
    const got = Buffer.from(sig ?? "", "base64");
    return version === "v1" && got.length === want.length && crypto.timingSafeEqual(got, want);
  });
}

Python:

import base64, hashlib, hmac, time

def verify(secret: str, headers: dict, raw_body: bytes) -> bool:
    msg_id, ts = headers["webhook-id"], headers["webhook-timestamp"]
    if abs(time.time() - int(ts)) > 300:
        return False
    key = base64.b64decode(secret.removeprefix("whsec_"))
    want = hmac.new(key, f"{msg_id}.{ts}.".encode() + raw_body, hashlib.sha256).digest()
    for entry in headers["webhook-signature"].split():
        version, _, sig = entry.partition(",")
        if version == "v1" and hmac.compare_digest(base64.b64decode(sig or "="), want):
            return True
    return False

Delivery and retries

Addresses

Polling instead

GET /v1/events lists the last 30 days of events your key may see, newest first, in the same envelope. Filter it with type and since. A page can hold fewer items than limit, so follow next_cursor. Events are kept for companies that have a key with webhooks:write.