API: Experiments
Project-scoped experiment definitions and bounded statistical readouts. ActionPulse analyzes customer-supplied exposure events; it never assigns traffic or acts as an A/B runner.
На этой странице
Раздел собран из спецификации OpenAPI продукта: 6 метод(ов). Поверхность — query-api (основной API, база /api/v1). Все методы требуют аутентификации.
Методы раздела
/projects/{id}/experiments List experiment definitions
Viewer-readable newest-first keyset page. The cursor is opaque and project-bound; using a cursor from another project is rejected. The cursor is rejected above 4096 bytes before base64 decoding. The request has a 10-second deadline plus project rate and concurrency limits.
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
cursor необязателен | Query | string | |
limit необязателен | Query | integer | По умолчанию 50. |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Experiment page | ExperimentPage |
| 401 | Missing or invalid credentials (code=unauthorized) | Error |
| 404 | Resource not found (code=not_found) | Error |
| 408 | Query exceeded the endpoint-specific timeout (code=query_timeout) | Error |
| 422 | Request failed validation (code=validation_failed) | Error |
| 429 | Rate limit (code=rate_limited) or plan quota exceeded (code=quota_exceeded). On ingest operations a live trial that exhausted its total event cap answers code=trial_quota_exceeded instead of quota_exceeded. Заголовки: Retry-After.
| Error |
/projects/{id}/experiments Create an experiment definition (analyst+)
Stores analysis metadata only. Expected weights are used for the sample ratio mismatch check and never allocate or bucket traffic. The owner must be an active member of the project's organization.
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
Тело запроса application/json , обязательно
| Поле | Тип | Описание |
|---|---|---|
name обязательно | string | |
variants обязательно | array<ExperimentVariant> | |
starts_at обязательно | string (date-time) | |
ends_at обязательно | string (date-time) | |
owner_id обязательно | integer (int64) | |
hypothesis обязательно | string | |
primary_metric обязательно | ExperimentMetricDefinition | |
guardrail_metrics необязательно | array<ExperimentMetricDefinition> | |
audience обязательно | ExperimentAudience | |
status обязательно | enum(draft, running, completed, archived) | |
notes необязательно | string | |
random_assignment_confirmed обязательно | boolean | |
key обязательно | string |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 201 | Created experiment | Experiment |
| 401 | Missing or invalid credentials (code=unauthorized) | Error |
| 403 | Authenticated but not permitted (code=forbidden) | Error |
| 404 | Resource not found (code=not_found) | Error |
| 408 | Query exceeded the endpoint-specific timeout (code=query_timeout) | Error |
| 413 | Request body exceeds the endpoint-specific byte limit (code=validation_failed) | Error |
| 422 | Request failed validation (code=validation_failed) | Error |
| 429 | Rate limit (code=rate_limited) or plan quota exceeded (code=quota_exceeded). On ingest operations a live trial that exhausted its total event cap answers code=trial_quota_exceeded instead of quota_exceeded. Заголовки: Retry-After.
| Error |
/projects/{id}/experiments/{eid} Get an experiment definition
A foreign-project id is concealed as 404.
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
eid обязателен | Путь | integer (int64) |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Experiment definition | Experiment |
| 401 | Missing or invalid credentials (code=unauthorized) | Error |
| 404 | Resource not found (code=not_found) | Error |
| 408 | Query exceeded the endpoint-specific timeout (code=query_timeout) | Error |
| 429 | Rate limit (code=rate_limited) or plan quota exceeded (code=quota_exceeded). On ingest operations a live trial that exhausted its total event cap answers code=trial_quota_exceeded instead of quota_exceeded. Заголовки: Retry-After.
| Error |
/projects/{id}/experiments/{eid} Replace an experiment definition (analyst+)
The project id and experiment key are immutable.
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
eid обязателен | Путь | integer (int64) |
Тело запроса application/json , обязательно
| Поле | Тип | Описание |
|---|---|---|
name обязательно | string | |
variants обязательно | array<ExperimentVariant> | |
starts_at обязательно | string (date-time) | |
ends_at обязательно | string (date-time) | |
owner_id обязательно | integer (int64) | |
hypothesis обязательно | string | |
primary_metric обязательно | ExperimentMetricDefinition | |
guardrail_metrics необязательно | array<ExperimentMetricDefinition> | |
audience обязательно | ExperimentAudience | |
status обязательно | enum(draft, running, completed, archived) | |
notes необязательно | string | |
random_assignment_confirmed обязательно | boolean |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Updated experiment | Experiment |
| 401 | Missing or invalid credentials (code=unauthorized) | Error |
| 403 | Authenticated but not permitted (code=forbidden) | Error |
| 404 | Resource not found (code=not_found) | Error |
| 408 | Query exceeded the endpoint-specific timeout (code=query_timeout) | Error |
| 413 | Request body exceeds the endpoint-specific byte limit (code=validation_failed) | Error |
| 422 | Request failed validation (code=validation_failed) | Error |
| 429 | Rate limit (code=rate_limited) or plan quota exceeded (code=quota_exceeded). On ingest operations a live trial that exhausted its total event cap answers code=trial_quota_exceeded instead of quota_exceeded. Заголовки: Retry-After.
| Error |
/projects/{id}/experiments/{eid} Delete an experiment definition (analyst+)
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
eid обязателен | Путь | integer (int64) |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 204 | Deleted | пусто |
| 401 | Missing or invalid credentials (code=unauthorized) | Error |
| 403 | Authenticated but not permitted (code=forbidden) | Error |
| 404 | Resource not found (code=not_found) | Error |
| 408 | Query exceeded the endpoint-specific timeout (code=query_timeout) | Error |
| 429 | Rate limit (code=rate_limited) or plan quota exceeded (code=quota_exceeded). On ingest operations a live trial that exhausted its total event cap answers code=trial_quota_exceeded instead of quota_exceeded. Заголовки: Retry-After.
| Error |
/projects/{id}/experiments/{eid}/readout Compute a bounded experiment readout
Viewer-readable semantic POST. `from` is inclusive and `to` exclusive; both are mandatory UTC instants, the range is at most 400 days and must stay inside the stored experiment dates. Exposures come only from the canonical `experiment_exposure` event with an exact `props.experiment_key` match and are capped at 100000 rows. Exposure `props` are capped at 4 KiB per row and 16 MiB for the result; actor ids are capped at 256 bytes and fail closed using their full pre-truncation length. `allocation_unit` must be omitted or equal `actor_id`; arbitrary units are excluded and counted under the `unsupported_allocation_unit` warning instead of merging identities. Count/conversion metric queries never select raw props. Metric events use the same query-engine Filter AST, saved-segment resolver and exact actor membership as report queries. Across the primary and at most ten guardrail metrics, one readout is capped at 200000 materialized event rows, 64 MiB of result data and 64 MiB of repeated actor-array data; each ClickHouse query also has explicit result, memory and rows-read limits. All routes have project rate/concurrency limits; readout has one limiter acquisition and a 30-second compute deadline. Revenue is the signed numeric `props.revenue` convention (refunds remain negative). The server-side EnabledRevenue policy makes this available to every project independently of the still-unactivated standalone P4 `experiment_readout` commercial proposal; revision 3 did not add that capability. Every correlation/uplift result permanently carries `meta.estimate=true`.
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
eid обязателен | Путь | integer (int64) |
Тело запроса application/json , обязательно
| Поле | Тип | Описание |
|---|---|---|
from обязательно | string (date-time) | Inclusive UTC instant. |
to обязательно | string (date-time) | Exclusive UTC instant. |
exposure_limit необязательно | integer | Optional; defaults to 100000. |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Complete, non-truncated readout | ExperimentReadout |
| 401 | Missing or invalid credentials (code=unauthorized) | Error |
| 402 | Product access is not active. `code=trial_expired` means the organization's trial ended without payment; `code=subscription_required` means there is no current paid subscription or live trial. In both cases ingest, mutations and plan-gated read/write capabilities are paused until a plan is paid; details.billing_url, when present, points to the cabinet billing page. | Error |
| 403 | Authenticated but not permitted (code=forbidden) | Error |
| 404 | Resource not found (code=not_found) | Error |
| 408 | Query exceeded the endpoint-specific timeout (code=query_timeout) | Error |
| 413 | Request body exceeds the endpoint-specific byte limit (code=validation_failed) | Error |
| 422 | Request failed validation (code=validation_failed) | Error |
| 429 | Rate limit (code=rate_limited) or plan quota exceeded (code=quota_exceeded). On ingest operations a live trial that exhausted its total event cap answers code=trial_quota_exceeded instead of quota_exceeded. Заголовки: Retry-After.
| Error |
Источник раздела — docs/api/openapi.yaml репозитория продукта,
версия API 1.0.0, OpenAPI 3.0.3,
снимок 095579325c2d.
Расхождение снимка со спецификацией роняет сборку документации.