Quickstart¶
This walks through your first real call against your own AiFlow deployment: confirm it's reachable, then send it an event.
1. Confirm your deployment is reachable¶
GET /health needs no authentication. It's a good first check that your
base URL is correct and the server is up.
2. Get an API key¶
Everything past this point needs an API key. Keys are created by an
admin, not something you can self-serve from a quickstart, so ask
whoever administers your deployment for one scoped to events:write.
See Authentication for the full picture of how keys
and scopes work.
3. Send your first event¶
With a key in hand, post an event to a specific agent. 1 below stands
in for that agent's agent_id: your admin team tells you which id to
use. See Agents & channels for why
that id shows up in the path.
const response = await fetch(
"https://api.your-domain.com/api/v1/agents/1/events",
{
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
event_type: "test_event",
payload: { message: "hello from my integration" },
}),
},
);
console.log(await response.json());
A successful call returns 201 Created:
matched: false is expected the first time
matched is true only if the event matched a trigger your admin
team has configured on that agent, and call_ids is populated only
when a trigger placed an outbound call. matched: false just means
the event was recorded and nothing acted on it, which is completely
normal if no trigger is configured yet. Setting up a trigger is an
admin-dashboard step: see
Triggers & events for what
determines a match.
What's next¶
- Sending events: the full events endpoint reference.
- Webhook subscriptions: get notified when a call finishes, a transcript is ready, or a message goes out.
- Concepts overview: the core ideas, Agents, Triggers, Events, behind everything else on this site.