---
title: "Open a tracking window"
method: POST
path: "/v1/analytics/tracking"
tags: ["Analytics"]
---

# Open a tracking window

`POST /v1/analytics/tracking`

## Request

- Base URL: `https://zernio.com/api`
- URL: `https://zernio.com/api/v1/analytics/tracking`
- Auth: HTTP bearer

Starts watching a post's views and engagement.

Zernio fetches the numbers from the platform itself on its regular analytics sync, so every reading is verified. It is a value we read from the platform, never one the creator or the caller reported.

### The window

- Runs for `trackingDays` (30 by default, 90 at most).
- Ends with one final read, after which the `post.tracking_completed` webhook fires.

### Identifying the post

Send either `postId` (an external post id from Zernio), or `accountId` together with the post's `url`.

### Responses

- `201`: a new window was opened.
- `200`: the post is already tracked; the existing window is returned.

## Request body

- object
  - `postId` string: Id of an external post. Required unless `accountId` and `url` are both sent.
  - `accountId` string: Connected account the post belongs to. Send together with `url`.
  - `url` string: Public URL of the post on the platform. Send together with `accountId`.
  - `trackingDays` integer: How many days the window stays open.
  - `requestedBy` string: Free-form label for who asked for the window. It is stored and returned as given.

## Response `200`

The post already had a window; it is returned unchanged

- TrackingWindowResponse
  - `window` TrackingWindow, required
    - `id` string, required
    - `postId` string, required: The external post being tracked
    - `accountId` string, required
    - `platform` string, required
    - `platformPostId` string, required: The post's id on the platform
    - `startsAt` string, date-time, required
    - `endsAt` string, date-time, required
    - `status` 'open' | 'completing' | 'completed' | 'cancelled', required
    - `finalReadAt` string, date-time, nullable, required: When the closing read ran. Null until then.
    - `completionReason` 'final_read' | 'unreachable' | 'post_deleted' | 'cancelled' | 'null', nullable, required: How the window closed. Null while it is open.
    - `requestedBy` string, required
    - `latest` object, nullable, required: The latest verified numbers we read from the platform. Null when no sample exists yet.
      - `views` integer, required
      - `likes` integer, required
      - `comments` integer, required
      - `shares` integer, required
      - `saves` integer, required
      - `syncedAt` string, date-time, nullable, required

## Other responses

- `201`: Window opened
- `400`: Invalid request
- `401`: Missing or invalid API key. `code` is `missing_credentials` when no Authorization header was sent and `invalid_credentials` when the key is unknown, revoked or expired.
- `402`: Analytics access required. Legacy plans need the Analytics add-on; included by default on usage-based plans.
- `403`: API key scope violation
- `404`: Post or account not found

## Changes

- **2026-10-28** `8f2c44dd7550`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/zernio/apis/zernio-api/changes/v1/analytics/tracking/post.md)

---

[API](https://skmtc.dev/zernio/apis/zernio-api.md) - [All operations](https://skmtc.dev/zernio/apis/zernio-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zernio/apis/zernio-api/revisions/c319eb5d95b6?raw)
