Docs

Increment

Track goal completions via the API

Last updated:

This endpoint is what the Goals SDK calls under the hood. You can call it directly if you’re not using the SDK.

Increment a Goal

POST /v1/goals/increment Secret key
Increment a goal counter with optional metadata.
ParameterTypeRequiredDescription
goalId (body)stringThe goal slug ID (created in the dashboard)
propertyId (body)stringProperty the goal belongs to
sessionId (body)stringSession this conversion is attributed to. Alphanumeric with hyphens, max 128 chars. The Goals SDK fills this from the request via forRequest(req).
amount (body)numberFor revenue goals (kind: "revenue"), this is dollars booked and is summed into progress. For count goals (kind: "count"), this is ignored for progress and each call counts as one conversion.
metadata (body)objectKey-value string pairs for context. Max 5 keys, 256 chars per key and value.
Response
{ "success": true }
Example
bash
curl -X POST "https://api.sessionsight.com/v1/goals/increment" \
  -H "x-api-key: YOUR_SECRET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "goalId": "",
  "propertyId": "",
  "sessionId": "",
  "amount": "1",
  "metadata": ""
}'

Notes

  • The goalId must match a goal that already exists in your dashboard for the given property
  • metadata values must be strings