---
title: "Collect a browser analytics event"
method: POST
path: "/api/collect/{writeKey}"
tags: ["Collection"]
---

# Collect a browser analytics event

`POST /api/collect/{writeKey}`

## Request

- Base URL: `https://slimlytics.com`
- URL: `https://slimlytics.com/api/collect/{writeKey}`
- Auth: none required

Uses the collection write key and Origin validation, not account authentication.

## Path parameters

- `writeKey` string, uuid, required

## Request body

- CollectInput
  - `name` string
  - `url` string, uri, required
  - `referrer` string, uri, nullable
  - `title` string, nullable
  - `occurredAt` string, date-time, nullable
  - `properties` object
  - `screenWidth` integer, nullable
  - `privacyControl` 'gpc' | 'null', nullable
  - `trackerVersion` string, nullable

## Response `202`

Event accepted

## Other responses

- `400`: Invalid request
- `403`: Credential lacks permission
- `404`: Resource not found
- `415`: Request Content-Type is not application/json
- `422`: JSON body could not be deserialized
- `429`: Rate limit exceeded
- `500`: Internal service error

---

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