Docs

HTTP API: policies, simulation, audit and encryption keys

Create, check, evaluate and roll back access policies, run and compare simulations, read and verify the audit log, and use your own encryption key.

Updated Nov 25, 2026

Access policies, decision checks, simulations and the audit log over HTTP. The language: Policy language (SPL); how decisions are made: How access is decided.

Base URLhttps://<project-ref>.sovarias.in — your project URL from Connect.
KeysSend the project's key as apikey. Calls made for a signed-in user also send Authorization: Bearer <access token>.
ErrorsA status code and {"detail": …} — a sentence, or {code, message} for errors your code may branch on (HTTP API).

#Access policies

GET/api/v1/policies/

The organization's access policies (for the current environment).

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Returns

policy_idstring
org_idstring
namestring
spl_sourcestring
The rule in SPL (Policy language (SPL)).
versioninteger
+1 on every change.
is_activeboolean
env_idstring | null
The environment it belongs to (null = production).
inheritedboolean
An environment using production's copy.

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/policies/" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
[
  {
    "policy_id": "pol_orders_read",
    "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
    "name": "Signed-in users read orders",
    "spl_source": "ALLOW IF ctx.resource.name == \"orders\" AND ctx.action IN [\"SELECT\", \"sql:select\"] AND ctx.actor.is_anonymous == False",
    "version": 3,
    "is_active": true,
    "env_id": null,
    "inherited": false
  }
]

POST/api/v1/policies/

Create or replace an access policy; it is compiled and active at once.

A rule that doesn't compile is refused with the compiler's message. Changes are recorded in version history and the audit log, and owners and admins are emailed.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Body

policy_idstringrequired
Your id for the policy (letters, digits, _, -); the same id replaces it.
org_idstringrequired
The organization.
namestringrequired
A readable name.
spl_sourcestringrequired
The rule in SPL.

Responses

  • 201Created.
  • 400SPL doesn't compile (the message names the problem).
  • 403Your role can't change policies, or the plan's policy limit.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/policies/" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"policy_id": "pol_orders_read", "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90", "name": "Signed-in users read orders", "spl_source": "ALLOW IF ctx.resource.name == \"orders\" AND ctx.action IN [\"SELECT\", \"sql:select\"] AND ctx.actor.is_anonymous == False"}'
Response
{
  "policy_id": "pol_orders_read",
  "version": 1,
  "status": "compiled"
}

GET/api/v1/policies/{policy_id}

One policy.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

policy_idstringrequired
The policy.

Returns

policy_idstring
org_idstring
namestring
spl_sourcestring
The rule in SPL (Policy language (SPL)).
versioninteger
+1 on every change.
is_activeboolean
env_idstring | null
The environment it belongs to (null = production).
inheritedboolean
An environment using production's copy.

Responses

  • 200Success.
  • 404No such policy.
  • 401No valid session or key.
curl -s "$URL/api/v1/policies/pol_orders_read" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "policy_id": "pol_orders_read",
  "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
  "name": "Signed-in users read orders",
  "spl_source": "ALLOW IF ctx.resource.name == \"orders\" AND ctx.action IN [\"SELECT\", \"sql:select\"] AND ctx.actor.is_anonymous == False",
  "version": 3,
  "is_active": true,
  "env_id": null,
  "inherited": false
}

PUT/api/v1/policies/{policy_id}

Change a policy's name or rule (recompiled at once).

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

policy_idstringrequired
The policy.

Body

namestring | nulloptional
New name.
spl_sourcestringrequired
New rule.

Responses

  • 200Success.
  • 400SPL doesn't compile.
  • 404No such policy.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X PUT "$URL/api/v1/policies/pol_orders_read" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"spl_source": "ALLOW IF ctx.resource.name == \"orders\" AND ctx.action IN [\"SELECT\", \"sql:select\"]"}'
Response
{
  "policy_id": "pol_orders_read",
  "version": 4,
  "status": "recompiled"
}

DELETE/api/v1/policies/{policy_id}

Delete a policy.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

policy_idstringrequired
The policy.

Responses

  • 204Success, with no body.
  • 401No valid session or key.
curl -s -X DELETE "$URL/api/v1/policies/pol_orders_read" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

GET/api/v1/policies/{policy_id}/history

A policy's versions.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

policy_idstringrequired
The policy.

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/policies/pol_orders_read/history" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
[
  {
    "audit_id": "v3",
    "policy_id": "pol_orders_read",
    "actor_user_id": "6e19c0a2-…",
    "action": "UPSERT",
    "new_spl_source": "ALLOW IF ctx.resource.name == \"orders\" AND ctx.action IN [\"SELECT\", \"sql:select\"] AND ctx.actor.is_anonymous == False",
    "version": 3,
    "created_at": "2026-10-17T12:31:08Z"
  }
]

POST/api/v1/policies/{policy_id}/rollback

Restore an earlier version (as a new version).

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

policy_idstringrequired
The policy.

Body

versionintegerrequired
The version to restore.
1.0–…

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/policies/pol_orders_read/rollback" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"version": 2}'
Response
{
  "policy_id": "pol_orders_read",
  "version": 5,
  "restored_from": 2,
  "status": "rolled_back"
}

GET/api/v1/policies/templates

Ready-made rules for common cases, also grouped by category.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Returns

templatesarray<object>
Every template: category, label, name (suggested policy name), spl (the rule) and desc.
categoriesobject
The same templates keyed by category, without category.

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/policies/templates" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "templates": [
    {
      "category": "Basic",
      "label": "Signed-in users can read",
      "name": "Signed-in users can read",
      "spl": "ALLOW IF ctx.actor.is_anonymous == False AND ctx.action == \"SELECT\"",
      "desc": "Signed-in app users can read tables. Writes need another rule."
    }
  ],
  "categories": {
    "Basic": [
      {
        "label": "Signed-in users can read",
        "name": "Signed-in users can read",
        "spl": "ALLOW IF ctx.actor.is_anonymous == False AND ctx.action == \"SELECT\"",
        "desc": "Signed-in app users can read tables. Writes need another rule."
      }
    ]
  }
}

#Checking decisions

POST/api/v1/policies/check

Would this request be allowed? Asks the live rules, writes nothing.

The same decision the gateway makes for real requests (How access is decided). reason names why: ALLOW, DENY, NO_POLICY_DEFINED, DENY_CONTEXT_MISSING, TENANT_SCOPE_REQUIRED…

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.

Body

org_idstringrequired
The organization.
project_idstringoptional
The project.
actionstringrequired
The action: sql:select, doc:read, READ, PUBLISH…
resourcestringrequired
Table, collection, bucket, channel or fn:<name>.
contextobjectoptional
Extra ctx fields the rules read (actor, storage…).
env_idstringoptional
Another environment.

Returns

allowedboolean
reasonstring
Why.
policy_idstring | null
The rule that decided, if one did.

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/policies/check" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90", "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07", "action": "sql:select", "resource": "orders"}'
Response
{
  "allowed": true,
  "reason": "ALLOW",
  "policy_id": "pol_orders_read"
}

POST/api/v1/policies/{policy_id}/evaluate

Evaluate one policy against a context you give.

For debugging one rule. decision is ALLOW or DENY; http_status is what the gateway would answer.

Who
An organization owner or admin.

Path parameters

policy_idstringrequired
The policy.

Body

contextobjectrequired
The ctx object: action, resource, actor, …

Returns

