Skip to Content
Retentions

Create Retention

POST
/v0/projects/{idOrSlug}/retentions

Authorization

apiKeyAuth
headerx-api-key<token>

FastStats API key. Pass it in the x-api-key header or as a Bearer token in the Authorization header.

Path Parameters

idOrSlug*string

Request Body

application/json
  1. body
name*string
Length1 <= length <= 120
description?|null|null
definition*
display*
dashboardId?string|null|null
position?|null|null

Response Body

RetentionRecord

application/json
  1. response
id*string
projectId*string
name*string
description*string|null
definition*
display*
dashboardId*string|null
position*|null
createdAt*string
updatedAt*string
Example Request
curl -X POST 'https://api.faststats.dev/v0/projects/string/retentions' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "definition": {},
  "display": {}
}'
Example Response
{
  "id": "string",
  "projectId": "string",
  "name": "string",
  "description": "string",
  "definition": {
    "granularity": "day",
    "cohortType": "first",
    "returnType": "exact",
    "startEvent": "string",
    "returnEvent": "string",
    "filters": [
      {
        "field": "string",
        "operator": "is",
        "value": "string"
      }
    ]
  },
  "display": {
    "view": "curve"
  },
  "dashboardId": "string",
  "position": {
    "x": 0,
    "y": 0,
    "w": 0,
    "h": 0
  },
  "createdAt": "string",
  "updatedAt": "string"
}