Quickstart
This walks you from nothing to one event stored and readable back through the API. It takes about five minutes.
1. Create an account
Sign up at https://santati.io/accounts/signup/ and create a team.
2. Create a trail
In the app, open Audit Log → Trails and create a trail — team admins only. Every event is written to exactly one trail; use a name that matches a product area, e.g. billing.
You can also create one from the API, which needs a key with the manage scope (step 3 covers creating keys):
curl -X POST 'https://api.santati.io/api/v0/trails/' \
-H "Authorization: Api-Key $SANTATI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"name": "billing", "region": "us-east"}'
region is optional; blank means the default region, us-east, which is currently the only one. A successful call returns 201 with the trail's name, region and ingest_url. See Create a trail.
3. Create an API key
In the app, open Audit Log → API Keys and create a key with the write scope — or manage if you also want to create trails and streams from the API. Only team admins can create keys, and the key is shown exactly once — copy it now. It looks like sat_sk_01J9Z6K3M4QX8RT2VN5B7HCWDA.rkr1c2….
4. Export the key
export SANTATI_API_KEY=sat_sk_...
5. Install an SDK
Pick a language. The tabs on this page stay in sync, and the URL's ?lang= parameter selects one.
- curl
- Python
- Node
- Go
- Rust
- Elixir
- Ruby
- PHP
curl ships with macOS and most Linux distributions; there is nothing to install. The curl tabs call the HTTP API directly.
Requires Node 22+. ESM only; the snippets below are TypeScript and use top-level await.
npm install @santati/node
See the Node SDK for client options and errors.
Requires Go 1.25+.
go get github.com/jamescarr/santati-sdks/go
See the Go SDK for client options and errors.
Requires Rust 1.85+.
cargo add santati
cargo add tokio --features macros,rt-multi-thread
See the Rust SDK for client options and errors.
Requires Elixir 1.18+.
{:santati, "~> 0.1"}
Add it to deps/0 in mix.exs, then run mix deps.get.
See the Elixir SDK for client options and errors.
Requires PHP 8.2+.
composer require santati/santati-php
See the PHP SDK for client options and errors.
6. Emit an event
Send one event to the billing trail. event, trail and organization_id are required — a blank organization_id is rejected with unknown_organization. The SDK snippets set billing as the client's default trail, so each emit inherits it. The actor block is optional, but a useful audit record names who did it.
- curl
- Python
- Node
- Go
- Rust
- Elixir
- Ruby
- PHP
curl -X POST 'https://api.santati.io/api/v0/events/' \
-H "Authorization: Api-Key $SANTATI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"event": "invoice.voided",
"trail": "billing",
"created_at": "2026-09-29T14:03:11.482Z",
"organization_id": "org_acme_logistics",
"actor": {"type": "user", "id": "usr_123", "name": "Valentine Michael Smith"},
"targets": [{"type": "invoice", "id": "inv_555", "name": "INV-555"}]
}'
import os
import santati
with santati.Santati(os.environ["SANTATI_API_KEY"], trail="billing") as client:
result = client.events.emit(
"invoice.voided",
created_at="2026-09-29T14:03:11.482Z",
organization_id="org_acme_logistics",
actor={"type": "user", "id": "usr_123", "name": "Valentine Michael Smith"},
targets=[{"type": "invoice", "id": "inv_555", "name": "INV-555"}],
)
print(result.event.id, result.duplicate)
import { Santati } from "@santati/node";
const santati = new Santati({ apiKey: process.env.SANTATI_API_KEY!, trail: "billing" });
const { event, duplicate } = await santati.events.emit({
event: "invoice.voided",
createdAt: "2026-09-29T14:03:11.482Z",
organizationId: "org_acme_logistics",
actor: { type: "user", id: "usr_123", name: "Valentine Michael Smith" },
targets: [{ type: "invoice", id: "inv_555", name: "INV-555" }],
});
console.log(event.id, duplicate);
package main
import (
"context"
"fmt"
"log"
"os"
santati "github.com/jamescarr/santati-sdks/go"
)
func main() {
client, err := santati.NewClient(os.Getenv("SANTATI_API_KEY"), santati.WithTrail("billing"))
if err != nil {
log.Fatal(err)
}
result, err := client.Events.Emit(context.Background(), santati.EventInput{
Event: "invoice.voided",
CreatedAt: "2026-09-29T14:03:11.482Z",
OrganizationID: "org_acme_logistics",
Actor: &santati.ActorInput{Type: "user", ID: "usr_123", Name: "Valentine Michael Smith"},
Targets: []santati.TargetInput{{Type: "invoice", ID: "inv_555", Name: "INV-555"}},
})
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Event.Id, result.Duplicate)
}
use santati::{ActorInput, EventInput, Santati, TargetInput};
#[tokio::main]
async fn main() -> Result<(), santati::Error> {
let api_key = std::env::var("SANTATI_API_KEY").expect("SANTATI_API_KEY is not set");
let client = Santati::builder(api_key).trail("billing").build()?;
let result = client
.events()
.emit(EventInput {
event: "invoice.voided".into(),
created_at: Some("2026-09-29T14:03:11.482Z".into()),
organization_id: Some("org_acme_logistics".into()),
actor: Some(ActorInput {
r#type: "user".into(),
id: Some("usr_123".into()),
name: Some("Valentine Michael Smith".into()),
..Default::default()
}),
targets: Some(vec![TargetInput {
r#type: "invoice".into(),
id: "inv_555".into(),
name: Some("INV-555".into()),
..Default::default()
}]),
..Default::default()
})
.await?;
println!("{} {}", result.event.id, result.duplicate);
Ok(())
}
{:ok, client} = Santati.new(api_key: System.fetch_env!("SANTATI_API_KEY"), trail: "billing")
{:ok, result} =
Santati.Events.emit(client, %{
event: "invoice.voided",
created_at: "2026-09-29T14:03:11.482Z",
organization_id: "org_acme_logistics",
actor: %{type: "user", id: "usr_123", name: "Valentine Michael Smith"},
targets: [%{type: "invoice", id: "inv_555", name: "INV-555"}]
})
IO.puts("#{result.event.id} #{result.duplicate}")
require "santati"
client = Santati::Client.new(api_key: ENV.fetch("SANTATI_API_KEY"), trail: "billing")
result = client.events.emit(
event: "invoice.voided",
created_at: "2026-09-29T14:03:11.482Z",
organization_id: "org_acme_logistics",
actor: {type: "user", id: "usr_123", name: "Valentine Michael Smith"},
targets: [{type: "invoice", id: "inv_555", name: "INV-555"}]
)
puts "#{result.event.id} #{result.duplicate}"
<?php
require 'vendor/autoload.php';
use Santati\Client;
$client = new Client(apiKey: getenv('SANTATI_API_KEY'), trail: 'billing');
$result = $client->events->emit([
'event' => 'invoice.voided',
'created_at' => '2026-09-29T14:03:11.482Z',
'organization_id' => 'org_acme_logistics',
'actor' => ['type' => 'user', 'id' => 'usr_123', 'name' => 'Valentine Michael Smith'],
'targets' => [['type' => 'invoice', 'id' => 'inv_555', 'name' => 'INV-555']],
]);
printf("%s %s\n", $result->event->getId(), $result->duplicate ? 'true' : 'false');
A successful emit returns 201 Created with the stored event in the read shape — curl prints it as-is, and the SDKs return it as result.event (event in Node) alongside duplicate, which is true when the server replayed an earlier request. Each SDK generates an idempotency key per emit and reuses it on its automatic retries, so a retry never stores the event twice; see Idempotency. The stored event looks like this:
{
"id": "01J9Z6K3M4QX8RT2VN5B7HCWDA",
"trail": "billing",
"event": "invoice.voided",
"created_at": "2026-09-29T14:03:11.482000Z",
"received_at": "2026-09-29T14:03:11.913000Z",
"organization_id": "org_acme_logistics",
"actor": {"type": "user", "id": "usr_123", "name": "Valentine Michael Smith", "metadata": {}},
"targets": [{"type": "invoice", "id": "inv_555", "name": "INV-555", "metadata": {}}],
"metadata": {},
"data": {},
"context": {},
"hash": "",
"schema_version": null
}
7. Read it back
List the events on the trail:
- curl
- Python
- Node
- Go
- Rust
- Elixir
- Ruby
- PHP
curl 'https://api.santati.io/api/v0/events/?trail=billing' \
-H "Authorization: Api-Key $SANTATI_API_KEY"
import os
import santati
with santati.Santati(os.environ["SANTATI_API_KEY"]) as client:
page = client.events.list(trail="billing")
for event in page.results:
print(event.id, event.event)
import { Santati } from "@santati/node";
const santati = new Santati({ apiKey: process.env.SANTATI_API_KEY! });
const page = await santati.events.list({ trail: "billing" });
for (const event of page.results) {
console.log(event.id, event.event);
}
package main
import (
"context"
"fmt"
"log"
"os"
santati "github.com/jamescarr/santati-sdks/go"
)
func main() {
client, err := santati.NewClient(os.Getenv("SANTATI_API_KEY"))
if err != nil {
log.Fatal(err)
}
page, err := client.Events.List(context.Background(), santati.ListParams{Trail: "billing"})
if err != nil {
log.Fatal(err)
}
for _, event := range page.Results {
fmt.Println(event.Id, event.Event)
}
}
use santati::{ListParams, Santati};
#[tokio::main]
async fn main() -> Result<(), santati::Error> {
let api_key = std::env::var("SANTATI_API_KEY").expect("SANTATI_API_KEY is not set");
let client = Santati::builder(api_key).build()?;
let page = client
.events()
.list(ListParams {
trail: Some("billing".into()),
..Default::default()
})
.await?;
for event in page.results {
println!("{} {}", event.id, event.event);
}
Ok(())
}
{:ok, client} = Santati.new(api_key: System.fetch_env!("SANTATI_API_KEY"))
{:ok, page} = Santati.Events.list(client, trail: "billing")
for event <- page.results do
IO.puts("#{event.id} #{event.event}")
end
require "santati"
client = Santati::Client.new(api_key: ENV.fetch("SANTATI_API_KEY"))
page = client.events.list(trail: "billing")
page.results.each { |event| puts "#{event.id} #{event.event}" }
<?php
require 'vendor/autoload.php';
use Santati\Client;
$client = new Client(apiKey: getenv('SANTATI_API_KEY'));
$page = $client->events->list(['trail' => 'billing']);
foreach ($page->results as $event) {
printf("%s %s\n", $event->getId(), $event->getEvent());
}
List responses are cursor-paginated and carry no total. The SDKs' list returns one page with its results and the next page's cursor; iterate follows the cursors for you (see each SDK's page). The raw response looks like this:
{
"next": null,
"previous": null,
"results": [
{
"id": "01J9Z6K3M4QX8RT2VN5B7HCWDA",
"trail": "billing",
"event": "invoice.voided",
"created_at": "2026-09-29T14:03:11.482000Z",
"received_at": "2026-09-29T14:03:11.913000Z",
"organization_id": "org_acme_logistics",
"actor": {"type": "user", "id": "usr_123", "name": "Valentine Michael Smith", "metadata": {}},
"targets": [{"type": "invoice", "id": "inv_555", "name": "INV-555", "metadata": {}}],
"metadata": {},
"data": {},
"context": {},
"hash": "",
"schema_version": null
}
]
}
See Searching events for the full filter vocabulary, and List events for the reference.
8. See it in the app
Open Audit Log → Events in the app to browse the trail's events, inspect an event's payload, and follow its place in the chain.