Skip to main content
POST
/
s
/
events
Track experiment events
curl --request POST \
  --url https://api.pictify.io/s/events \
  --header 'Content-Type: application/json' \
  --header 'X-Write-Key: <api-key>' \
  --data '
{
  "event": "impression",
  "experiment": "homepage-hero-test",
  "variantId": "variant-a",
  "channel": "web",
  "device": "mobile",
  "referrer": "<string>",
  "metadata": {},
  "source": "api",
  "writeKey": "<string>"
}
'
{
  "ok": true,
  "processed": 1,
  "errors": [
    {
      "index": 123,
      "error": "<string>"
    }
  ],
  "warning": "<string>"
}

Authorizations

X-Write-Key
string
header
required

Write key for client-side experiment event tracking. Safe to expose in browser code.

Body

event
enum<string>
required

Event type

Available options:
impression,
view,
click,
conversion
experiment
string
required

Experiment slug

Maximum string length: 60
Example:

"homepage-hero-test"

variantId
string

Variant that triggered the event

Example:

"variant-a"

channel
enum<string>

Traffic channel

Available options:
web,
email,
ad,
in-app,
social,
other
device
enum<string>
Available options:
mobile,
desktop,
tablet
referrer
string
metadata
object

Custom metadata (max 10KB, max depth 3)

source
enum<string>
default:api
Available options:
sdk,
api
writeKey
string

Alternative to X-Write-Key header

Response

Events processed

ok
boolean
Example:

true

processed
integer
Example:

1

errors
object[]
warning
string

Returns 'write_key_recommended' if no write key was provided