policy_idstringrequired
decisionstringrequired
http_statusintegerrequired
deny_reasonstringoptional
retry_after_msintegeroptionaldefault 0
latency_usnumberoptionaldefault 0.0
ip_independentbooleanoptionaldefault false

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/policies/pol_orders_read/evaluate" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"context": {"action": "SELECT", "resource": {"name": "orders"}, "actor": {"is_anonymous": true}}}'
Response
{
  "policy_id": "pol_orders_read",
  "decision": "DENY",
  "http_status": 403,
  "deny_reason": "NO_MATCH",
  "retry_after_ms": 0,
  "latency_us": 41.2
}

POST/api/v1/policies/simulate

Decide many requests at once, optionally with draft rules in place of live ones. Nothing is written.

What sov rules test uses (Access rules tests). A draft whose replaces names a live policy stands in for it; other drafts are added. Up to 50 drafts. Each call uses one policy simulation from the monthly allowance (guard.simulations_month).

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Body

org_idstringrequired
The organization.
project_idstringoptional
The project.
operationsarray<object>required
Requests: {action, resource, context}. Up to 500.
3 fields
actionstringrequired
resourcestringrequired
contextobjectoptional
draft_policiesarray<object>optional
{policy_id, spl_source, replaces}.
0–50 items
3 fields
policy_idstringoptionaldefault draft
0–128 characters
spl_sourcestringrequired
1–20,000 characters
replacesstring | nulloptional
Live policy this draft stands in for
0–128 characters
disabled_policy_idsarray<string>optional
Live policies to leave out.
0–50 items
env_idstringoptional
Another environment.
explainbooleanoptionaldefault false

Returns

resultsarray<object>required
9 fields
op_indexintegerrequired
actionstringrequired
resourcestringrequired
decisionstringrequired
policy_idstring | nulloptional
reasonstringrequired
effective_decisionstring | nulloptional
row_securityobject | nulloptional
explanationarray<object> | nulloptional

Responses

  • 200Success.
  • 403PLAN_QUOTA_EXHAUSTED — the month's simulations are used up.
  • 422A draft doesn't compile (Draft policy … does not compile), or LIMIT_TOO_LARGE: more than 500 operations.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/policies/simulate" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90", "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07", "operations": [{"action": "sql:select", "resource": "orders", "context": {"actor": {"is_anonymous": true, "roles": [], "lane": "product"}}}, {"action": "sql:select", "resource": "orders", "context": {"actor": {"user_id": "u_123", "is_anonymous": false, "roles": [], "lane": "product"}}}]}'
Response
{
  "results": [
    {
      "op_index": 0,
      "action": "sql:select",
      "resource": "orders",
      "decision": "DENY",
      "policy_id": null,
      "reason": "NO_POLICY_DEFINED"
    },
    {
      "op_index": 1,
      "action": "sql:select",
      "resource": "orders",
      "decision": "ALLOW",
      "policy_id": "pol_orders_read",
      "reason": "ALLOW"
    }
  ]
}

POST/api/v1/policies/simulate/batch

The same as simulate for larger batches (used by the console).

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Body

org_idstringrequired
The organization.
project_idstringoptional
The project.
operationsarray<object>required
Requests.
3 fields
actionstringrequired
resourcestringrequired
contextobjectoptional
draft_policiesarray<object>optional
Drafts.
0–50 items
3 fields
policy_idstringoptionaldefault draft
0–128 characters
spl_sourcestringrequired
1–20,000 characters
replacesstring | nulloptional
Live policy this draft stands in for
0–128 characters
disabled_policy_idsarray<string>optional
Left out.
0–50 items
env_idstringoptional
Environment.
explainbooleanoptionaldefault false

Returns

resultsarray<object>required
9 fields
op_indexintegerrequired
actionstringrequired
resourcestringrequired
decisionstringrequired
policy_idstring | nulloptional
reasonstringrequired
effective_decisionstring | nulloptional
row_securityobject | nulloptional
explanationarray<object> | nulloptional

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/policies/simulate/batch" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90", "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07", "operations": [{"action": "doc:write", "resource": "carts", "context": {}}]}'
Response
{
  "results": [
    {
      "op_index": 0,
      "action": "doc:write",
      "resource": "carts",
      "decision": "DENY",
      "policy_id": null,
      "reason": "NO_POLICY_DEFINED"
    }
  ]
}

GET/api/v1/policies/security-advisor-scan

Scan the project's rules for risks: tables without policies, rules that let anyone in, public writes.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Returns

findingsarray<object>
Each with severity (critical, warning, info), category, title, detail, where to fix it, and the policy, table or bucket concerned (Security advisor).

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/policies/security-advisor-scan" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "source": "guard",
  "scanned_at": "2026-10-17T13:30:00Z",
  "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
  "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
  "findings": [
    {
      "id": "table_no_policy:invoices",
      "severity": "critical",
      "category": "access",
      "title": "Table has no access policies",
      "detail": "No rule covers `invoices`; app users are refused unless it has forced row-level security.",
      "fix_target": "policies",
      "policy_id": null,
      "table": "invoices",
      "bucket": null
    }
  ],
  "warnings": [],
  "metadata": {}
}

#Simulation

Who may: simulation.read to see runs, simulation.run to start discovery, runs, change previews and plans (owners, admins and developers have both; viewers read). Answers are redacted by what you may read: without policies.read no rule source, without auth.read no user ids, without settings.manage only on/off settings. Every request needs X-Sovaria-Project-ID. Guide: Simulate access before you ship.

POST/api/v1/sim/run

Run a full access simulation: every kind of user against every resource. Nothing is written.

Sends every request each user type could make through the real gateway as signed simulation probes; SQL writes run with every check and are rolled back, other writes stop after their access checks. Pass the manifest_id from discover to skip discovery (kept for an hour; an unknown or expired id is discovered again). A full run uses one real run from today and one from this month (both or neither; a failed run gives them back), runs one at a time per organization, and is stopped at the run deadline (10 minutes by default). With background: true it answers 202 with {run_id, status: "running"} at once — poll GET /api/v1/sim/runs/{run_id} until status is complete or failed; without it the request waits and returns the finished run (200). A filter that narrows the run to at most 25 request types is a single-request check: it always waits, uses one run from today per 5 checks, isn't kept in history, and is limited to 30 a minute per organization; a wider filter is charged as a full run (charged: true). A run over 2,000 request types is cut deterministically and says so (truncated, notice). The SDKs start a background run and poll for you.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Body

manifest_idstringoptional
The manifest_id from discover. Manifest content is never accepted.
filterobjectoptional
{resource, action, role} — any of them, no other keys; role is __guest__, __app_user__, app:<role> or a team role.
backgroundbooleanoptional
Return at once and run in the background (full runs).

Responses

  • 202Accepted — the work continues in the background.
  • 400SIMULATION_FILTER_INVALID (unknown filter keys), SIMULATION_MANIFEST_NOT_ACCEPTED (a manifest object was sent), or PROJECT_REQUIRED.
  • 403PLAN_LIMIT_REACHED (guard.simulations_day or guard.simulations_month: today's or this month's real runs are used; resets_at says when more come), ORG_PERMISSION_REQUIRED (simulation.run), or SIMULATION_MANIFEST_SCOPE (the manifest belongs to another project or environment).
  • 409SIMULATION_RUN_IN_PROGRESS with the running run_id: one full run at a time per organization.
  • 429SIMULATION_RATE_LIMITED: too many single-request checks this minute.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/sim/run" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"manifest_id": "man_3b…", "background": true}'
Response
{
  "run_id": "run_7c2e…",
  "status": "running",
  "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
  "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
  "env_id": null
}

GET/api/v1/sim/quota

Real simulation runs used and allowed today and this month.

