Skip to content

StreamingLive data

Predictefy can POST a signed event to your HTTPS endpoint when a background job finishes or an execution changes status, so you do not have to poll for either.

Endpoint management is available through the API, the CLI, and the MCP server on deployments where webhooks are enabled. The developer console has no webhook screen yet.

EventScopeFires when
ingest.run.completedPlatform-widea catalog refresh finishes
matcher.run.completedPlatform-widea cross-venue matching run finishes
execution.status.changedYour accounta submitted execution, cancel, or refresh commits a different status
conditional.triggeredYour accountan armed take-profit / stop-loss rule was satisfied
conditional.firedYour accounta conditional order became a venue submission
conditional.fire_failedYour accounta hosted fire ended without a venue submission, or a client reported not_submitted
conditional.expiredYour accounta conditional order’s expiresAt passed while it was still armed

The two job events carry that run’s result: job, started_at, finished_at, ok, and a counts tally. On a failed run ok is false and counts.error holds the message.

execution.status.changed carries lifecycle metadata only:

{
"executionId": "8a4fdf19-49e1-4702-9cb8-31fd9c46f7e1",
"venue": "hyperliquid",
"status": "filled",
"previousStatus": "acked",
"occurredAt": "2026-08-01T02:03:04.000Z"
}

It is tenant-scoped: it reaches only endpoints owned by the execution’s account. Your account id is routing context and is deliberately not in the payload.

The four conditional.* events are tenant-scoped for the same reason. Their payload and the action field that tells a client-mode customer what to do next are documented in Conditional orders.

It fires only on a real transition. An unchanged result, a lost concurrent update, or an already-terminal row emits nothing — so a quiet period means nothing changed, not that a delivery was dropped.

All routes are API-key authenticated and scoped to your account.

Endpoints must use HTTPS on the default port (443).

Terminal window
curl -s "$PREDICTEFY_API_URL/v1/webhooks" \
-H "Authorization: Bearer pk_live_YOUR_KEY" \
-H "content-type: application/json" \
-d '{"url":"https://example.com/hooks/predictefy","events":["execution.status.changed"]}'

The response includes a secret shown exactly once. Store it immediately; it is never returned again, and listing your endpoints redacts it.

url must be public HTTPS. Localhost, loopback, and private or link-local addresses are rejected — IPv4, IPv6, and IPv4-mapped-IPv6 literals alike. events must be a non-empty subset of the table above.

  • GET /v1/webhooks — your endpoints, secrets redacted.
  • DELETE /v1/webhooks/{id} — delete one, along with its queued deliveries. An id that is not yours returns 404.
  • GET /v1/webhooks/{id}/deliveries?after=<cursor>&limit=<n> — delivery rows with id, event, payload, status, createdAt, and deliveredAt. limit defaults to 50, capped at 200. Rows are always oldest-to-newest; pass nextCursor back as after. Both SDKs expose this as client.webhooks.deliveries(id, params).

For local development, predictefy webhooks listen [--endpoint <id>] polls that route every two seconds. Without an endpoint it creates a temporary non-routable one and deletes it on exit. --forward http://localhost:PORT/path re-POSTs each payload locally.

Call POST /v1/webhooks/{id}/rotate with your API key to replace an endpoint’s signing secret immediately. The response’s data.secret is the new raw secret, shown only once; store it securely and update your receiver. data.rotatedAt records the rotation time. An endpoint outside your account returns 404.

There is no old-secret grace period. Deliveries claimed after rotation, including queued retries, use the new secret. A delivery already claimed can still arrive signed with the old secret, so account for in-flight requests when switching your receiver.

For zero downtime, use a second endpoint:

  1. Prepare a second receiver URL that can accept its own signing secret.
  2. Register a second endpoint with the same event subscriptions, then configure its receiver with the returned secret. Keep the original endpoint and receiver running during setup.
  3. Verify signed deliveries at the second receiver. Deduplicate events received through both endpoints using the event identities described below.
  4. Delete the original endpoint once the second receiver is ready. Deletion removes the old endpoint’s queued deliveries; keep handling any already in-flight requests.

New and rotated secrets are stored encrypted at rest and read only when a delivery is signed. This does not change the headers or signature verification contract below.

Each delivery is a POST to your URL with these headers:

HeaderValue
Content-Typeapplication/json
X-Predictefy-Eventthe event name
X-Predictefy-TimestampUnix seconds when the delivery was signed
X-Predictefy-Signaturehex HMAC-SHA256 — see below

Redirects are not followed, and each attempt times out after 10 seconds.

The signature is a hex HMAC-SHA256 over `${timestamp}.${rawBody}` keyed by your endpoint secret. Recompute it over the exact bytes you received — not a re-serialized object — and compare in constant time:

import { createHmac, timingSafeEqual } from 'node:crypto';
function verify(rawBody: string, headers: Record<string, string>, secret: string): boolean {
const timestamp = headers['x-predictefy-timestamp'];
const signature = headers['x-predictefy-signature'];
if (!timestamp || !signature) return false;
const expected = createHmac('sha256', secret).update(`${timestamp}.${rawBody}`).digest('hex');
const a = Buffer.from(signature, 'hex');
const b = Buffer.from(expected, 'hex');
return a.length === b.length && timingSafeEqual(a, b);
}

Optionally reject deliveries whose X-Predictefy-Timestamp is far from your clock, to blunt replay attacks.

Respond 2xx to acknowledge. Any non-2xx, network error, or timeout is retried with exponential backoff, then abandoned:

AttemptRetry after
1 → 21 minute
2 → 35 minutes
3 → 430 minutes
4 → 52 hours
after 5 failed attemptsmarked failed (no further retries)

Make your handler idempotent. For job events, dedupe on the payload’s job and started_at; for execution events, on executionId, status, and occurredAt.

Webhook delivery and endpoint management are available on deployments where webhooks are enabled. Unavailable calls answer 404 ROUTE_NOT_FOUND and are not charged.