How SmartAI delivers results
SmartAI does not push results to a URL. Instead, it stores completed assessment events in a queue. Your server polls the queue — fetching and clearing events on a schedule.- The env vars on your server
- A background poller that runs every 30 seconds
Step 1 — Environment variables
Add these two lines to your server.env file:
Step 2 — Initialise the client
Create oneAssessmentClient instance. You can do this once globally or once per poll call — both are fine.
Step 3 — What to pass to getWebhookEvents()
number
default:"50"
How many events to fetch in one call. Maximum is 100.Start with
50. If you have a very high assessment volume (hundreds per hour), increase to 100.number
A Unix timestamp in milliseconds. Only returns events that were stored after this time.Leave this out for normal polling — you don’t need it unless you’re backfilling a time window.
What comes back
array
Array of assessment result objects. Each one has all the candidate’s result data.
See Webhook Event Schema for every field.
number
How many events are still waiting in the queue after this batch.
0→ queue is empty, nothing more to process> 0→ there are more events — callgetWebhookEventsagain to get the next batch
Step 4 — What to pass to acknowledgeWebhookEvents()
string[]
required
An array of Events you do not acknowledge stay in the queue and are returned again on the next poll.
eventId strings — one for each event you successfully saved to your database.What comes back
number
The number of events that were removed from the queue.
Step 5 — Complete poller setup
Two event types come through the same queue. Your poller handles both:
Copy this into your server. Place it in a file like
src/jobs/pollAssessments.ts and call it when your server starts.
Node.js
Python
Python (FastAPI startup)
Step 6 — Save function (what fields to store)
All options at a glance
getWebhookEvents() options
acknowledgeWebhookEvents() options
Fields returned in each event
See the full Webhook Event Schema for every field with detailed descriptions.