Reading it uses nothing. The day resets at midnight UTC (guard.simulations_day), the month with the billing period (guard.simulations_month). A real run uses one of each; a failed run gives both back; single-request checks use one from the day per partial_units_per_run checks.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Responses

  • 200Success.
  • 403ORG_PERMISSION_REQUIRED (simulation.read).
  • 503QUOTA_UNAVAILABLE: the allowance can't be read right now.
  • 401No valid session or key.
curl -s "$URL/api/v1/sim/quota" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "day": {
    "used": 1,
    "limit": 2,
    "resets_at": "2026-10-22T00:00:00+00:00"
  },
  "month": {
    "used": 3,
    "limit": 5,
    "resets_at": "2026-11-03T10:00:00+00:00"
  },
  "partial_units_per_run": 5
}

GET/api/v1/sim/topology

Everything the Simulation 2.0 tabs draw about the project.

Who calls the project (visitors, signed-in users, app roles, team roles, bots, webhook senders, mobile apps, your server, Sovariq, the CLI), the gateway's checks (your own in plain words; Sovaria's defences as one Platform protection node), how people sign in, the resources, the connectors (with flows and outcomes, no secrets) and the settings review. Runs a fresh discovery, paced like discover (20 a minute per organization). Redacted by what you may read.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Responses

  • 200Success.
  • 403ORG_PERMISSION_REQUIRED (simulation.read) or SIMULATION_DISABLED (turned off for the organization).
  • 429SIMULATION_RATE_LIMITED: too many discoveries this minute.
  • 401No valid session or key.
curl -s "$URL/api/v1/sim/topology" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "project": {
    "id": "8cab1cf9-…",
    "name": "Storefront",
    "plan": "pro"
  },
  "callers": [
    {
      "id": "__guest__",
      "label": "Visitor (not signed in)",
      "kind": "guest"
    }
  ],
  "gateway": {
    "checks": [
      {
        "id": "project_rate",
        "label": "Project rate limit",
        "detail": "120 requests/min per IP"
      },
      {
        "id": "platform",
        "label": "Platform protection"
      }
    ]
  },
  "identity": {
    "providers": [
      "Email and password",
      "Google"
    ],
    "mfa": true,
    "passkeys": false,
    "captcha": false,
    "sessions": {
      "timeoutMin": 0,
      "inactivityMin": 0,
      "singleSession": false
    }
  },
  "resources": {
    "tables": [
      "orders"
    ],
    "collections": [],
    "functions": [
      "stripe-webhook"
    ],
    "buckets": [
      "invoices"
    ],
    "channels": []
  },
  "integrations": [
    {
      "id": "smtp",
      "kind": "smtp",
      "name": "Sovaria email",
      "vendor": "Email",
      "configured": true,
      "lastError": null,
      "flows": [
        {
          "id": "password_reset",
          "label": "Password reset"
        }
      ],
      "outcomes": [
        "ok",
        "slow",
        "down",
        "limit",
        "creds",
        "ours"
      ]
    }
  ],
  "settingsReview": []
}

GET/api/v1/sim/limits

Every limit the project lives under.

Sign-in, email and SMS limits (keyed per IP, account, address or number), API rates, plan data budgets, file size and types per bucket, each function's time, memory, body and call limits, realtime limits, the database pool and longest query, allowed origins and the password rule — each with its value, unit, what it is counted per (keyed_by) and how (method). Free; sends nothing.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Responses

  • 200Success.
  • 403ORG_PERMISSION_REQUIRED (simulation.read) or SIMULATION_DISABLED.
  • 401No valid session or key.
curl -s "$URL/api/v1/sim/limits" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "limits": [
    {
      "label": "Sign-ins per 5 minutes",
      "setting": "signInsPer5Min",
      "value": 30,
      "unit": "per 5 min",
      "keyed_by": "ip",
      "method": "fixed window",
      "kind": "rate"
    }
  ]
}

POST/api/v1/sim/integrations/run

Run one integration flow under a programmed outcome.

modelled (default) answers from your configuration: deterministic, free, nothing is built or sent. sealed runs the real code path (your template, settings and signatures) to the send point, records what would have gone out and answers with the outcome — still sending nothing; it uses one single-request check from today's allowance. Connectors that aren't connected, or have no sealed path yet (AI, MCP, KMS, Stripe), answer modelled with a note.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Body

connector_idstringrequired
flow_idstringrequired
outcomestringoptional
modestringoptional

Responses

  • 200Success.
  • 400SIMULATION_INTEGRATION_INVALID (unknown connector, flow or outcome) or SIMULATION_MODE_INVALID.
  • 403ORG_PERMISSION_REQUIRED (simulation.run), SIMULATION_DISABLED, or PLAN_LIMIT_REACHED (sealed, no allowance left).
  • 429SIMULATION_RATE_LIMITED (sealed runs are paced like single-request checks).
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/sim/integrations/run" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "connector_id": "smtp",
  "flow_id": "password_reset",
  "outcome": "creds",
  "mode": "modelled",
  "steps": [
    {
      "lane": "app",
      "text": "A user signs up / asks for a link",
      "tone": "on"
    },
    {
      "lane": "sovaria",
      "text": "Sovaria renders your email template and hands it to the sender",
      "tone": "on"
    },
    {
      "lane": "dummy",
      "text": "Email sender (dummy): Refuses the username or password",
      "tone": "bad"
    },
    {
      "lane": "sovaria",
      "text": "Reports 'check your SMTP settings'",
      "tone": "bad"
    }
  ],
  "user_sees": "No email at all until the SMTP password is fixed.",
  "verdict": "bad",
  "lesson_key": "sim.integrations.smtp.creds",
  "artifact": {
    "id": "",
    "kind": "smtp",
    "target_host": "Email",
    "outcome": "creds",
    "created_at": "",
    "preview": {
      "note": "Modelled from your settings: nothing was built or sent."
    }
  }
}

POST/api/v1/sim/drills/run

Judge the 14 security drills from the project's configuration.

Each drill is stopped (with where), partial or exposed, with why and the setting that fixes it; attacks Sovaria blocks itself say only Blocked by platform protection. The score is (stopped + ½ partial) ÷ total × 100. overrides is a what-if draft (captchaProtection, leakedPasswordCheck, preventEnumeration, rateLimits, allowedOrigins, redirectUrls, rlsTables, bucketPublic, statementTimeoutMs, functionMaxAttempts, customSmtp) applied to this answer only and never saved; real_score and shield always come from the saved settings. Free; nothing is sent.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Body

drill_idsstring[]optional
overridesobjectoptional

Responses

  • 200Success.
  • 400SIMULATION_DRILL_INVALID or SIMULATION_OVERRIDES_INVALID.
  • 403ORG_PERMISSION_REQUIRED (simulation.run) or SIMULATION_DISABLED.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/sim/drills/run" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "results": [
    {
      "id": "stuff",
      "group": "Accounts",
      "name": "Credential stuffing from a botnet",
      "verdict": "exposed",
      "stopped_at": null,
      "why": "A botnet trying leaked passwords stays under the per-IP limits; nothing else stops it.",
      "fix": {
        "setting_path": "authConfig.attack.leakedPasswordCheck",
        "label": "Turn on the leaked-password check or CAPTCHA",
        "console_link": "auth/attack-protection"
      }
    }
  ],
  "score": 71,
  "real_score": 71,
  "shield": false,
  "overrides_applied": {},
  "mode": "modelled"
}

GET/api/v1/sim/intended

Outcomes the team marked as intended for this project.

