---
title: "Log analytics events"
method: POST
path: "/api/analytics/{project_id}/log"
tags: ["Analytics"]
---

# Log analytics events

`POST /api/analytics/{project_id}/log`

## Request

- Base URL: `https://core.blink.new`
- URL: `https://core.blink.new/api/analytics/{project_id}/log`
- Auth: HTTP bearer

Ingest one or more analytics events for a project. Events are forwarded to
Tinybird in NDJSON format and stored in the `blink_events` data source.

Accepts up to 10 events per request (50 KB max). String fields are truncated to 256 characters. The server auto-enriches missing `browser`, `os`, and `deviceType` fields from the `User-Agent` header. Non-standard event fields are stored in the `data` column. Authentication is optional unless `analytics.require_auth` is enabled for the project — except pageview-only batches from `*.blinkpowered.com` or `*.sites.blink.new` (see `Origin`/`Referer`), needed for hosted `sendBeacon`.

## Path parameters

- `project_id` string, required

## Request body

- object
  - `events` object[], required: Array of analytics events (max 10 per request)
    - `type` string, required: Event name / type identifier
    - `timestamp` string, date-time: ISO 8601 event timestamp (server time is used when missing or more than 24h in the future)
    - `user_id` string, nullable: Accepted for compatibility and discarded; user identifiers are not stored
    - `session_id` string, nullable: Anonymous session identifier
    - `pathname` string, nullable: URL path where the event occurred
    - `referrer` string, nullable: Referrer URL
    - `screen_width` integer, nullable: Viewport / screen width in pixels
    - `project_id` string: Project ID (overrides path param when provided)
    - `user_email` string, email, nullable: Accepted for compatibility and discarded; user emails are not stored
    - `channel` string, nullable: Marketing channel (e.g. organic, email, paid)
    - `utm_source` string, nullable: UTM source parameter
    - `utm_medium` string, nullable: UTM medium parameter
    - `utm_campaign` string, nullable: UTM campaign parameter
    - `utm_content` string, nullable: UTM content parameter
    - `utm_term` string, nullable: UTM term parameter

## Response `202`

Events accepted and forwarded to the analytics pipeline

- object
  - `success` boolean

## Other responses

- `400`: Invalid request — bad events array or too many events
- `401`: Authentication required (project has `analytics.require_auth` enabled)
- `413`: Payload too large (exceeds 50 KB)
- `500`: Internal server error
- `503`: Analytics service not configured

---

[API](https://skmtc.dev/blink/apis/blink-apis.md) - [All operations](https://skmtc.dev/blink/apis/blink-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/blink/apis/blink-apis/revisions/4c59c706078e?raw)
