Slimlytics Sites API
Site lifecycle, canonical domains, collection keys, and settings.
Site lifecycle, canonical domains, collection keys, and settings.
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-sites-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 Sites 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: Sites
description: Site lifecycle, canonical domains, collection keys, and settings.
paths:
/api/sites:
get:
tags:
- Sites
summary: List sites
operationId: listSites
responses:
'200':
description: Sites owned by the current account
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Site'
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Authentication required or invalid/expired credential
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'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:
- bearerAuth: []
post:
tags:
- Sites
summary: Create a site
operationId: createSite
responses:
'201':
description: Site created
content:
application/json:
schema:
$ref: '#/components/schemas/Site'
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Authentication required or invalid/expired credential
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Credential lacks permission
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: Domains are canonicalized and globally unique.
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SiteInput'
/api/sites/ensure:
post:
tags:
- Sites
summary: Atomically ensure a site exists
operationId: ensureSite
responses:
'200':
description: Existing site reused
content:
application/json:
schema:
$ref: '#/components/schemas/EnsureSiteResponse'
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Authentication required or invalid/expired credential
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Credential lacks permission
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Internal service error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'201':
description: New site created
content:
application/json:
schema:
$ref: '#/components/schemas/EnsureSiteResponse'
'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: Idempotent agent operation backed by a transaction and global canonical-domain uniqueness.
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SiteInput'
/api/sites/{siteId}:
get:
tags:
- Sites
summary: Get a site
operationId: getSite
responses:
'200':
description: Site
content:
application/json:
schema:
$ref: '#/components/schemas/Site'
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
text/plain:
schema:
type: string
example: Failed to deserialize path parameters
'401':
description: Authentication required or invalid/expired credential
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'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:
- bearerAuth: []
parameters:
- name: siteId
in: path
required: true
description: Site UUID
schema:
type: string
format: uuid
put:
tags:
- Sites
summary: Replace site settings
operationId: updateSite
responses:
'200':
description: Updated site
content:
application/json:
schema:
$ref: '#/components/schemas/Site'
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
text/plain:
schema:
type: string
example: Failed to deserialize path parameters
'401':
description: Authentication required or invalid/expired credential
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'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'
'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:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SiteInput'
parameters:
- name: siteId
in: path
required: true
description: Site UUID
schema:
type: string
format: uuid
delete:
tags:
- Sites
summary: Delete a site
operationId: deleteSite
responses:
'204':
description: Site deleted
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
text/plain:
schema:
type: string
example: Failed to deserialize path parameters
'401':
description: Authentication required or invalid/expired credential
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'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:
- bearerAuth: []
parameters:
- name: siteId
in: path
required: true
description: Site UUID
schema:
type: string
format: uuid
/api/sites/{siteId}/rotate-key:
post:
tags:
- Sites
summary: Rotate the collection write key
operationId: rotateSiteWriteKey
responses:
'200':
description: Site with new collection key
content:
application/json:
schema:
$ref: '#/components/schemas/WriteKeyResponse'
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
text/plain:
schema:
type: string
example: Failed to deserialize path parameters
'401':
description: Authentication required or invalid/expired credential
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'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'
description: Immediately invalidates the prior collection key.
security:
- bearerAuth: []
parameters:
- name: siteId
in: path
required: true
description: Site UUID
schema:
type: string
format: uuid
/api/sites/{siteId}/icon:
get:
tags:
- Sites
summary: Get the site's stored favicon
description: Public, so an can load it. SVGs are served sandboxed.
operationId: getSiteIcon
security: []
parameters:
- name: siteId
in: path
required: true
description: Site UUID
schema:
type: string
format: uuid
responses:
'200':
description: Favicon image
content:
image/png:
schema:
type: string
format: binary
image/jpeg:
schema:
type: string
format: binary
image/gif:
schema:
type: string
format: binary
image/webp:
schema:
type: string
format: binary
image/x-icon:
schema:
type: string
format: binary
image/svg+xml:
schema:
type: string
format: binary
'404':
description: Resource not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
put:
tags:
- Sites
summary: Set the site's dashboard icon
operationId: updateSiteIcon
responses:
'200':
description: Updated site
content:
application/json:
schema:
$ref: '#/components/schemas/Site'
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
text/plain:
schema:
type: string
example: Failed to deserialize path parameters
'401':
description: Authentication required or invalid/expired credential
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'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'
'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:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SiteIconInput'
parameters:
- name: siteId
in: path
required: true
description: Site UUID
schema:
type: string
format: uuid
description: Initials on a colored tile, or the site's favicon (fetched from https://{domain}/ and stored).
/api/sites/{siteId}/rotate-server-key:
post:
tags:
- Sites
summary: Rotate the server ingestion key
operationId: rotateServerWriteKey
parameters:
- $ref: '#/components/parameters/SiteId'
responses:
'200':
description: New server ingestion key
content:
application/json:
schema:
type: object
required:
- serverWriteKey
properties:
serverWriteKey:
type: string
format: uuid
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalError'
/api/sites/{siteId}/rotate-proxy-key:
post:
tags:
- Sites
summary: Rotate the first-party proxy key
operationId: rotateProxyKey
parameters:
- $ref: '#/components/parameters/SiteId'
responses:
'200':
description: New proxy key
content:
application/json:
schema:
type: object
required:
- proxyKey
properties:
proxyKey:
type: string
format: uuid
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalError'
components:
schemas:
Site:
type: object
required:
- id
- name
- domain
- timezone
- allowedOrigins
- retentionDays
- writeKey
- serverWriteKey
- proxyKey
- antiAdblockServer
- antiAdblockJsPath
- antiAdblockBeaconPath
- iconMode
- iconBackground
- iconBackgroundEnd
- iconForeground
- iconUpdatedAt
- createdAt
properties:
id:
type: string
format: uuid
name:
type: string
domain:
type: string
timezone:
type: string
allowedOrigins:
type: array
items:
type: string
format: uri
retentionDays:
type: integer
writeKey:
type: string
format: uuid
description: Collection-only key; not an account credential
serverWriteKey:
type: string
format: uuid
description: Rotatable collection-only secret for trusted server request batches
proxyKey:
type: string
format: uuid
description: Server-side secret sent by the site's first-party proxy as X-Slimlytics-Proxy-Key with X-Slimlytics-Client-IP so locations and visitor IDs use the real visitor IP. Keep it out of public repositories; rotate with POST /api/sites/{siteId}/rotate-proxy-key if exposed
antiAdblockServer:
type: string
enum:
- caddy
- nginx
- apache
antiAdblockJsPath:
type: string
antiAdblockBeaconPath:
type: string
iconMode:
type: string
enum:
- initials
- favicon
description: 'Dashboard avatar: initials on a colored tile, or the website''s favicon'
iconBackground:
type:
- string
- 'null'
pattern: ^#[0-9a-f]{6}$
description: Tile gradient start; null uses an automatic per-domain hue
iconBackgroundEnd:
type:
- string
- 'null'
pattern: ^#[0-9a-f]{6}$
description: Tile gradient end; null keeps the background solid
iconForeground:
type:
- string
- 'null'
pattern: ^#[0-9a-f]{6}$
description: Initials color; null uses white
iconUpdatedAt:
type:
- string
- 'null'
format: date-time
description: When the stored favicon last changed; add it to the GET /api/sites/{siteId}/icon URL to bust caches
createdAt:
type: string
format: date-time
WriteKeyResponse:
type: object
required:
- writeKey
properties:
writeKey:
type: string
format: uuid
description: New collection-only write key
SiteIconInput:
type: object
required:
- mode
properties:
mode:
type: string
enum:
- initials
- favicon
description: favicon fetches the site's icon now and fails with 400 if none can be loaded
background:
type:
- string
- 'null'
pattern: ^(#[0-9a-fA-F]{6})?$
backgroundEnd:
type:
- string
- 'null'
pattern: ^(#[0-9a-fA-F]{6})?$
foreground:
type:
- string
- 'null'
pattern: ^(#[0-9a-fA-F]{6})?$
additionalProperties: false
EnsureSiteResponse:
type: object
required:
- created
- site
properties:
created:
type: boolean
site:
$ref: '#/components/schemas/Site'
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
SiteInput:
type: object
required:
- name
- domain
properties:
name:
type: string
minLength: 1
domain:
type: string
examples:
- example.com
timezone:
type: string
default: UTC
allowedOrigins:
type: array
items:
type: string
format: uri
retentionDays:
type: integer
minimum: 1
maximum: 3650
default: 365
additionalProperties: false
responses:
Forbidden:
description: Insufficient site role
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Unauthorized:
description: Authentication required
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
NotFound:
description: Site or resource not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
InternalError:
description: Internal service error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
parameters:
SiteId:
name: siteId
in: path
required: true
schema:
type: string
format: uuid
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