A mark says a user type doing an action on a resource is meant to get that outcome (for example visitors may read public.products). Every run is returned with matching cases marked intended (green, counted in cases_pass, left out of top_findings), on new runs and on old ones when they are opened again; cases_intended counts them. A mark only matches the outcome it names. Up to 500 marks per project.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Responses

  • 200Success.
  • 403ORG_PERMISSION_REQUIRED (simulation.read).
  • 401No valid session or key.
curl -s "$URL/api/v1/sim/intended" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "intended": [
    {
      "mark_id": "6f1c2a9d0b7e4c5a8e3f2d1c0b9a8e7f",
      "role": "__guest__",
      "action": "sql:select",
      "resource": "public.products",
      "outcome": "ALLOW",
      "note": "The product catalogue is public",
      "marked_by": "2c1f6b8a-4d3e-4f5a-9b8c-7d6e5f4a3b2c",
      "marked_at": 1792531200.0
    }
  ]
}

POST/api/v1/sim/intended

Mark an outcome as intended.

Needs policies.write (it changes what the team sees as a problem) and is recorded in the organization's audit log. Marking the same role, action and resource again replaces the outcome and note. role is __guest__, __app_user__, app:<role> or a team role, as in a run's cases.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Body

rolestringrequired
actionstringrequired
resourcestringrequired
outcomestringrequired
notestringoptional

Responses

  • 200Success.
  • 400INVALID_INTENDED_OUTCOME: a field is missing or too long, or outcome isn't ALLOW or DENY; or the project already has 500 marks.
  • 403ORG_PERMISSION_REQUIRED / PERMISSION_DENIED (policies.write).
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/sim/intended" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "mark_id": "6f1c2a9d0b7e4c5a8e3f2d1c0b9a8e7f",
  "role": "__guest__",
  "action": "sql:select",
  "resource": "public.products",
  "outcome": "ALLOW",
  "note": "The product catalogue is public",
  "marked_by": "2c1f6b8a-4d3e-4f5a-9b8c-7d6e5f4a3b2c",
  "marked_at": 1792531200.0
}

DELETE/api/v1/sim/intended/{mark_id}

Remove an intended-outcome mark.

Matching cases show as measured again on every run. Needs policies.write; recorded in the audit log.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

mark_idstringrequired

Responses

  • 200Success.
  • 403ORG_PERMISSION_REQUIRED / PERMISSION_DENIED (policies.write).
  • 404NOT_FOUND: no such mark in this project.
  • 401No valid session or key.
curl -s -X DELETE "$URL/api/v1/sim/intended/<mark_id>" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "removed": true,
  "mark_id": "6f1c2a9d0b7e4c5a8e3f2d1c0b9a8e7f"
}

GET/api/v1/sim/runs

The project's simulation runs, newest first (summaries).

Runs older than your plan keeps them (guard.simulation_retention_days: 30 days on Free, 90 on paid plans) are deleted, and each project keeps its newest 100. The console reads 20 at a time. While no run is in progress the answer carries an ETag (304 when unchanged).

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Query parameters

limitintegeroptionaldefault 50
1–100 (default 50).
1–100
offsetintegeroptionaldefault 0
Skip this many (default 0).
0–10000

Responses

  • 200Success.
  • 400PROJECT_REQUIRED: send X-Sovaria-Project-ID.
  • 403ORG_PERMISSION_REQUIRED (simulation.read).
  • 401No valid session or key.
curl -s "$URL/api/v1/sim/runs" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "runs": [
    {
      "run_id": "run_7c2e…",
      "status": "complete",
      "started_at": "2026-10-17T13:31:02Z",
      "cases_total": 214,
      "cases_fail": 2
    }
  ],
  "total": 1,
  "limit": 50,
  "offset": 0
}

GET/api/v1/sim/runs/{run_id}

One run with every case's result.

While it runs, status is running. A run stopped at the deadline answers status: failed with failure_reason: "deadline"; one interrupted by a restart, failure_reason: "interrupted". History keeps no rule source or user ids. A single-request check (partial: true) isn't in the history but loads here by its run_id for an hour (kept_until). A finished run carries an ETag (Cache-Control: private, no-cache): send it back in If-None-Match and an unchanged run answers 304 with no body.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

run_idstringrequired
The run.

Query parameters

viewstringoptionaldefault full
full (default) or compact: each layer's checks list is left out and checks_count says how many there were; compact: true marks it. Open one request's full trace with GET /api/v1/sim/runs/{run_id}/cases/{case_id}.
pattern `^(full|compact)$`

Responses

  • 200Success.
  • 400PROJECT_REQUIRED.
  • 404SIMULATION_RUN_NOT_FOUND: no such run in this project (pruned from the history, a single-request check older than an hour, or another project's run); message says what to do.
  • 401No valid session or key.
curl -s "$URL/api/v1/sim/runs/run_7c2e…" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "run_id": "run_7c2e…",
  "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
  "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
  "status": "complete",
  "started_at": "2026-10-17T13:31:02Z",
  "completed_at": "2026-10-17T13:31:40Z",
  "cases_total": 214,
  "cases_pass": 209,
  "cases_fail": 2,
  "cases_warn": 3,
  "cases_deviation": 2,
  "top_findings": [
    {
      "severity": "critical",
      "category": "access_control",
      "title": "2 request(s) get through that your rules deny",
      "detail": "…",
      "fix": "…"
    }
  ],
  "results": [
    {
      "case": {
        "role": "__guest__",
        "action": "sql:select",
        "resource": "orders",
        "expected": "DENY"
      },
      "outcome": "ALLOW",
      "is_deviation": true,
      "deviation_type": "UNEXPECTED_ALLOW",
      "guard_decision": "DENY",
      "duration_ms": 38.5
    }
  ],
  "runner_ms": 38210.0
}

GET/api/v1/sim/runs/{run_id}/artifacts

What a run's sealed send points would have sent.

A simulation never sends anything outside Sovaria: each email, SMS, push, hook, webhook, channel message, log-drain batch, function's outbound call, AI model call or KMS use is recorded here instead, with the connector kind, the destination host, the programmed outcome and a preview. Secrets are replaced by •••• and recipients are masked; message bodies are shown only to members with settings.manage. Up to 500 per run, deleted with the run.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

run_idstringrequired

Responses

  • 200Success.
  • 403ORG_PERMISSION_REQUIRED (simulation.read).
  • 404No such run in this project.
  • 401No valid session or key.
curl -s "$URL/api/v1/sim/runs/<run-id>/artifacts" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "run_id": "7c1d…",
  "artifacts": [
    {
      "id": "9f2e1c0a…",
      "run_id": "7c1d…",
      "kind": "smtp",
      "target_host": "email.amazonaws.com",
      "outcome": "ok",
      "persona": "__guest__",
      "preview": {
        "to": "a***@example.com",
        "subject": "Confirm your email",
        "body": "(hidden: needs Project settings)"
      },
      "created_at": 1792531200.0
    }
  ]
}

GET/api/v1/sim/runs/{target_run_id}/compare/{baseline_run_id}

What changed between two runs: cases that got riskier (regressions) or safer (improvements).

Cases are matched by user type, action, resource and endpoint. severity is 0 (fine), 2 (a gap or deviation) or 3 (a failure or unexpected allow/deny). Up to 25 of each list.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

target_run_idstringrequired
The newer run.
baseline_run_idstringrequired
The run to compare with.

Responses

  • 200Success.
  • 404Either run doesn't exist in this project.
  • 401No valid session or key.
