Send product analytics events
const url = 'http://localhost:8080/api/v1/analytics/events';const options = { method: 'POST', headers: { cookie: 'cetra_session=<cetra_session>', 'Content-Type': 'application/json' }, body: '{"events":[{"name":"example","org":"example","project":"example","properties":{}}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”POST /api/v1/analytics/events. At most 50 events are read; the rest are dropped.
object
Catalog events of the web UI.
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
A web event name of the catalog, e.g. page.viewed.
The page’s org, as in the URL (slug or id). Resolved by the server, never stored.
The page’s project, as in the URL (slug or id). Resolved by the server, never stored.
The event’s properties; unknown keys are dropped.
object
Example generated
{ "events": [ { "name": "example", "org": "example", "project": "example", "properties": {} } ]}Responses
Section titled “Responses”Accepted, whatever the body held.
No credentials, or the credentials are invalid.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The credentials do not allow this operation, or the organization’s plan does not include it (code plan_required).
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}