Slimlytics Collection API
Privacy-preserving browser event ingestion.
Privacy-preserving browser event ingestion.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/slimlytics-com:slimlytics-com-collection-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Slimlytics Collection API
version: 1.0.0
description: 'Account, personal API token, site configuration, privacy-preserving collection, reporting, goals, export, and real-time APIs for Slimlytics.
Use a short-lived session JWT for creating personal API tokens. Use a `slyt_…` personal API token for durable CLI and agent access. Both use `Authorization: Bearer `. Collection write keys authorize ingestion only.'
license:
name: MIT
identifier: MIT
servers:
- url: https://slimlytics.com
description: Slimlytics Cloud
security:
- bearerAuth: []
tags:
- name: Collection
description: Privacy-preserving browser event ingestion.
paths:
/api/collect/{writeKey}:
get:
tags:
- Collection
summary: Test a collection endpoint
operationId: testCollector
responses:
'200':
description: Non-ingesting diagnostic response
content:
application/json:
schema:
$ref: '#/components/schemas/Health'
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
text/plain:
schema:
type: string
example: Failed to deserialize path parameters
'404':
description: Resource not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Internal service error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Credential lacks permission
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
security: []
parameters:
- name: writeKey
in: path
required: true
description: Site collection write-key UUID
schema:
type: string
format: uuid
post:
tags:
- Collection
summary: Collect a browser analytics event
operationId: collectEvent
responses:
'202':
description: Event accepted
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
text/plain:
schema:
type: string
example: Failed to deserialize path parameters
'403':
description: Credential lacks permission
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Resource not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'429':
description: Rate limit exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Internal service error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'415':
description: Request Content-Type is not application/json
content:
text/plain:
schema:
type: string
'422':
description: JSON body could not be deserialized
content:
text/plain:
schema:
type: string
description: Uses the collection write key and Origin validation, not account authentication.
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CollectInput'
parameters:
- name: writeKey
in: path
required: true
description: Site collection write-key UUID
schema:
type: string
format: uuid
options:
tags:
- Collection
summary: Collector CORS preflight
operationId: collectorPreflight
responses:
'204':
description: CORS preflight accepted
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
text/plain:
schema:
type: string
example: Failed to deserialize path parameters
'403':
description: Credential lacks permission
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Resource not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Internal service error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
security: []
parameters:
- name: writeKey
in: path
required: true
description: Site collection write-key UUID
schema:
type: string
format: uuid
/api/e/{writeKey}:
get:
tags:
- Collection
summary: Test the neutral collection alias
operationId: testNeutralCollector
responses:
'200':
description: Non-ingesting diagnostic response
content:
application/json:
schema:
$ref: '#/components/schemas/Health'
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
text/plain:
schema:
type: string
example: Failed to deserialize path parameters
'404':
description: Resource not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Internal service error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Credential lacks permission
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
security: []
parameters:
- name: writeKey
in: path
required: true
description: Site collection write-key UUID
schema:
type: string
format: uuid
post:
tags:
- Collection
summary: Collect through the neutral alias
operationId: collectNeutralEvent
responses:
'202':
description: Event accepted
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
text/plain:
schema:
type: string
example: Failed to deserialize path parameters
'403':
description: Credential lacks permission
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Resource not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'429':
description: Rate limit exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Internal service error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'415':
description: Request Content-Type is not application/json
content:
text/plain:
schema:
type: string
'422':
description: JSON body could not be deserialized
content:
text/plain:
schema:
type: string
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CollectInput'
parameters:
- name: writeKey
in: path
required: true
description: Site collection write-key UUID
schema:
type: string
format: uuid
options:
tags:
- Collection
summary: Neutral collector CORS preflight
operationId: neutralCollectorPreflight
responses:
'204':
description: CORS preflight accepted
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
text/plain:
schema:
type: string
example: Failed to deserialize path parameters
'403':
description: Credential lacks permission
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Resource not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Internal service error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
security: []
parameters:
- name: writeKey
in: path
required: true
description: Site collection write-key UUID
schema:
type: string
format: uuid
/api/ingest:
post:
tags:
- Collection
summary: Ingest a batch of trusted server request events and server-confirmed custom…
description: Uses a separate rotatable site secret. Raw client IP values are transformed for rotating identity and optional GeoIP, then discarded. Stable per-event idempotency keys make log retries safe. One invalid event rejects the whole batch; unknown fields are ignored.
operationId: ingestServerEvents
security:
- serverWriteKey: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- events
properties:
events:
type: array
minItems: 1
maxItems: 100
items:
type: object
required:
- url
- userAgent
- clientIp
properties:
idempotencyKey:
type: string
minLength: 8
maxLength: 128
url:
type: string
format: uri
userAgent:
type: string
maxLength: 1024
clientIp:
type: string
occurredAt:
type: string
format: date-time
referrer:
type: string
format: uri
method:
type: string
enum:
- GET
- HEAD
status:
type: integer
minimum: 100
maximum: 599
eventName:
type: string
pattern: ^[A-Za-z0-9_.-]{1,64}$
default: pageview
confirmed:
type: boolean
default: false
description: The caller's server confirmed this custom event, so it is counted even when its userAgent is classified as automated. Rejected with 400 on pageview events, which keep bot filtering.
properties:
type:
- object
- 'null'
additionalProperties: true
description: 'Flat event properties with the same limits as /api/collect: at most 16 KB serialized; a non-object is rejected with 400. A numeric revenue (0-1e12) and a three-letter currency are recorded as revenue. Never send personal data. Sent method and status override same-named properties.'
responses:
'202':
description: Batch processed
content:
application/json:
schema:
type: object
properties:
accepted:
type: integer
duplicates:
type: integer
'400':
$ref: '#/components/responses/BadRequest'
'404':
$ref: '#/components/responses/NotFound'
'429':
description: Rate limited
'500':
$ref: '#/components/responses/InternalError'
components:
responses:
InternalError:
description: Internal service error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
NotFound:
description: Site or resource not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
BadRequest:
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
schemas:
Health:
type: object
required:
- status
properties:
status:
type: string
examples:
- ok
CollectInput:
type: object
required:
- url
properties:
name:
type: string
default: pageview
url:
type: string
format: uri
referrer:
type:
- string
- 'null'
format: uri
title:
type:
- string
- 'null'
occurredAt:
type:
- string
- 'null'
format: date-time
properties:
type: object
additionalProperties: true
screenWidth:
type:
- integer
- 'null'
minimum: 0
privacyControl:
type:
- string
- 'null'
enum:
- gpc
- null
trackerVersion:
type:
- string
- 'null'
maxLength: 32
Error:
type: object
required:
- error
properties:
error:
type: object
required:
- code
- message
properties:
code:
type: string
enum:
- unauthorized
- forbidden
- not_found
- bad_request
- rate_limited
- internal_error
message:
type: string
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT or slyt_ personal API token
description: Session JWT or personal API token. Token creation specifically requires a session JWT.
sessionQuery:
type: apiKey
in: query
name: token
description: Short-lived session JWT for native EventSource clients. Never put personal API tokens in URLs.
serverWriteKey:
type: apiKey
in: header
name: X-Slimlytics-Server-Key
description: Rotatable site secret accepted only by server request ingestion.
externalDocs:
description: Complete Slimlytics CLI installation and command reference
url: https://slimlytics.com/docs/cli