Spavik
API referenceModels

Submit outcomes

POST /v1/models/{id}/outcomes

Download OpenAPI
POST
/v1/models/{id}/outcomes

Authorization

apiKey
headerX-Spavik-Api-Key<token>

Spavik integration API key (sk-spv-api-...), sent in X-Spavik-Api-Key.

Path Parameters

id*string

Model identifier or slug

Header Parameters

Idempotency-Key?string

Same workspace, method, path, key and payload prevent another execution or charge, subject to current model access. Successful responses are replayed for every data policy, including ZDR, from the technical PostgreSQL cache (default retention 24 hours from operation creation). The data policy only controls inference input/output archiving to GCS/BigQuery; it never changes replay behavior. A different key or an expired completed key starts a new operation and may be charged again. REQUEST_IN_PROGRESS: wait Retry-After. REQUEST_INTERRUPTED: outcome uncertain; contact support. IDEMPOTENCY_RESPONSE_UNAVAILABLE: a completed response is missing; do not retry with a new key. Completed keys expire; unresolved keys remain protected. Reusing a key with different input returns 422. A key is required on the original call for safe retries.

User-Agent?string

Information about the agent originating the request, when known. Browsers supply their own value. Optional diagnostic metadata, declared by the caller and never used for authorization. Omit unknown values. Values are trimmed and truncated to the documented length.

Lengthlength <= 1024
X-Spavik-Client-Name?string

HTTP caller: SDK, MCP server or direct application (for example spavik-sdk-python, spavik-sdk-javascript or spavik-mcp). Optional diagnostic metadata, declared by the caller and never used for authorization. Omit unknown values. Values are trimmed and truncated to the documented length.

Lengthlength <= 128
X-Spavik-Client-Version?string

Version of that SDK, MCP server or direct application. Optional diagnostic metadata, declared by the caller and never used for authorization. Omit unknown values. Values are trimmed and truncated to the documented length.

Lengthlength <= 64

Request Body

application/json
  1. body
outcomes*array<>
Items1 <= items <= 1000

Response Body

Success

application/json
  1. response
accepted?integer
pending_outcomes?integer
unresolved?array<string>Deprecated

Compatibility field, always empty. Every outcome supplies its features; no request_id lookup is performed.

Itemsitems <= 0
refresh_triggered?boolean

Model on auto_update: this batch started an integration.

refresh_suggested?boolean
import requestsurl = "https://api.spavik.co/v1/models/string/outcomes"body = """{  "outcomes": [    {      "request_id": "req_4Nx7Bm2VtQd9Lp3Kwr",      "features": {        "plan": "pro",        "seats": 12,        "tickets_90d": 3      },      "actual": 1    },    {      "features": {        "plan": "free",        "seats": 2,        "tickets_90d": 10      },      "actual": 0    }  ]}"""response = requests.request("POST", url, data = body, headers = {  "Content-Type": "application/json"})print(response.text)
{  "accepted": 0,  "pending_outcomes": 0,  "unresolved": [],  "refresh_triggered": true,  "refresh_suggested": true}

How is this guide?

Last updated on