curl -s "$URL/api/v1/sim/runs/run_7c2e…/compare/run_41a…" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "baseline_run_id": "run_41a…",
  "target_run_id": "run_7c2e…",
  "summary": {
    "regressions": 1,
    "improvements": 3,
    "unchanged": 210,
    "new_cases": 4,
    "removed_cases": 0,
    "new_failures": 1,
    "resolved_failures": 3
  },
  "regressions": [
    {
      "case_key": "__guest__|sql:select|orders|",
      "role": "__guest__",
      "action": "sql:select",
      "resource": "orders",
      "endpoint": "",
      "baseline": {
        "outcome": "DENY",
        "is_deviation": false,
        "deviation_type": "NONE",
        "severity": 0
      },
      "target": {
        "outcome": "ALLOW",
        "is_deviation": true,
        "deviation_type": "UNEXPECTED_ALLOW",
        "severity": 3
      }
    }
  ],
  "improvements": []
}

POST/api/v1/sim/discover

What a simulation would test: user types, resources and rules (the run's manifest).

What the run will test. Kept for an hour on Sovaria's side: pass its manifest_id to run. Redacted by what you may read (rule source needs policies.read, user ids auth.read, setting values settings.manage). Limited to 20 a minute per organization (with plan).

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Responses

  • 200Success.
  • 400PROJECT_REQUIRED.
  • 403ORG_PERMISSION_REQUIRED (simulation.run).
  • 429SIMULATION_RATE_LIMITED.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/sim/discover" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "manifest_id": "man_3b…",
  "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
  "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
  "env_id": null,
  "discovered_at": "2026-10-17T13:30:58Z",
  "roles": [
    "OWNER",
    "ADMIN",
    "MEMBER",
    "VIEWER"
  ],
  "app_personas": [
    {
      "persona": "app:staff",
      "users": 3,
      "roles": [
        "staff"
      ],
      "has_public_key": true
    }
  ],
  "user_count_by_role": {
    "MEMBER": 2
  },
  "role_subjects": {},
  "functions": [
    {
      "name": "send-receipt",
      "method": "POST",
      "invoke_permission": "authenticated",
      "runtime": "python3",
      "description": ""
    }
  ],
  "policies": [
    {
      "policy_id": "pol_orders_read",
      "name": "Signed-in users read orders",
      "is_active": true,
      "spl_source": "ALLOW IF ctx.resource.name == \"orders\" AND ctx.action IN [\"SELECT\", \"sql:select\"] AND ctx.actor.is_anonymous == False",
      "conditions": []
    }
  ],
  "collections": [
    "carts"
  ],
  "tables": [
    {
      "name": "orders",
      "schema": "public",
      "table": "orders",
      "kind": "table",
      "rls_enabled": true,
      "rls_forced": false,
      "columns": [
        {
          "name": "id",
          "type": "bigint"
        }
      ],
      "rls_policies": [],
      "security_invoker": false
    }
  ],
  "buckets": [
    "avatars"
  ],
  "bucket_details": [
    {
      "name": "avatars",
      "public": false
    }
  ],
  "settings": {
    "allowPublicSignup": true
  },
  "channels": [
    "room-42"
  ],
  "discovery_ms": 812.4
}

POST/api/v1/sim/change

Try a change before making it: who gains or loses access, or what an SQL script would do. Nothing is written.

kind: policy decides every user type × resource × action with the live rules and again with your change, and lists what differs; visitors gaining write access is critical, users losing access they have today is a warning. kind: sql runs the script in a rolled-back transaction with every check and lists what it would change. Each call uses one simulation from the monthly allowance (Simulate access before you ship).

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Body

kindstringrequired
One of policy, sql
policyobjectoptional
For policy: the new or replacement rule.
3 fields
spl_sourcestringrequired
The rule.
namestringoptional
Its name.
replacesstringoptional
The live policy id it stands in for; without it the rule is added.
policiesarray<object>optional
Several rules at once, each like policy (up to 50).
disable_policy_idsarray<string>optional
Live policies to leave out.
sqlstringoptional
For sql: the script.
manifest_idstringoptional
Reuse a manifest from discover (policy changes).

Returns

changesarray<object>
Each request type whose decision changes: persona, who, action, resource, before/after (ALLOW/DENY), the deciding policies, and row_policies_still_apply (row-level security still filters rows).
violationsarray<object>
Changes worth stopping for, with severity and reason.
summaryobject
gains, losses, violations counts.
impactarray<string>
The same in plain sentences.

Responses

  • 200Success.
  • 400kind isn't policy or sql, no project header, nothing to try, or more than 50 rules.
  • 422The rule doesn't compile.
  • 403PLAN_QUOTA_EXHAUSTED — this month's simulations are used.
  • 503The policy engine is unavailable; nothing was changed.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/sim/change" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"kind": "policy", "policy": {"spl_source": "ALLOW IF ctx.resource.name == \"orders\"", "replaces": "pol_orders_read"}}'
Response
{
  "kind": "policy",
  "nothing_written": true,
  "cases_checked": 48,
  "changes": [
    {
      "persona": "__guest__",
      "who": "Visitors who aren't signed in",
      "action": "sql:insert",
      "resource": "orders",
      "before": "DENY",
      "after": "ALLOW",
      "before_policy": null,
      "after_policy": "pol_orders_read",
      "row_policies_still_apply": true
    }
  ],
  "violations": [
    {
      "persona": "__guest__",
      "who": "Visitors who aren't signed in",
      "action": "sql:insert",
      "resource": "orders",
      "before": "DENY",
      "after": "ALLOW",
      "before_policy": null,
      "after_policy": "pol_orders_read",
      "row_policies_still_apply": true,
      "severity": "critical",
      "reason": "Visitors who aren't signed in could change data"
    }
  ],
  "summary": {
    "gains": 1,
    "losses": 0,
    "violations": 1
  },
  "impact": [
    "1 request type(s) newly allowed",
    "0 request type(s) newly denied",
    "Visitors who aren't signed in could change data: sql:insert on orders"
  ]
}

POST/api/v1/sim/plan

Trace given requests through every layer without running them (the console's request explorer).

Nothing is sent. Shares the discovery limit (20 a minute per organization).

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Body

operationsarray<object>required
Requests to trace: {op, key, endpoint?, function?, policy?}.
echo_flagbooleanoptionaldefault true
Ignored; kept so older clients still validate (a plan never runs anything)
simulation_namestringoptionaldefault default-simulation
A label.
actor_ctxobjectoptional
Who sends them.
client_endpointsarray<object>optional
7 fields
endpointstringrequired
Gateway route path, e.g. /api/v1/data/rel/query
methodstringoptionaldefault POST
HTTP method
servicestringoptionaldefault auto
Target engine/service label
functionsarray<string>optional
data_policiesarray<string>optional
test_casesarray<string>optional
metadataobjectoptional
data_policiesarray<string>optional
functionsarray<string>optional
include_execution_treebooleanoptionaldefault true
Return the layer-by-layer tree.

Returns

simulation_namestringoptionaldefault default-simulation
resultsarray<object>optional
10 fields
opstringrequired
keystringrequired
successbooleanoptionaldefault true
datastring | nulloptional
errorstring | nulloptional
endpointstring | nulloptional
functionstring | nulloptional
policystring | nulloptional
duration_msnumberoptionaldefault 0.0
breakpointsarray<object>optional
8 fields
stagestringrequired
Pipeline stage: auth | policy | schema | function | data | side_effect
node_idstringoptional
References the pipeline DAG node
error_codestringrequired
Machine-readable error code: POLICY_DENY | SCHEMA_MISMATCH | FUNCTION_NOT_FOUND | AUTH_FAILED | CONSTRAINT_VIOLATION | ENDPOINT_NOT_FOUND
error_detailstringrequired
Human-readable description of what failed
fix_hintstringoptional
Actionable suggestion for the user
affected_resourcestringoptional
The specific resource that caused the failure (policy name, field, function)
severitystringoptionaldefault error
error | warning | info
op_indexintegeroptionaldefault 0
Which operation in the simulation triggered this
phantom_pages_allocatedintegeroptionaldefault 0
real_tree_touchedbooleanoptionaldefault false
execution_treearray<object>optional
Serialised execution tree nodes (dict form to avoid recursive model issues)
breakpointsarray<object>optional
All breakpoints across all operations, aggregated for top-level display
8 fields
stagestringrequired
Pipeline stage: auth | policy | schema | function | data | side_effect
node_idstringoptional
References the pipeline DAG node
error_codestringrequired
Machine-readable error code: POLICY_DENY | SCHEMA_MISMATCH | FUNCTION_NOT_FOUND | AUTH_FAILED | CONSTRAINT_VIOLATION | ENDPOINT_NOT_FOUND
error_detailstringrequired
Human-readable description of what failed
fix_hintstringoptional
Actionable suggestion for the user
affected_resourcestringoptional
The specific resource that caused the failure (policy name, field, function)
severitystringoptionaldefault error
error | warning | info
op_indexintegeroptionaldefault 0
Which operation in the simulation triggered this
summaryobjectoptional

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/sim/plan" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

#Baseline policy

POST/api/v1/policies/orgs/{org_id}/ensure-baseline

Give the organization a baseline policy if it has no active one.

Sovaria does this when an organization or project is created, so you rarely need it. With an active policy already there, nothing changes.

Who
An organization owner or admin (for their own organization).

Path parameters

org_idstringrequired
Your organization.

Responses

  • 200Success.
  • 403Another organization, or your role can't change policies.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/policies/orgs/b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90/ensure-baseline" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "status": "exists",
  "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
  "policy_count": 6,
  "policy_id": "pol_orders_read"
}

