Partner API

Webhooks

Outbound HTTP callbacks fired when interesting state changes happen inside
your organisation. Signed HMAC-SHA256, retried with exponential backoff, and
dead-lettered after the retry budget is spent.

All endpoints under /api/v2/webhooks need scope webhooks:manage.

Event catalogue

Event When
dpp.created A new DPP row is persisted in your org.
dpp.updated A DPP attribute or field-value changes.
dpp.published is_public flips false → true.
dpp.unpublished is_public flips true → false.
dpp.deleted A DPP is deleted.
dpp.archived A DPP is archived.
dpp.publication_failed Blockchain publication of a DPP fails.
dpp.compliance.evaluated A DPP's compliance status changes after evaluation.
import.completed A bulk import job finishes successfully.
import.failed A bulk import job fails.
template.created / .updated / .deleted Template lifecycle.

New event types are additive (non-breaking) and may land at any time. Filter
client-side; do not assume the catalogue is closed.

The URL must be http or https and must resolve to a public address. Loopback, private, link-local (including cloud metadata), and credential-bearing URLs are rejected both when you save the endpoint and again at delivery time. Redirects are not followed.

Register an endpoint

POST /api/v2/webhooks

curl -sS https://orobo.io/api/v2/webhooks \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "webhook_endpoint": {
      "url": "https://hooks.acme.example/orobo",
      "event_types": ["dpp.published", "dpp.unpublished"],
      "description": "Production DPP publication mirror"
    }
  }'

Response (201 Created):

{
  "data": {
    "id": "01H…",
    "url": "https://hooks.acme.example/orobo",
    "event_types": ["dpp.published", "dpp.unpublished"],
    "active": true,
    "signing_secret": "whsec_kp9f3...",   // returned ONLY here and on /test
    "signing_secret_prefix": "whsec_kp9f"
  }
}

Store signing_secret immediately. Subsequent reads only expose the
prefix. To rotate, POST /api/v2/webhooks/:id/rotate_secret and again capture
the new plaintext.

List / show / update / delete

GET /api/v2/webhooks, GET/PATCH/DELETE /api/v2/webhooks/:id. Standard
shape — see other resource refs.

Test delivery

POST /api/v2/webhooks/:id/test

Synchronously fires a webhook.test event to the endpoint and returns the
upstream HTTP status / body so partners can debug without scheduling a real
state change. The plaintext signing_secret is also re-exposed in this
response (one-time leak via this endpoint is acceptable because the caller
already holds webhooks:manage).

HTTP delivery contract

Every fired event POSTs JSON like:

{
  "id": "evt_01H…",
  "type": "dpp.published",
  "created_at": "2026-05-11T13:42:00Z",
  "data": { "dpp": { /* full to_partner_json shape */ } }
}

with these headers:

Content-Type:           application/json
User-Agent:             Orobo-Webhooks/2.0
X-Orobo-Event:          dpp.published
X-Orobo-Delivery:       dlv_01H…   # unique per attempt
X-Orobo-Signature:      t=1742480000,v1=64hexchars
X-Orobo-Signature-Algo: HMAC-SHA256

We treat any 2xx response as delivered. 408, 429, and 5xx are retried with
exponential backoff (15s, 1m, 5m, 30m, 2h, 12h). After 6 attempts the delivery
is moved to status dead and surfaced in the dashboard. Other 4xx are treated
as permanent failures (you've configured the wrong endpoint or your handler is
rejecting the payload) and not retried. Connection errors and timeouts are
retried. Timeout per attempt: 10 seconds.

Verify the signature

The signature header is t=<unix-timestamp>,v1=<hex-hmac>. The HMAC is
computed over "#{timestamp}.#{raw_request_body}" using your signing_secret
as the key (SHA-256). Compare with constant-time equality; reject any payload
where now - timestamp > 300s to defeat replay.

require "openssl"

post "/orobo" do
  raw  = request.body.read
  sig  = request.env["HTTP_X_OROBO_SIGNATURE"].to_s
  t, v1 = sig.split(",").map { |kv| kv.split("=", 2).last }
  halt 401 if t.nil? || v1.nil?
  halt 401 if (Time.now.to_i - t.to_i).abs > 300

  expected = OpenSSL::HMAC.hexdigest("SHA256", ENV["OROBO_WEBHOOK_SECRET"], "#{t}.#{raw}")
  halt 401 unless OpenSSL.fixed_length_secure_compare(expected, v1)

  # safe to parse + process
  event = JSON.parse(raw)
  process(event)
  status 204
end

Replay protection

The 5-minute timestamp window above is one half. The other half is on you:
persist id (the event id, not the delivery id) and skip duplicates. We retry
on 5xx so a slow handler can legitimately receive the same event id more than
once.

Disabling an endpoint

A misbehaving endpoint will not be auto-disabled — even after dead-lettering
we keep firing future events at it. To stop the bleeding, DELETE the
endpoint (or PATCH active=false).