Skip to content

00Integration guide

REST API (curl)

Send one event with a single HTTP request. Works from any language or tool that can make a POST.

Walkthrough · recorded against a local Ovelin

Everything else in these guides is a wrapper around one request: POST /api/ingest/<organization id> with a Bearer key and a JSON body. If you can send that, you can record an agent.

Prerequisites

  • An Ovelin organization you can create keys in (admin role).
  • curl 7.76 or later (for --fail-with-body).

1. Get an API key

  1. In Ovelin, open Settings → API keys.
  2. Under Ingest key, create a key and copy it. It is shown once; Ovelin keeps only a hash.
  3. Copy the Organization ID from the same page.

Put all three values in your environment, not in code:

sh
export OVELIN_URL="https://your-ovelin-host"   # http://localhost:3000 for a local instance
export OVELIN_ORG_ID="your-organization-id"
export OVELIN_API_KEY="agl_live_…"

An organization key can report for any agent. For production, give each agent its own key under Settings → API keys → Agent keys: a leaked agent key can then only write as that one agent, and you can revoke it alone.

2. Install

Nothing to install.

3. Minimal working example

examples/curl/send-event.sh
#!/bin/sh
# Send one event to Ovelin and print the sealed record.
# Needs OVELIN_URL, OVELIN_ORG_ID and OVELIN_API_KEY (see ../.env.example).
set -eu

curl --fail-with-body -sS -X POST "$OVELIN_URL/api/ingest/$OVELIN_ORG_ID" \
  -H "Authorization: Bearer $OVELIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "source": "custom",
    "agent_name": "invoice-agent",
    "action": "sent_invoice_reminder",
    "outcome": "success",
    "actor": "ops@example.com",
    "data_accessed": ["customer_pii", "financial_data"],
    "metadata": { "run_id": "'"${OVELIN_RUN_ID:-curl-quickstart}"'", "invoice": "INV-1042" }
  }'
echo

The fields:

FieldRequiredMeaning
sourceyesWhere the event comes from: custom, n8n, make_com, openai_api or zapier.
agent_namenoThe agent that acted. Unknown names are registered automatically.
actionnoWhat it did, in snake_case. Shown as the event name.
outcomenosuccess, failure or unknown.
actornoThe person the agent acted for.
data_accessednoAny of customer_pii, financial_data, health_data, internal_documents, external_apis, none.
metadatanoAnything else. metadata.run_id groups events into one execution under Sessions.

4. Run it

sh
sh examples/curl/send-event.sh

A 201 response is the receipt:

json
{"ok": true, "id": "…", "seq": 1, "hash": "6ca3b6c5d4dc7651…", "duplicate": false, "redacted": [], "alerts_raised": 0}

hash is the seal: computed over the stored record and chained to the record before it, before the response was sent. A body sent again unchanged, timestamp included, returns 200 with "duplicate": true and the original id instead of creating a second record. Without a timestamp, Ovelin uses the time of arrival, so a retry is a new record: send the time the action happened if your sender retries. Anything that looks like a credential is stripped before the record is sealed, and redacted lists what was removed.

5. Check it in Ovelin

  1. Open Activity. The newest rows are the events you just sent, each with a sequence number and a seal.
  2. Click one. The detail panel shows the payload as received; Recompute seal checks its seal again.
  3. Open Agents: an agent name Ovelin had not seen before is registered automatically, without an owner. Give it one so someone is accountable for it.

To confirm nothing was altered later, open Integrity. It recomputes every seal and every link between records, and reports Trail intact.

Sending many events at once

POST /api/ingest/<org_id>/batch takes {"events": [ … ]} with up to 100 events (1 MB in all), each in the same shape as above, with the same Authorization: Bearer header. Events are sealed in array order. The response lists one result per event, in order: 201 stored, 200 duplicate, 4xx rejected (the batch goes on), and not_attempted when a server error stopped the batch so that nothing is sealed after a gap. The whole response is 200 when every event was stored or was a duplicate, and 207 otherwise. Resending the whole batch is safe, because events already stored come back as duplicates. A batch counts as one event per item against the 600-a-minute limit; a batch that doesn't fit is refused whole with 429 and Retry-After.

Common errors

ResponseCauseFix
401 Invalid API keyThe key is wrong, revoked, or belongs to another organization.Create a key in Settings → API keys and check OVELIN_ORG_ID is the same organization's.
401 Missing API key (use Authorization: Bearer <key>)The Authorization header was not sent.Send Authorization: Bearer $OVELIN_API_KEY. The key never goes in the body.
422 Payload must include a 'source' fieldThe JSON has no source.Add "source": "custom" (or n8n, make_com, openai_api, zapier).
422 Invalid option: expected one of "success"|"failure"|"unknown"outcome has another value, such as warning.Use success, failure or unknown.
400 Invalid organization idOVELIN_ORG_ID is not the organization's UUID.Copy the Organization ID from Settings → API keys.
429 Rate limit exceededMore than 600 events a minute for one organization.Retry after the Retry-After header. To send many events, use the batch endpoint (up to 100 per request).
405A GET request.Use POST.
curl: (22) with no bodyAn older curl without --fail-with-body.Drop the flag, or upgrade curl.

How this guide is tested

Every code block above is copied from examples/curl/send-event.sh by node scripts/sync-guide-snippets.mjs, and pnpm examples:test runs it against a local Ovelin and checks the events were sealed. The error responses in the table are sent for real by the same command and compared word for word.