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 keyIncrement a goal counter with optional metadata.
| Parameter | Type | Required | Description |
|---|---|---|---|
| goalId (body) | string | ✓ | The goal slug ID (created in the dashboard) |
| propertyId (body) | string | ✓ | Property the goal belongs to |
| sessionId (body) | string | ✓ | Session this conversion is attributed to. Alphanumeric with hyphens, max 128 chars. The Goals SDK fills this from the request via forRequest(req). |
| amount (body) | number | For 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) | object | Key-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
goalIdmust match a goal that already exists in your dashboard for the given property metadatavalues must be strings