#Your own encryption key

Enterprise (security.byok): storage files, database backups and pause archives encrypted under an AWS KMS key in your account. Reading the status and checking the key: organization owners and admins; changing it: owners. Console only — app users and API keys get 403. Guide: Your own encryption key (BYOK).

GET/api/v1/byok

Whether the organization uses its own key, what it covers, and how to set one up.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Returns

enabledboolean
A key is in use.
versioninteger
The active data-key version; older versions stay to read older backups.
key_usableboolean | null
Whether the last check could unwrap the data key with your key.
last_errorstring | null
<CODE>: <message> from the last failed check, e.g. KEY_DISABLED: ….
storage_reencryptobject | null
Progress of a re-encryption: status (running, done, done_with_errors, failed), rewritten, skipped, failed.
availableboolean
The plan includes it.
setupobject
Sovaria's AWS principal and the exact key-policy statement to add: Sovaria may use the key only with your organization's encryption context.

Responses

  • 200Success.
  • 403{"code": "FORBIDDEN", "message": "Only organization owners and admins can do this"} — and every app-user or API-key caller.
  • 401No valid session or key.
curl -s "$URL/api/v1/byok" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "enabled": true,
  "provider": "aws-kms",
  "key_ref": "arn:aws:kms:ap-south-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
  "version": 2,
  "versions": [
    {
      "version": 2,
      "status": "active",
      "key_ref": "arn:aws:kms:ap-south-1:111122223333:key/1234abcd-…",
      "created_at": 1792310400.0,
      "created_by": "6e19c0a2-…"
    },
    {
      "version": 1,
      "status": "retired",
      "key_ref": "arn:aws:kms:ap-south-1:111122223333:key/1234abcd-…",
      "created_at": 1792224000.0,
      "created_by": "6e19c0a2-…"
    }
  ],
  "last_check_at": 1792310460.5,
  "key_usable": true,
  "last_error": null,
  "storage_reencrypt": null,
  "available": true,
  "coverage": [
    {
      "what": "Storage files",
      "covered": true,
      "how": "Written with S3 SSE-KMS under your key; …"
    },
    {
      "what": "Database backups and pause archives",
      "covered": true,
      "how": "AES-256-GCM with your organization's data key, …"
    },
    {
      "what": "Database files of your Postgres",
      "covered": false,
      "how": "Encrypted at rest by the server's disk encryption …"
    }
  ],
  "setup": {
    "provider": "aws-kms",
    "principal_arn": "arn:aws:iam::444455556666:role/sovaria-core",
    "encryption_context": {
      "sovaria:org_id": "org_8f2c…"
    },
    "key_policy_statement": {
      "Sid": "SovariaOrg8f2c…",
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::444455556666:role/sovaria-core"
      },
      "Action": [
        "kms:Encrypt",
        "kms:Decrypt",
        "kms:GenerateDataKey"
      ],
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "kms:EncryptionContext:sovaria:org_id": "org_8f2c…"
        }
      }
    },
    "requirements": [
      "A symmetric KMS key (key spec SYMMETRIC_DEFAULT, usage ENCRYPT_DECRYPT), in any region.",
      "…"
    ]
  }
}

PUT/api/v1/byok

Use a KMS key from now on: checked end to end first (wrap and unwrap a data key, and a storage write and read under the key); nothing changes if any step fails.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Body

providerstringoptionaldefault aws-kms
aws-kms.
One of aws-kms, local
key_refstringrequired
The key's full ARN (not an alias).
3–300 characters

Returns

enabledboolean
A key is in use.
versioninteger
The active data-key version; older versions stay to read older backups.
key_usableboolean | null
Whether the last check could unwrap the data key with your key.
last_errorstring | null
<CODE>: <message> from the last failed check, e.g. KEY_DISABLED: ….
storage_reencryptobject | null
Progress of a re-encryption: status (running, done, done_with_errors, failed), rewritten, skipped, failed.

Responses

  • 200Success.
  • 403{"code": "FORBIDDEN", "message": "Only organization owners can do this"} — and every app-user or API-key caller.
  • 403PLAN_FEATURE_UNAVAILABLE — the plan doesn't include your own key (security.byok).
  • 422KEY_REF_INVALID (not a key ARN), KEY_TYPE_UNSUPPORTED (not symmetric), PROVIDER_UNSUPPORTED.
  • 403KEY_DISABLED, KEY_UNAVAILABLE, KEY_ACCESS_DENIED (the key policy doesn't allow Sovaria's role with your context) or STORAGE_KEY_DENIED.
  • 404KEY_NOT_FOUND.
  • 503KMS_UNREACHABLE or BYOK_STORE_UNAVAILABLE — try again.
  • 401No valid session or key.
curl -s -X PUT "$URL/api/v1/byok" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"provider": "aws-kms", "key_ref": "arn:aws:kms:ap-south-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"}'
Response
{
  "enabled": true,
  "provider": "aws-kms",
  "key_ref": "arn:aws:kms:ap-south-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
  "version": 2,
  "versions": [
    {
      "version": 2,
      "status": "active",
      "key_ref": "arn:aws:kms:ap-south-1:111122223333:key/1234abcd-…",
      "created_at": 1792310400.0,
      "created_by": "6e19c0a2-…"
    },
    {
      "version": 1,
      "status": "retired",
      "key_ref": "arn:aws:kms:ap-south-1:111122223333:key/1234abcd-…",
      "created_at": 1792224000.0,
      "created_by": "6e19c0a2-…"
    }
  ],
  "last_check_at": 1792310460.5,
  "key_usable": true,
  "last_error": null,
  "storage_reencrypt": null
}

POST/api/v1/byok/check

Unwrap the data key with your key now (not from cache): is it still usable? The result is stored and shown in the console and the Control Center.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Returns

