API: Queries
Ad-hoc funnel / retention / segmentation queries and the event catalog.
На этой странице
- GET /projects/{id}/catalog/events
- GET /projects/{id}/catalog/props
- POST /projects/{id}/queries/activation-drivers
- POST /projects/{id}/queries/activity-summary
- POST /projects/{id}/queries/correlations
- POST /projects/{id}/queries/funnel
- POST /projects/{id}/queries/lifecycle
- POST /projects/{id}/queries/paths
- POST /projects/{id}/queries/retention
- POST /projects/{id}/queries/retention/actors
- POST /projects/{id}/queries/revenue-summary
- POST /projects/{id}/queries/segmentation
- POST /projects/{id}/queries/stickiness
Раздел собран из спецификации OpenAPI продукта: 13 метод(ов). Поверхность — query-api (основной API, база /api/v1). Все методы требуют аутентификации.
Методы раздела
- GET
/projects/{id}/catalog/events - GET
/projects/{id}/catalog/props - POST
/projects/{id}/queries/activation-drivers - POST
/projects/{id}/queries/activity-summary - POST
/projects/{id}/queries/correlations - POST
/projects/{id}/queries/funnel - POST
/projects/{id}/queries/lifecycle - POST
/projects/{id}/queries/paths - POST
/projects/{id}/queries/retention - POST
/projects/{id}/queries/retention/actors - POST
/projects/{id}/queries/revenue-summary - POST
/projects/{id}/queries/segmentation - POST
/projects/{id}/queries/stickiness
/projects/{id}/catalog/events List known event names for the project
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Event catalog | object |
| 401 | Missing or invalid credentials (code=unauthorized) | Error |
| 404 | Resource not found (code=not_found) | Error |
/projects/{id}/catalog/props List property keys seen for the project (optionally for one event)
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
event необязателен | Query | string | Optional event name to scope property keys to. |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Property keys with inferred value types | object |
| 401 | Missing or invalid credentials (code=unauthorized) | Error |
| 404 | Resource not found (code=not_found) | Error |
| 422 | Request failed validation (code=validation_failed) | Error |
/projects/{id}/queries/activation-drivers Find early behaviour thresholds associated with later retention
Searches combinations of candidate event, repetition threshold and early window after the anchor event that are statistically associated with a later return. Discovery picks the window and threshold, validation checks the already selected combination once on an independent deterministic split of actors. The result reports an association, never a causal effect. Cohort maturity is evaluated against a single as_of captured at the start of the request: actors whose outcome window has not closed are excluded instead of being counted as churn. Every behaviour window must end before outcome.from_day; overlapping windows are rejected with 422.
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
Тело запроса application/json , обязательно
| Поле | Тип | Описание |
|---|---|---|
date_from обязательно | string (date) | Cohort window start; it bounds the anchor, not every event read. |
date_to обязательно | string (date) | |
anchor_event обязательно | string | |
behavior_windows_days необязательно | array<integer> | Early windows in calendar days evaluated in the project timezone. Every value must be at most outcome.from_day. Omitted means the server default [1,3,7,10,14,30] trimmed to outcome.from_day. |
outcome обязательно | ActivationOutcome | Binary retention definition relative to the anchor. The actor is retained when the outcome happened at least once in [anchor + from_day, anchor + to_day); repeats never strengthen it. |
filters необязательно | array<oneOf<Filter | string>> | |
exclude_managed_events необязательно | boolean | По умолчанию true. |
excluded_events необязательно | array<string> | |
candidate_limit необязательно | integer | По умолчанию 50. |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Ranked associations with explicit discovery and validation statistics | ActivationDriversResponse |
| 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 |
| 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}/queries/activity-summary Calculate exact product-activity metrics for completed local days
Returns DAU, WAU, MAU, usage-frequency and repeat-activity metrics for one activity event. date_to is the last fully completed local calendar day. The server derives the trailing 7- and 30-calendar-day windows in the project's timezone and counts exact actor_id unions in one bounded query; daily uniques are never summed to produce WAU or MAU.
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
Тело запроса application/json , обязательно
| Поле | Тип | Описание |
|---|---|---|
date_to обязательно | string (date) | Last fully completed local calendar day, inclusive. |
event необязательно | string | `any` or the event that represents meaningful product activity. По умолчанию "any". |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Exact activity summary with one shared cutoff | ActivitySummaryResponse |
| 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}/queries/correlations Rank event correlations by lift
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
Тело запроса application/json , обязательно
| Поле | Тип | Описание |
|---|---|---|
target_event обязательно | string | |
date_from обязательно | string (date) | |
date_to обязательно | string (date) | |
filters необязательно | array<oneOf<Filter | string>> | |
min_n необязательно | integer | По умолчанию 5. |
limit необязательно | integer | По умолчанию 20. |
exclude_managed необязательно | boolean | Local seam until the managed-property Registry lands from P1. По умолчанию true. |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Estimated correlations with an explicit non-causality warning | CorrelationsResponse |
| 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 |
| 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}/queries/funnel Run a funnel query
Basic funnel counts are available on every plan. Supplying dropped_at_step requests exact actor membership and requires the Growth or Scale actor_drilldown entitlement in cloud or actor_drilldown in the current verified on-prem signed-license subset; direct API calls are enforced.
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
Тело запроса application/json , обязательно
| Поле | Тип | Описание |
|---|---|---|
date_from необязательно | string | YYYY-MM-DD |
date_to необязательно | string | YYYY-MM-DD |
window_hours необязательно | integer | Conversion window |
steps обязательно | array<FunnelStep> | |
breakdown необязательно | Breakdown | |
count_by необязательно | enum(actors, totals) | |
value необязательно | enum(actors, revenue) | Omitted/actors keeps counts; revenue adds estimated monthly RUB loss and requires count_by=actors. |
compare необязательно | CompareRequest | |
dropped_at_step необязательно | integer | Optional 1-based transition start k. Returns actors whose exact windowFunnel level is k (reached step k but did not reach k+1 in the same compiled funnel). Valid only for 1 <= k < steps.length and count_by=actors. The list always refers to Total, not an individual breakdown segment. |
dropped_cursor необязательно | string | Opaque cursor scoped to the full funnel and drop-off transition. |
dropped_limit необязательно | integer | Page size for the optional drop-off actor list (default 50). |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Funnel result | FunnelResponse |
| 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 |
| 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}/queries/lifecycle Calculate new, current, resurrected and dormant actors
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
Тело запроса application/json , обязательно
| Поле | Тип | Описание |
|---|---|---|
date_from обязательно | string (date) | |
date_to обязательно | string (date) | |
interval необязательно | enum(day, week) | По умолчанию "day". |
filters необязательно | array<oneOf<Filter | string>> |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Lifecycle time series; dormant values are non-positive | LifecycleResponse |
| 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 |
| 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}/queries/paths Calculate bounded paths around a selected event
Returns deterministic top routes and a Sankey graph before or after the selected event. Session mode requires actor_drilldown; actor mode does not. Saved segment filters additionally require saved_segments. The result cache includes the project timezone and URL-normalization revision.
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
Тело запроса application/json , обязательно
| Поле | Тип | Описание |
|---|---|---|
date_from обязательно | string (date) | |
date_to обязательно | string (date) | |
selected_event обязательно | string | |
direction обязательно | enum(before, after) | |
start_event необязательно | string | |
end_event необязательно | string | |
depth обязательно | integer | |
min_count необязательно | integer | По умолчанию 1. |
mode обязательно | enum(actor, session) | |
filters необязательно | array<oneOf<Filter | string>> | |
breakdown необязательно | PathBreakdown | |
exclude_events необязательно | array<string> | |
top_n необязательно | integer | По умолчанию 20. |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Bounded path result | PathResponse |
| 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 |
| 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}/queries/retention Run a retention query
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
Тело запроса application/json , обязательно
| Поле | Тип | Описание |
|---|---|---|
start_event обязательно | string | |
return_event необязательно | string | `any` or a specific event name |
granularity необязательно | enum(day, week) | |
periods необязательно | integer | |
date_from необязательно | string | YYYY-MM-DD |
date_to необязательно | string | YYYY-MM-DD |
filters необязательно | array<oneOf<Filter | string>> | |
value необязательно | enum(actors, revenue) | Omitted/actors keeps retention ratios; revenue returns cumulative cohort-size LTV curves in RUB. |
compare необязательно | CompareRequest |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Retention result | RetentionResponse |
| 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 |
| 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}/queries/retention/actors List exact actors represented by one retention heatmap cell (Growth and Scale)
Recompiles the same start cohort, return event, timezone, date range, filters and period semantics as the parent retention report. Period 0 is the complete start cohort; later periods contain actors with a matching return bucket. Results are ordered by actor_id and cursor paginated. Server-side actor_drilldown and saved_segments entitlements are enforced for direct API calls through the cloud EffectivePlan or current verified on-prem signed-license feature subset.
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
Тело запроса application/json , обязательно
| Поле | Тип | Описание |
|---|---|---|
start_event обязательно | string | |
return_event обязательно | string | `any` or a specific event name |
granularity обязательно | enum(day, week) | |
periods обязательно | integer | |
date_from обязательно | string (date) | |
date_to обязательно | string (date) | |
filters необязательно | array<oneOf<Filter | string>> | |
cohort обязательно | string (date) | Exact local bucket label returned by RetentionResponse. |
period обязательно | integer | |
cursor необязательно | string | |
limit необязательно | integer | По умолчанию 50. |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Exact actor membership page | RetentionActorsResponse |
| 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 |
| 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}/queries/revenue-summary Calculate exact whole-range revenue and ARPU
Revenue is the signed sum of props.revenue in RUB. ARPU divides it by unique active actors in the entire range, so an actor active on several days is counted once. The query is project/date bounded and uses the shared report timeout, cache and saved-segment resolution.
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
Тело запроса application/json , обязательно
| Поле | Тип | Описание |
|---|---|---|
date_from обязательно | string (date) | Inclusive local calendar date |
date_to обязательно | string (date) | Inclusive local calendar date |
filters необязательно | array<oneOf<Filter | string>> |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Exact 30-day-style revenue summary | RevenueSummaryResponse |
| 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 |
| 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}/queries/segmentation Run a segmentation (time-series) query
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
Тело запроса application/json , обязательно
| Поле | Тип | Описание |
|---|---|---|
metric обязательно | enum(events, uniques, revenue, revenue_avg) | |
event обязательно | string | `any` or a specific event name |
filters необязательно | array<oneOf<Filter | string>> | |
group_by необязательно | GroupBy | |
interval необязательно | enum(hour, day, week, month) | |
date_from необязательно | string | YYYY-MM-DD |
date_to необязательно | string | YYYY-MM-DD |
compare необязательно | CompareRequest |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Segmentation result | SegmentationResponse |
| 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 |
| 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}/queries/stickiness Calculate active-days-per-actor stickiness
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
Тело запроса application/json , обязательно
| Поле | Тип | Описание |
|---|---|---|
date_from обязательно | string (date) | |
date_to обязательно | string (date) | |
event необязательно | string | `any` or a valid event name. По умолчанию "any". |
filters необязательно | array<oneOf<Filter | string>> |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Stickiness histogram | StickinessResponse |
| 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 |
| 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.
Расхождение снимка со спецификацией роняет сборку документации.