Send data

Observations (observe and identify)

Report business facts to a workspace with observe, attach profile traits with identify, and check that each observation was stored and projected.

An observation is a small, typed fact about something in your business: a ticket was escalated, an agent run finished, an order shipped. You send it to a workspace, whose spec declares the entities, events and attributes it understands, and axonpush projects it into entity state, queues, views and alerts. See Workspaces for how a workspace is defined.

Observations are metadata only. Send IDs, states and declared attributes; keep message text, prompts and personal content out. Traces and logs go through OTLP or events instead.

MethodPathScope
POST/workspaces/{workspaceId}/observationsevents:publish
POST/workspaces/{workspaceId}/identifyevents:publish
GET/workspaces/{workspaceId}/observations/{sourceEventId}events:publish or observe:read

Before you start

In the dashboard, open Integrations. Under Send observations you can copy a prompt for your coding agent, which fetches the settings and writes them for you, or expand Set up by hand to see the Workspace id, the Environment, the API base and a Create a publish key button. That key has only events:publish and is shown once.

AXONPUSH_API_KEY=ak_...
AXONPUSH_TENANT_ID=<your organisation id>
AXONPUSH_BASE_URL=https://api.axonpush.xyz
AXONPUSH_ENVIRONMENT=prod
AXONPUSH_WORKSPACE_ID=<workspace id>

Send an observation

The observe, observe_many and identify helpers ship in the next SDK release. The current packages (Python 0.0.19, TypeScript 0.0.12) don’t include them yet, so use the HTTP call until then.

curl -X POST "https://api.axonpush.xyz/workspaces/$AXONPUSH_WORKSPACE_ID/observations" \
-H "X-API-Key: $AXONPUSH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "environment": "prod",
  "observations": [{
    "schema_version": 1,
    "source_event_id": "ticket:t_42:escalated:3",
    "event": "ticket.escalated",
    "occurred_at": "2026-11-18T09:30:00Z",
    "refs": { "ticket": "t_42", "agent": "a_7" },
    "attributes": { "priority": "high" }
  }]
}'

The SDKs fill in schema_version, occurred_at (now) and the current trace ID when there is one, and use the client’s configured environment. Python observe_many and TypeScript observe with an array split long lists into batches of 100 and merge the reports.

The response:

{
  "receipts": [
    { "sourceEventId": "ticket:t_42:escalated:3", "status": "stored",
      "receivedAt": "2026-11-18T09:30:01Z", "projectedAt": null }
  ],
  "dropped": ["internal_note"],
  "dropCount": 1
}

Observation fields

FieldRequiredRules
schema_versionyesMust be 1.
source_event_idyes1 to 160 characters of A-Z a-z 0-9 _ . : -. Your idempotency key.
eventyesStarts with a letter, then up to 119 of A-Z a-z 0-9 _ . -.
occurred_atyesRFC 3339. No more than 5 minutes in the future and no more than 30 days in the past.
refsnoUp to 10 entries of entity type to opaque ID, for example {"ticket": "t_42"}. Same character rules as source_event_id.
attributesnoUp to 100 keys. Only keys the workspace declares are kept; see below.
environmentnoEnvironment slug or ID.
trace_id, span_idnoLinks the fact to a trace.
snapshotnotrue marks reconstructed state, for example a backfill, rather than live activity.
sourceno{"ref": "tickets:42", "revision": 3}: the source record and its monotonic revision.

IDs and refs that look like secrets (bearer tokens, sk_, ak_ or nhr_ style keys, JWTs) are rejected. Any rule violation fails the whole request with 422.

Undeclared attributes are dropped, not rejected

Attribute keys that the workspace spec does not declare are removed before storage, listed in dropped and counted, so you can see them in the workspace and decide whether to declare them. Declared keys are checked against their declared type and size; a mismatch is a 422 naming the attribute. A null value for a declared key is ignored.

Idempotency and retries

source_event_id identifies the fact within one workspace and environment. Sending the same observation again returns the existing receipt and stores nothing new. Sending the same source_event_id with different content is a 409 observation batch rejected: a stored fact is never overwritten.

The SDKs generate a random source_event_id when you do not pass one. That is fine for one-off calls, but a retry from your own code then creates a second fact. Derive source_event_id from your own data (record ID plus transition or revision) whenever a fact can be sent twice.

A 503 that says “observation batch contended” is safe to retry with the same source_event_id values.

Environment

Each request resolves exactly one environment, in this order: the body’s environment, then the first observation that names one, then the credential’s bound environment. All observations in one request must share an environment, or the request is 422. If nothing resolves, the request is 422 environment is required; an unknown environment is 404, and one outside a bound key’s environment is 403.

The SDKs send the client’s environment (AXONPUSH_ENVIRONMENT) on every observation unless you pass one.

Check that it landed

A receipt has two states. stored means axonpush has the observation; projected means it has been applied to the workspace’s entities and views. Projection runs in the background, so a fresh receipt is usually stored.

curl "https://api.axonpush.xyz/workspaces/$AXONPUSH_WORKSPACE_ID/observations/ticket:t_42:escalated:3?environment=prod" \
  -H "X-API-Key: $AXONPUSH_API_KEY"

An observation that refers to an entity which has been erased is acknowledged as projected immediately and is not stored.

Identify: profile traits

identify attaches human-readable traits, such as a display name or plan, to one entity. Only keys listed under that entity’s profile in the workspace spec are kept; the rest come back in dropped. Traits merge with what is stored, and a null value deletes a trait. Use it the way you would use group() for organisation-like entities; Python and TypeScript also expose group as an alias.

client.identify(workspace_id, "agent", "a_7", {"display_name": "Ada"})

The response returns the merged profile. Traits the workspace marks as personal are left out of the response, and masked on reads, unless the caller is an owner or admin or holds profiles:read. Profiles are per workspace entity, not per environment. Identifying an erased entity is 409: its profile cannot be recreated.

Limits

  • Up to 100 observations per request.
  • Stored observations are kept for 30 days from occurred_at.
  • A key bound to an app can only reach workspaces of that app; other workspaces return 404.