Managed Warehouse
Let Levered host your warehouse — send exposure and reward events to the ingestion API instead of connecting your own data warehouse.
With the Managed Warehouse, Levered hosts the warehouse for you. Instead of connecting your own BigQuery, Snowflake, or Postgres, you send exposure and reward events to Levered's ingestion API and they land in a managed dataset that training and results read from automatically.
Use this when you don't want to stand up or grant access to your own warehouse. Everything else — metrics, optimizations, the SDK — works the same.
1. Enable the managed warehouse
- Navigate to Settings > Warehouse in the Levered dashboard.
- Under the connection options, click Managed Warehouse ("Hosted by Levered").
This points your organization at the managed dataset. You only need to do this once.
2. Create an optimization
Every exposure you send is attached to an optimization, so create one first — you'll need its optimization_id in the next steps. Create it from the dashboard (Optimizations > Create Optimization), or with the Levered CLI / Claude Code plugin. See Create your first optimization.
3. Create an API key
The ingestion API is authenticated with an API key (your Clerk dashboard session is not used for ingestion).
- Go to Settings > API Keys in the dashboard.
- Create a new key. The full secret is shown once — copy it and store it somewhere safe. You can revoke it any time.
4. Send events
Send events as JSON batches to the ingestion API. Authenticate with your key via Authorization: Bearer <api_key> (or the X-API-Key header).
- Base URL:
https://api.levered.dev/api/v2/ingest - Up to 500 events per request; max request body 5 MB.
- Your
optimization_ids must belong to your organization.
Exposures
Record which variant a user saw. POST /api/v2/ingest/exposures:
curl -X POST https://api.levered.dev/api/v2/ingest/exposures \
-H "Authorization: Bearer $LEVERED_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"events": [
{
"anonymous_id": "user_123",
"optimization_id": "eec6a814-3672-4fcc-b88f-1a900724a9aa",
"variant": { "cta": "sign_up_now", "hero": "shield" },
"context": { "country": "US", "device": "mobile" },
"timestamp": "2026-06-16T10:30:00Z"
}
]
}'| Field | Required | Description |
|---|---|---|
anonymous_id | yes | Stable per-user identifier (1–512 chars). |
optimization_id | yes | UUID of one of your optimizations. |
variant | yes | The variant the user was served, as a JSON object of factor → value. |
context | no | Context-factor values for this exposure. |
timestamp | no | ISO 8601 event time (with offset). Defaults to server time if omitted. |
idempotency_key | no | Caller-supplied key (1–256 chars) to make retries safe. |
Rewards
Record a conversion or metric event. POST /api/v2/ingest/rewards:
curl -X POST https://api.levered.dev/api/v2/ingest/rewards \
-H "Authorization: Bearer $LEVERED_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"events": [
{
"anonymous_id": "user_123",
"name": "signup_completed",
"value": 1,
"timestamp": "2026-06-16T10:32:00Z"
}
]
}'| Field | Required | Description |
|---|---|---|
anonymous_id | yes | Same identifier you sent on the exposure — this is how rewards attribute back. |
name | yes | Metric name (1–255 chars), e.g. signup_completed. |
value | no | Numeric value; defaults to 1 (a count/conversion). |
timestamp | no | ISO 8601 event time. Defaults to server time if omitted. |
optimization_id | no | Pin the reward to one optimization. Omit for a global conversion attributed by name across optimizations. |
properties | no | Arbitrary JSON metadata. |
idempotency_key | no | Caller-supplied key to make retries safe. |
Responses
| Status | Meaning |
|---|---|
200 | All events accepted. |
207 | Partial — some events were rejected; see the rejected array in the response. |
400 | Invalid payload (the response lists the validation issues). |
403 | One or more optimization_ids are unknown or not owned by your org. |
409 | Your org isn't on the managed warehouse — enable it (step 1) first. |
503 | Transient warehouse write failure — retry the batch. |
Rewards attribute to exposures by anonymous_id within each optimization's conversion window, exactly as they do with a connected warehouse.
Next step
Once events are flowing, training reads from the managed dataset automatically — no data pipeline to build and no further configuration. Next, integrate the SDK to serve variants in your app, then watch results come in on the optimization's dashboard.