API Reference

Track

The Track call records actions users perform in your product. It is the primary mechanism for capturing behavioral data — from lifecycle events like sign-up and account creation, to feature engagement, onboarding steps, page visits, and viral actions.

When to call

Call track whenever a meaningful user action occurs. Every event has a name and optional properties that describe what happened.

  • Lifecycle eventsSignup, account creation, subscription changes, cancellations.
  • Feature engagementEach time a user interacts with a core or secondary product feature.
  • Onboarding stepsCompletion of profile setup, first actions, guided tour steps.
  • Viral actionsInvitations sent, referrals, team member additions.

Event naming conventions

Use a consistent object + past-tense verb format for all event names. This keeps your event taxonomy readable across teams and tools.

GoodAvoid
signed_upsignup, user_signup_event
account_createdcreate_account, new_account
feature_usedevent_12, clicked
invite_sentsend_invite, invitation
profile_completedprofile_done, onboarding

Endpoint

POST /api/track

Authentication

Pass your API key in the x-api-key header on every request. You can find your key in the ThriveStack dashboard under Settings → API Keys.

accept: */*
content-type: application/json
x-api-key: YOUR_API_KEY

Request body

Send an array containing one or more track objects.

FieldTypeRequiredDescription
event_namestringYesName of the action that occurred. Use past-tense, descriptive names (e.g., "signed_up", "feature_used").
user_idstringYesThe user who performed the action.
propertiesobjectNoFree-form key-value pairs describing the event. See Reserved properties below.
context.group_idstringNoThe account associated with this event. Required for account-level signal correlation.
context.device_idstringNoUnique identifier for the user's device.
context.session_idstringNoCurrent session identifier.
context.sourcestringNo"product" for in-app events, "marketing" for public-facing website events.
timestampstringNoISO 8601 timestamp. Defaults to the time the server receives the request.

Reserved properties

ThriveStack recognises the following property names and gives them special handling in revenue and growth analytics.

PropertyTypeDescription
revenuenumberDollar amount associated with the event (e.g., MRR change). Use decimal format: 49.99.
currencystringISO 4217 currency code (e.g., "USD"). Defaults to "USD" if omitted.
valuenumberAbstract numeric value for non-revenue events (e.g., points, score).
feature_namestringName of the product feature involved.
feature_typestringClassification of the feature: "core", "secondary", "add-on".
page_urlstringFull URL of the page where the event occurred.
page_pathstringPath portion of the URL (e.g., "/dashboard").
page_referrerstringURL of the referring page.
utm_sourcestringUTM source parameter for attribution.
utm_mediumstringUTM medium parameter for attribution.
utm_campaignstringUTM campaign parameter for attribution.

Standard events

These are the ThriveStack lifecycle events that power the bow-tie revenue model and growth dashboards. Instrument them to unlock the full platform.

event_nameWhen to fireKey properties
signed_upNew user completes registrationuser_email, utm_source, utm_campaign
account_createdNew workspace/organization createdaccount_name, account_domain, account_id
account_added_userUser linked to an existing accountaccount_name, user_email
feature_usedUser engages with a product featurefeature_name, feature_type, user_role
profile_completedUser completes an onboarding stepcompletion_status, user_role
invite_sentUser invites another personinvitee_email, invitee_role, feature_name
page_visitUser visits a pagepage_url, page_path, page_referrer, UTM fields

Examples

Signup

curl --location 'https://api.app.thrivestack.ai/api/track' \
--header 'accept: */*' \
--header 'content-type: application/json' \
--header 'x-api-key: YOUR_API_KEY' \
--data '[
  {
    "event_name": "signed_up",
    "properties": {
      "user_email": "john.doe@acme.com",
      "user_name": "John Doe",
      "utm_campaign": "customer_success",
      "utm_medium": "referral",
      "utm_source": "twitter",
      "utm_term": "free_trial"
    },
    "user_id": "18f716ac-37a4-464f-adb7-3cc30032308c",
    "timestamp": "2024-01-15T10:30:00Z"
  }
]'

Account created

curl --location 'https://api.app.thrivestack.ai/api/track' \
--header 'accept: */*' \
--header 'content-type: application/json' \
--header 'x-api-key: YOUR_API_KEY' \
--data '[
  {
    "event_name": "account_created",
    "properties": {
      "account_domain": "acme.com",
      "account_id": "ac8db7ba-5139-4911-ba6e-523fd9c4704b",
      "account_name": "Acme Corporation"
    },
    "user_id": "18f716ac-37a4-464f-adb7-3cc30032308c",
    "timestamp": "2024-01-15T10:30:00Z",
    "context": {
      "group_id": "ac8db7ba-5139-4911-ba6e-523fd9c4704b"
    }
  }
]'