enabledboolean
A key is in use.
versioninteger
The active data-key version; older versions stay to read older backups.
key_usableboolean | null
Whether the last check could unwrap the data key with your key.
last_errorstring | null
<CODE>: <message> from the last failed check, e.g. KEY_DISABLED: ….
storage_reencryptobject | null
Progress of a re-encryption: status (running, done, done_with_errors, failed), rewritten, skipped, failed.

Responses

  • 200Success.
  • 403{"code": "FORBIDDEN", "message": "Only organization owners and admins can do this"} — and every app-user or API-key caller.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/byok/check" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "enabled": true,
  "provider": "aws-kms",
  "key_ref": "arn:aws:kms:ap-south-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
  "version": 2,
  "versions": [
    {
      "version": 2,
      "status": "active",
      "key_ref": "arn:aws:kms:ap-south-1:111122223333:key/1234abcd-…",
      "created_at": 1792310400.0,
      "created_by": "6e19c0a2-…"
    },
    {
      "version": 1,
      "status": "retired",
      "key_ref": "arn:aws:kms:ap-south-1:111122223333:key/1234abcd-…",
      "created_at": 1792224000.0,
      "created_by": "6e19c0a2-…"
    }
  ],
  "last_check_at": 1792310460.5,
  "key_usable": false,
  "last_error": "KEY_DISABLED: The key is disabled in your KMS",
  "storage_reencrypt": null
}

POST/api/v1/byok/rotate

A new data key version wrapped by the same KMS key; new backups use it, older ones keep reading with theirs.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Returns

enabledboolean
A key is in use.
versioninteger
The active data-key version; older versions stay to read older backups.
key_usableboolean | null
Whether the last check could unwrap the data key with your key.
last_errorstring | null
<CODE>: <message> from the last failed check, e.g. KEY_DISABLED: ….
storage_reencryptobject | null
Progress of a re-encryption: status (running, done, done_with_errors, failed), rewritten, skipped, failed.

Responses

  • 200Success.
  • 403{"code": "FORBIDDEN", "message": "Only organization owners can do this"} — and every app-user or API-key caller.
  • 403PLAN_FEATURE_UNAVAILABLE — the plan doesn't include your own key (security.byok).
  • 409BYOK_NOT_ENABLED — add a key first.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/byok/rotate" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "enabled": true,
  "provider": "aws-kms",
  "key_ref": "arn:aws:kms:ap-south-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
  "version": 2,
  "versions": [
    {
      "version": 2,
      "status": "active",
      "key_ref": "arn:aws:kms:ap-south-1:111122223333:key/1234abcd-…",
      "created_at": 1792310400.0,
      "created_by": "6e19c0a2-…"
    },
    {
      "version": 1,
      "status": "retired",
      "key_ref": "arn:aws:kms:ap-south-1:111122223333:key/1234abcd-…",
      "created_at": 1792224000.0,
      "created_by": "6e19c0a2-…"
    }
  ],
  "last_check_at": 1792310460.5,
  "key_usable": true,
  "last_error": null,
  "storage_reencrypt": null
}

POST/api/v1/byok/reencrypt-storage

Rewrite the organization's existing files under its key, in the background (files written since the key was added already are). Calling it again while it runs returns the progress.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Responses

  • 202Accepted — the work continues in the background.
  • 403{"code": "FORBIDDEN", "message": "Only organization owners can do this"} — and every app-user or API-key caller.
  • 403PLAN_FEATURE_UNAVAILABLE — the plan doesn't include your own key (security.byok).
  • 409BYOK_NOT_ENABLED — add a key first.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/byok/reencrypt-storage" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "status": "running"
}

#Audit log and staff access

GET/api/v1/audit/

The organization's audit log, newest first.

Each entry is hash-chained to the one before (Audit log).

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Query parameters

actor_idstring | nulloptional
Who did it.
event_typestring | nulloptional
Exact event type, e.g. policy.updated.
event_type_prefixstring | nulloptional
e.g. auth.
0–64 characters
sourcestring | nulloptional
Engine: axis, guard, gateway…
resource_idstring | nulloptional
What it was done to.
org_idstring | nulloptional
The organization id.
project_idstring | nulloptional
One project.
env_idstring | nulloptional
One environment.
limitintegeroptionaldefault 50
How many.
1–500
offsetintegeroptionaldefault 0
How many to skip.
0–…
include_hiddenbooleanoptionaldefault false
Include entries hidden from the console.
sincestring | nulloptional
0–40 characters
untilstring | nulloptional
0–40 characters
before_seqinteger | nulloptional
1–…
qstring | nulloptional
0–200 characters

Returns

seqinteger
event_type, action, sourcestring
actor_id, resource_idstring
metadataobject
ip_address, timestampstring
chain_key, chain_seq, entry_hash, prev_hash, hmac, prev_hmacstring | integer
The tamper-evident chain.

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/audit/?event_type_prefix=policy.&limit=20" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
[
  {
    "seq": 18342,
    "event_type": "policy.updated",
    "actor_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
    "resource_id": "pol_orders_read",
    "source": "guard",
    "action": "UPDATE",
    "metadata": {
      "version": 3,
      "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07"
    },
    "ip_address": "203.0.113.24",
    "timestamp": "2026-10-17T12:31:08.512Z",
    "hmac": "9f1c…",
    "prev_hmac": "41aa…",
    "chain_key": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
    "chain_seq": 912,
    "entry_hash": "c3e8…",
    "prev_hash": "7b02…"
  }
]

POST/api/v1/audit/

Append your own event to the audit log.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Body

event_typestringrequired
Your event type, e.g. app.refund.approved.
actor_idstring | nulloptional
Who.
resource_idstring | nulloptional
What.
sourcestringoptionaldefault unknown
Your system's name.
actionstringoptional
What happened.
metadataobjectoptional
Any JSON.
ip_addressstring | nulloptional
From where.

Returns

seqintegerrequired
event_typestringrequired
actor_idstring | nullrequired
resource_idstring | nullrequired
sourcestringrequired
actionstringrequired
metadataobjectrequired
ip_addressstring | nullrequired
timestampstringrequired
hmacstringrequired
prev_hmacstringrequired
chain_keystring | nulloptional
chain_seqinteger | nulloptional
entry_hashstring | nulloptional
prev_hashstring | nulloptional

Responses

  • 201Created.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/audit/" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"event_type": "app.refund.approved", "actor_id": "6e19c0a2-…", "resource_id": "order:1042", "source": "backoffice", "action": "APPROVE", "metadata": {"amount": 59.9}}'
Response
{
  "seq": 18343,
  "event_type": "app.refund.approved",
  "actor_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
  "resource_id": "order:1042",
  "source": "backoffice",
  "action": "APPROVE",
  "metadata": {
    "amount": 59.9
  },
  "ip_address": "203.0.113.24",
  "timestamp": "2026-10-17T12:31:08.512Z",
  "hmac": "9f1c…",
  "prev_hmac": "41aa…",
  "chain_key": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
  "chain_seq": 913,
  "entry_hash": "c3e8…",
  "prev_hash": "7b02…"
}

GET/api/v1/audit/verify

Check that the audit chain is intact.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Query parameters

org_idstring | nulloptional
The organization.
freshbooleanoptionaldefault false

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/audit/verify" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "chain_key": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
  "chain_valid": true,
  "verified_entries": 913,
  "head_chain_seq": 913,
  "head_hash": "c3e8…"
}

GET/api/v1/audit/count

How many audit entries the organization has.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/audit/count" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "count": 913
}

GET/api/v1/audit/export

Download audit entries as CSV or JSON.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Query parameters

