API

API introduction

Base URL, auth, scopes, errors, OpenAPI, and pagination.

Audryo’s HTTP API is the same contract the product UI and coding agents use. If a guide and the OpenAPI document disagree, OpenAPI wins.

These docs show curl and JavaScript (`fetch`) in tabs. Generate clients for other languages from GET /v1/openapi (also docs/openapi.yml in-repo).

Base URL

text
{origin}/v1

Local default: http://localhost:3100/v1. Set AUDRYO_API_BASE once and reuse it in every example.

Authentication

HTTP
Authorization: Bearer sf_live_...

Create tokens in Settings → Agent access. Scopes:

ScopeUse when
readInspect contexts, lists, reports
writeSync data, draft audiences / Journeys / emails
deliverConsent, suppressions, activate, campaign/transactional send

Tokens are workspace-bound and never inherit another workspace. Prefer the narrowest scope that completes the job.

Discovery endpoints

EndpointAuthPurpose
GET /v1/agent_manifestnoneOperating model, autonomy, propose vs deliver
GET /v1/openapinoneFull OpenAPI document
GET /v1/bootstrapBearerWorkspaces, projects, session bootstrap
GET /v1/email_iconsnoneIcon libraries the editor and renderer share

Human-readable index: `/llms.txt`.

Resource guides

ResourceGuide
PeopleContacts API
ActivityEvents API
SegmentsAudiences API
AutomationsJourneys API
DocumentsEmails API
One-shot sendsCampaigns API
One-to-one sendsTransactional email

Project setup path

Treat setup context as authoritative for first-run progress:

Foundation → Data → Audience → Opportunity → Journey → Message → Sending → Launch

Do not infer readiness from “a Journey exists.” Read delivery context before activation.

Idempotency

Send Idempotency-Key on LLM proposals, test sends, enrollments, campaign send, and transactional send. Keys are cached per (project, operation, key) for 24 hours.

BehaviorMeaning
First successResponse cached
Same key, doneCached response + Idempotent-Replayed: true
Same key, in flight409 + Retry-After: 2
Random keys each tryDefeats idempotency — derive from your business ids

Details: Best practices.

Pagination

Most collections use a cursor envelope:

JSON
{
  "data": [],
  "page": { "nextCursor": "...", "hasMore": true, "total": 4213 }
}

Pass page[after]=<nextCursor> until hasMore is false. Some list endpoints use an X-Next-Cursor response header instead — follow the OpenAPI entry for that route. Cursors are opaque; don’t parse or invent them.

Errors

Stable envelope on every failure:

JSON
{
  "error": {
    "code": "validation_failed",
    "message": "Human-readable explanation",
    "requestId": "uuid",
    "details": {}
  }
}

Also echoed as X-Request-Id. Switch on code. Include requestId when you contact support or file an issue.

Common flows

GoalStart here
First projectQuickstart
ESP + DNSConnect your ESP
Sync peopleContacts & events
SegmentAudiences
AutomateJourneys
One-shot sendCampaigns
Product-triggered sendTransactional email
Realtime sync / events outWebhooks
Agent loopAgent quickstart