Skip to content
GitHubLog inStart free
cetra is not released yet. These docs describe the development version.

Send product analytics events

POST
/api/v1/analytics/events
curl --request POST \
--url http://localhost:8080/api/v1/analytics/events \
--header 'Content-Type: application/json' \
--cookie cetra_session=<cetra_session> \
--data '{ "events": [ { "name": "example", "org": "example", "project": "example", "properties": {} } ] }'

Session only. Web events of the catalog (page.viewed with a route template, command_palette.opened, live_tail.toggled, list_layout.changed, theme.changed, assistant.panel_opened). At most 50 events and 64 KiB are read, and 60 requests a minute per user. Unknown names and properties and invalid values are dropped; when a PostHog sink runs, events of orgs or projects the user cannot read are dropped too. The user comes from the session. DNT: 1 or Sec-GPC: 1 keeps the events out of PostHog. With no PostHog sink the events are dropped. Always 204 once signed in.

Media typeapplication/json

POST /api/v1/analytics/events. At most 50 events are read; the rest are dropped.

object
events
required

Catalog events of the web UI.

Array<object>

One web event. The server keeps it only when name is a web event of the catalog with valid properties, and the user can read org and project.

object
name
required

A web event name of the catalog, e.g. page.viewed.

string
org

The page’s org, as in the URL (slug or id). Resolved by the server, never stored.

string
project

The page’s project, as in the URL (slug or id). Resolved by the server, never stored.

string
properties

The event’s properties; unknown keys are dropped.

object

Example generated

{
"events": [
{
"name": "example",
"org": "example",
"project": "example",
"properties": {}
}
]
}

Accepted, whatever the body held.

No credentials, or the credentials are invalid.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The credentials do not allow this operation, or the organization’s plan does not include it (code plan_required).

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}