Feature engagement

curl --location 'https://api.app.thrivestack.ai/api/track' \
--header 'accept: */*' \
--header 'content-type: application/json' \
--header 'x-api-key: YOUR_API_KEY' \
--data '[
  {
    "event_name": "feature_used",
    "properties": {
      "feature_name": "export_report",
      "feature_type": "core",
      "user_role": "admin"
    },
    "user_id": "18f716ac-37a4-464f-adb7-3cc30032308c",
    "timestamp": "2024-01-15T10:30:00Z",
    "context": {
      "group_id": "ac8db7ba-5139-4911-ba6e-523fd9c4704b"
    }
  }
]'

Invite sent

curl --location 'https://api.app.thrivestack.ai/api/track' \
--header 'accept: */*' \
--header 'content-type: application/json' \
--header 'x-api-key: YOUR_API_KEY' \
--data '[
  {
    "event_name": "invite_sent",
    "properties": {
      "feature_name": "report",
      "invitee_email": "jane.doe@acme.com",
      "invitee_role": "Admin",
      "invitee_user_id": "ed1adb3a-9772-48ef-b620-e5e6d438fb82",
      "sub_feature_name": "export_report",
      "source_url": "https://acme.com/dashboard"
    },
    "user_id": "18f716ac-37a4-464f-adb7-3cc30032308c",
    "timestamp": "2024-01-15T10:30:00Z",
    "context": {
      "group_id": "ac8db7ba-5139-4911-ba6e-523fd9c4704b"
    }
  }
]'

Page visit

curl --location 'https://api.app.thrivestack.ai/api/track' \
--header 'accept: */*' \
--header 'content-type: application/json' \
--header 'x-api-key: YOUR_API_KEY' \
--data '[
  {
    "event_name": "page_visit",
    "properties": {
      "page_title": "what is acme",
      "page_url": "https://acme.com/what_is_acme",
      "page_path": "/what_is_acme",
      "page_referrer": "https://google.com",
      "utm_campaign": "summer_promotion",
      "utm_medium": "email",
      "utm_source": "newsletter"
    },
    "user_id": "18f716ac-37a4-464f-adb7-3cc30032308c",
    "timestamp": "2024-01-15T10:30:00Z",
    "context": {
      "group_id": "ac8db7ba-5139-4911-ba6e-523fd9c4704b",
      "device_id": "7d08298f",
      "session_id": "session_e2iukz3vduo",
      "source": "product"
    }
  }
]'

JavaScript (generic)

const myHeaders = new Headers();
myHeaders.append("accept", "*/*");
myHeaders.append("content-type", "application/json");
myHeaders.append("x-api-key", "YOUR_API_KEY");

const raw = JSON.stringify([
  {
    event_name: "feature_used",
    properties: {
      feature_name: "export_report",
      feature_type: "core",
      user_role: "admin"
    },
    user_id: "18f716ac-37a4-464f-adb7-3cc30032308c",
    timestamp: "2024-01-15T10:30:00Z",
    context: {
      group_id: "ac8db7ba-5139-4911-ba6e-523fd9c4704b"
    }
  }
]);

fetch("https://api.app.thrivestack.ai/api/track", {
  method: "POST",
  headers: myHeaders,
  body: raw,
  redirect: "follow"
})
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));

Python (generic)

import requests
import json

url = "https://api.app.thrivestack.ai/api/track"

payload = json.dumps([
  {
    "event_name": "feature_used",
    "properties": {
      "feature_name": "export_report",
      "feature_type": "core",
      "user_role": "admin"
    },
    "user_id": "18f716ac-37a4-464f-adb7-3cc30032308c",
    "timestamp": "2024-01-15T10:30:00Z",
    "context": {
      "group_id": "ac8db7ba-5139-4911-ba6e-523fd9c4704b"
    }
  }
])
headers = {
  'accept': '*/*',
  'content-type': 'application/json',
  'x-api-key': 'YOUR_API_KEY'
}

response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Response

200 OK

{
  "success": true,
  "eventId": "evt_abc123xyz"
}

Error codes

StatusMeaning
400Bad Request — invalid JSON or missing required fields
401Unauthorized — invalid or missing API key
429Rate Limit Exceeded
500Server Error — try again later