Managed Warehouse
Levered hosts the warehouse, and the app sends exposure and reward events to the ingestion API.
With the Managed Warehouse, Levered hosts the warehouse. The app sends exposure and reward events to Levered's ingestion API. Training and results read the events from there. Choose a warehouse compares this option with connecting your own warehouse.
With the Managed Warehouse, skip step 2 (data pipeline), because the ingestion API replaces it. Metrics, optimizations and the SDK work as with your own warehouse.
1. Enable the managed warehouse
- Click Warehouse in the Levered dashboard sidebar.
- Under the connection options, click Managed Warehouse ("Hosted by Levered").
This sets the managed dataset as the warehouse of your organization. Do this once per organization.
2. Create an optimization
Each exposure belongs to an optimization. Create an optimization first, because the next steps need its optimization_id. Create it with the Levered CLI or the Claude Code plugin (Create your first optimization).
3. Create an API key
The ingestion API authenticates requests with an API key. It does not accept the Clerk session of the dashboard.
- Go to app.levered.dev/warehouse. Keys are managed under API keys on the Managed Warehouse card. API keys are used with the Managed Warehouse only. With data warehouse native, Levered reads your warehouse directly.
- Click Create key. The dashboard shows the full secret once. Copy it and store it in a safe place. The key can be revoked on the same card.
4. Send events
Send events as JSON batches to the ingestion API. Authenticate with the API key in the Authorization: Bearer <api_key> header or in the X-API-Key header.
- Base URL:
https://api.levered.dev/api/v2/ingest - A request can contain up to 500 events. The maximum request body is 5 MB.
- Each
optimization_idmust belong to your organization.
Exposures
An exposure records which variant a user saw. Send exposures to 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) that makes retries safe. |
Rewards
A reward records a conversion or another metric event. Send rewards to 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 | The identifier sent with the exposure. Levered uses it to attribute rewards to exposures. |
name | yes | Metric name (1-255 chars), for example signup_completed. |
value | no | Numeric value. Defaults to 1 (a count or a conversion). |
timestamp | no | ISO 8601 event time. Defaults to server time if omitted. |
optimization_id | no | Assigns the reward to one optimization. If omitted, the reward is a global conversion that is attributed by name across optimizations. |
properties | no | Arbitrary JSON metadata. |
idempotency_key | no | Caller-supplied key that makes retries safe. |
Responses
| Status | Meaning |
|---|---|
200 | All events accepted. |
207 | Some events were rejected. The rejected array in the response lists them. |
400 | Invalid payload (the response lists the validation issues), or a timestamp more than 24 hours in the future (timestamp too far in the future). With such a timestamp, the whole batch is rejected. |
403 | One or more optimization_id values are unknown or do not belong to your organization. |
409 | The organization does not use the Managed Warehouse. Enable it first (step 1). |
503 | Transient warehouse write failure. Retry the batch. |
Levered attributes rewards to exposures by anonymous_id within the conversion window of each optimization, in the same way as with a connected warehouse.
Next step
Training reads from the managed dataset. Next, define the reward metric for your goal.