Skip to Content
Event Definitions

Preview Event Rule

POST
/v0/projects/{idOrSlug}/event-rules/preview

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
pattern*string
Length1 <= length <= 200
sentWith*|null
properties*array<>
Itemsitems <= 50
unknownProperties*string
Value in"allow""drop""reject"
previousPattern?|null

Response Body

EventRulePreview

application/json
  1. response
sampled*number|
rejected*number|
reasons*array<>
dropped*array<>
examples*array<>
Example Request
curl -X POST 'https://api.faststats.dev/v0/projects/string/event-rules/preview' \
  -H 'Content-Type: application/json' \
  -d '{
  "pattern": "string",
  "sentWith": "api_key",
  "properties": [
    {
      "key": "string",
      "type": "string",
      "required": true,
      "values": [
        "string"
      ],
      "min": 0,
      "max": 0
    }
  ],
  "unknownProperties": "allow"
}'
Example Response
{
  "sampled": 0,
  "rejected": 0,
  "reasons": [
    {
      "count": 0,
      "message": "string"
    }
  ],
  "dropped": [
    {
      "count": 0,
      "key": "string"
    }
  ],
  "examples": [
    {
      "eventName": "string",
      "properties": "string",
      "problems": [
        "string"
      ]
    }
  ]
}