formatstringoptionaldefault csv
csv or json.
pattern `^(csv|json)$`
sincestring | nulloptional
From (ISO 8601).
untilstring | nulloptional
To.
actor_idstring | nulloptional
Filter.
event_typestring | nulloptional
Filter.
event_type_prefixstring | nulloptional
Filter.
sourcestring | nulloptional
Filter.
resource_idstring | nulloptional
Filter.
org_idstring | nulloptional
Organization.
project_idstring | nulloptional
Project.
env_idstring | nulloptional
Environment.
phi_onlybooleanoptionaldefault false
true: only requests to projects marked as holding PHI (the HIPAA access log).
staff_access_onlybooleanoptionaldefault false
true: only Sovaria staff viewing your data under a time-limited support grant.
after_seqinteger | nulloptional
Continue after this entry: the X-Sovaria-Export-Next-After-Seq of the previous page.
0–…

Responses

  • 200A file: CSV (text/csv) or JSON, oldest first, within your plan's audit retention, at most 100,000 entries per call. A longer export answers with X-Sovaria-Export-Truncated: true and X-Sovaria-Export-Next-After-Seq; ask again with after_seq for the next page (the console and sov compliance audit-log do this for you). A project API key exports its own project's entries only. Each export is itself written to the log as audit.exported (who, which filters, how many rows).
  • 400since or until isn't an ISO 8601 timestamp.
  • 401No valid session or key.
curl -s "$URL/api/v1/audit/export" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

POST/api/v1/audit/hide

Hide (or show again) audit entries in the console; they stay in the chain.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Body

seqsarray<integer>required
Entry numbers.
1–1000 items
hiddenbooleanoptionaldefault true
true to hide.

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/audit/hide" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"seqs": [18340, 18341], "hidden": true}'
Response
{
  "hidden": 2
}

GET/api/v1/access-transparency

Each time Sovaria staff accessed your organization: just-in-time grants, data queries, impersonation and admin actions.

Who
Members of the organization.

Query parameters

org_idstringrequired
Your organization (required).
project_idstring | nulloptional
One project.
event_typestring | nulloptional
jit_grant, data_query, impersonation or admin_action.
sincestring | nulloptional
From (ISO 8601).
limitintegeroptionaldefault 50
How many.
1–200
offsetintegeroptionaldefault 0
How many to skip.
0–…

Responses

  • 200Success.
  • 400Unknown event_type.
  • 403Not a member of that organization.
  • 401No valid session or key.
curl -s "$URL/api/v1/access-transparency?org_id=b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90&limit=20" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
[
  {
    "id": 41,
    "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
    "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
    "occurred_at": "2026-10-12T09:20:00Z",
    "event_type": "jit_grant",
    "operator_email": "support@sovaria.in",
    "summary": "Read-only access to investigate a failing migration (ticket 1182)",
    "detail": {
      "duration_min": 30
    }
  }
]

#More endpoints

POST/api/v1/public/abuse-reports

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Body

urlstringrequired
3–2,048 characters
categorystringrequired
3–32 characters
detailsstring | nulloptional
0–4,000 characters
emailstring | nulloptional
0–320 characters
captcha_tokenstring | nulloptional
0–4,096 characters

Responses

  • 201Created.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/public/abuse-reports" \
  -H "apikey: $ANON_KEY"

GET/api/v1/public/abuse-reports/config

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Responses

  • 200Success.
curl -s "$URL/api/v1/public/abuse-reports/config" \
  -H "apikey: $ANON_KEY"

GET/api/v1/sim/checks

The checks catalogue: what is wrong or at risk (database, functions, storage, sign-in, edge, plan headroom, settings above the plan, realtime, backups, integrations, design), worst first, each with a fix. severity keeps that level and worse.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Query parameters

severitystring | nulloptional
pattern `^(critical|warning|info)$`
areastring | nulloptional
0–32 characters
freshbooleanoptionaldefault false

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/sim/checks" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

GET/api/v1/sim/graph

The architecture map: nodes by layer (clients, edge, identity, policies, services and data, async, external, resilience) with their status from the checks and the latest run, and the edges between them.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Query parameters

freshbooleanoptionaldefault false

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/sim/graph" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

GET/api/v1/sim/inventory

Everything the project has, read from every engine: tables in every schema it created, collections, buckets, secrets (names only), functions with their schedules, queues, workflows and triggers, sign-in providers, hooks, webhooks, channels, edge limits, backups, environments, domains, policies and plan headroom. Cached a minute; redacted by the caller's permissions.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Query parameters

includestring | nulloptional
0–200 characters
freshbooleanoptionaldefault false

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/sim/inventory" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

GET/api/v1/sim/runs/{run_id}/cases/{case_id}

One request of a run with its full trace.

For a run read with view=compact: this is the one request with every check of every layer (layer_traces[].checks), marked with the project's intended outcomes and trimmed to what you may read, like the run.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Path parameters

run_idstringrequired
The run.
case_idstringrequired
The request's case.case_id in that run.

Responses

  • 200Success.
  • 400PROJECT_REQUIRED, or SIMULATION_CASE_INVALID (a case id over 200 characters).
  • 404SIMULATION_RUN_NOT_FOUND, or SIMULATION_CASE_NOT_FOUND: no request with that id in the run.
  • 401No valid session or key.
curl -s "$URL/api/v1/sim/runs/run_7c2e…/cases/case_42" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "run_id": "run_7c2e…",
  "result": {
    "case": {
      "case_id": "case_42",
      "role": "app:teacher",
      "action": "sql:select",
      "resource": "fees",
      "expected": "DENY"
    },
    "outcome": "DENY",
    "is_deviation": false,
    "deviation_type": "NONE",
    "layer_traces": [
      {
        "layer": 1,
        "label": "Gateway",
        "engine": "gateway",
        "status": "PASS",
        "detail": "9 checks passed",
        "latency_ms": 2.4,
        "checks": [
          {
            "id": "firewall",
            "stage": "gateway",
            "label": "Firewall (WAF)",
            "status": "PASS",
            "detail": "…",
            "latency_ms": 0.3
          }
        ]
      }
    ],
    "breakpoints": [],
    "duration_ms": 12
  }
}

POST/api/v1/sim/snapshot

A project snapshot for offline simulation (sov simulate offline): tables, row policies, functions, every case with the rules' verdict.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Responses

  • 200Success.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/sim/snapshot" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

GET/api/v1/sim/summary

What the Simulation page shows before any tab loads: check counts, the latest run's numbers, how many runs are kept.

Computed from the cached project inventory and the stored run summaries, so it is free (paced like discovery) and a few hundred bytes. The counts are the same as GET /api/v1/sim/checks' summary. Carries an ETag: an unchanged answer is 304 with no body.

Who
A project team member's session (the console, or a token from sov login) as Authorization: Bearer <token>. The member's role must allow the action.

Responses

  • 200Success.
  • 400PROJECT_REQUIRED: send X-Sovaria-Project-ID.
  • 403ORG_PERMISSION_REQUIRED (simulation.read), or SIMULATION_DISABLED.
  • 401No valid session or key.
curl -s "$URL/api/v1/sim/summary" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "checks": {
    "critical": 1,
    "warning": 3,
    "info": 2
  },
  "discovered_at": "2026-11-10T09:12:00Z",
  "latest_run": {
    "run_id": "run_7c2e…",
    "status": "complete",
    "started_at": "2026-11-10T09:00:02Z",
    "cases_total": 214,
    "cases_pass": 209,
    "cases_fail": 2,
    "cases_warn": 3,
    "cases_deviation": 2,
    "runner_ms": 38210.0
  },
  "runs_total": 12
}