Activities API

Read your reward catalog (activity definitions) and every reward logged for your advocates (activities): requested, approved or rejected, with the wallet credit each approval paid. Your own systems can also log a reward for an advocate, which credits their wallet with the amount you set in Stoked.

Requires the activities permission. Logging a reward also needs activities:write.

Endpoint Returns
GET /api/v1/activity_definitions Your reward catalog
GET /api/v1/activity_definitions/:id One reward
GET /api/v1/activities A paginated list of activities
GET /api/v1/activities/:id One activity
POST /api/v1/activities Log a reward for an advocate, approved at once

List activity definitions

GET https://integrations.stokedhq.com/api/v1/activity_definitions

Every reward in your catalog, whether or not advocates can see or request it. Use it to find the id you send when you log an activity. A reward that has been logged can’t be deleted, so every activity_definition an activity points at is in this list.

Parameter Description
filter[created_since] Only rewards created at or after this time
filter[updated_since] Only rewards changed at or after this time
page[size], page[after], page[number] See Pagination
GET /api/v1/activity_definitions

cURL

curl "https://integrations.stokedhq.com/api/v1/activity_definitions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/vnd.api+json"

Ruby

require "net/http"
require "json"
uri = URI("https://integrations.stokedhq.com/api/v1/activity_definitions")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer YOUR_API_KEY"
request["Accept"] = "application/vnd.api+json"
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }
raise "HTTP #{response.code}: #{response.body}" unless response.is_a?(Net::HTTPSuccess)
puts JSON.parse(response.body)["data"]

Python

import requests
response = requests.get(
"https://integrations.stokedhq.com/api/v1/activity_definitions",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/vnd.api+json",
},
)
response.raise_for_status()
print(response.json()["data"])

C#

using System.Net.Http.Headers;
using System.Text.Json;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");
client.DefaultRequestHeaders.Accept.ParseAdd("application/vnd.api+json");
using var response = await client.GetAsync("https://integrations.stokedhq.com/api/v1/activity_definitions");
response.EnsureSuccessStatusCode();
using var document = JsonDocument.Parse(await response.Content.ReadAsStringAsync());
Console.WriteLine(document.RootElement.GetProperty("data"));

JavaScript

const url = new URL("https://integrations.stokedhq.com/api/v1/activity_definitions");
const response = await fetch(url, {
headers: {
Authorization: "Bearer YOUR_API_KEY",
Accept: "application/vnd.api+json",
},
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const { data } = await response.json();
console.log(data);
Response activity-definitions-index.json Download
{
"data": [
{
"type": "activity_definitions",
"id": "01k5examplereward000000001",
"attributes": {
"name": "Test ride completed",
"description": "Your prospect took a test ride.",
"amount": 25.0,
"currency_code": "PTS",
"wallet_id": "01k5examplewallet000000001",
"subject_type": "conversation",
"requires_approval": false,
"advocate_requestable": true,
"advocate_visible": true,
"notes_requirement": "none",
"limit_per_subject": 1,
"per_advocate_limit_count": null,
"per_advocate_limit_window": null,
"position": 1,
"created_at": "2026-08-20T14:00:00Z",
"updated_at": "2026-08-20T14:00:00Z"
},
"links": {
"self": "https://integrations.stokedhq.com/api/v1/activity_definitions/01k5examplereward000000001"
}
},
{
"type": "activity_definitions",
"id": "01k5examplereward000000002",
"attributes": {
"name": "Hosted a demo day",
"description": "Ran a demo day stand for at least two hours.",
"amount": 50.0,
"currency_code": "PTS",
"wallet_id": "01k5examplewallet000000001",
"subject_type": null,
"requires_approval": true,
"advocate_requestable": false,
"advocate_visible": true,
"notes_requirement": "none",
"limit_per_subject": 1,
"per_advocate_limit_count": null,
"per_advocate_limit_window": null,
"position": 2,
"created_at": "2026-08-20T14:00:00Z",
"updated_at": "2026-08-20T14:00:00Z"
},
"links": {
"self": "https://integrations.stokedhq.com/api/v1/activity_definitions/01k5examplereward000000002"
}
}
],
"links": {
"self": "https://integrations.stokedhq.com/api/v1/activity_definitions?page%5Bnumber%5D=1&page%5Bsize%5D=50",
"first": "https://integrations.stokedhq.com/api/v1/activity_definitions?page%5Bnumber%5D=1&page%5Bsize%5D=50",
"prev": null,
"next": null,
"last": "https://integrations.stokedhq.com/api/v1/activity_definitions?page%5Bnumber%5D=1&page%5Bsize%5D=50"
},
"meta": {
"page": 1,
"per_page": 50,
"total_count": 2,
"total_pages": 1,
"wallets": [
{
"id": "01k5examplewallet000000001",
"name": "Squad Points",
"unit_name": "points",
"currency_code": "PTS"
}
]
}
}

GET /api/v1/activity_definitions/:id returns one reward in the same shape.

Activity definition attributes

Records with "type": "activity_definitions".

Attribute Type Description
name string The reward’s name, which is also the reason on the wallet credit it pays
description string The description advocates see
amount number What it pays, in whole units: 50.0 is 50 points, or $50.00 in a cash wallet
currency_code string PTS for points, or an ISO 4217 code (USD, CAD)
wallet_id string The wallet it pays into: its entry in meta.wallets, the same id as in the advocate’s wallets array
subject_type string or null The record each claim must be tied to (conversation), or null. Rewards with a subject_type can’t be logged through the API yet.
requires_approval boolean Whether an advocate’s request waits for an admin. Rewards logged through the API are approved at once either way.
advocate_requestable boolean Whether advocates can request it from their site
advocate_visible boolean Whether advocates can see it on their site
notes_requirement string none, optional or required: whether a claim carries notes
limit_per_subject integer or null How many times it can be claimed for the same subject (only applies when subject_type is set). null is unlimited.
per_advocate_limit_count integer or null How many times one advocate can claim it per per_advocate_limit_window. null is unlimited.
per_advocate_limit_window string or null The window for that limit, such as month or lifetime
position integer Its order in Settings
created_at, updated_at timestamp  

Every response carries the community’s wallets in meta.wallets, as on wallet transactions.


List activities

GET https://integrations.stokedhq.com/api/v1/activities

With no filters, the list contains every activity in your community, deactivated advocates included. An activity changes when it’s reviewed, which moves its updated_at, so incremental syncing picks up approvals and rejections.

Parameter Description
filter[status] pending, approved or rejected, or a comma-separated list
filter[advocate] Only this advocate’s activities, by advocate id
filter[activity_definition] Only activities for this reward, by id
filter[created_since] Only activities logged at or after this time
filter[updated_since] Only activities changed at or after this time
page[size], page[after], page[number] See Pagination

An advocate or reward id that doesn’t belong to your community returns 400 rather than an empty list.

GET /api/v1/activities

cURL

curl -G "https://integrations.stokedhq.com/api/v1/activities" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/vnd.api+json" \
--data-urlencode "filter[updated_since]=2026-09-01T00:00:00Z"

Ruby

require "net/http"
require "json"
uri = URI("https://integrations.stokedhq.com/api/v1/activities")
uri.query = URI.encode_www_form("filter[updated_since]" => "2026-09-01T00:00:00Z")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer YOUR_API_KEY"
request["Accept"] = "application/vnd.api+json"
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }
raise "HTTP #{response.code}: #{response.body}" unless response.is_a?(Net::HTTPSuccess)
puts JSON.parse(response.body)["data"]

Python

import requests
response = requests.get(
"https://integrations.stokedhq.com/api/v1/activities",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/vnd.api+json",
},
params={"filter[updated_since]": "2026-09-01T00:00:00Z"},
)
response.raise_for_status()
print(response.json()["data"])

C#

using System.Net.Http.Headers;
using System.Text.Json;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");
client.DefaultRequestHeaders.Accept.ParseAdd("application/vnd.api+json");
using var response = await client.GetAsync("https://integrations.stokedhq.com/api/v1/activities?filter[updated_since]=2026-09-01T00:00:00Z");
response.EnsureSuccessStatusCode();
using var document = JsonDocument.Parse(await response.Content.ReadAsStringAsync());
Console.WriteLine(document.RootElement.GetProperty("data"));

JavaScript

const url = new URL("https://integrations.stokedhq.com/api/v1/activities");
url.searchParams.set("filter[updated_since]", "2026-09-01T00:00:00Z");
const response = await fetch(url, {
headers: {
Authorization: "Bearer YOUR_API_KEY",
Accept: "application/vnd.api+json",
},
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const { data } = await response.json();
console.log(data);
Response activities-index.json Download
{
"data": [
{
"type": "activities",
"id": "01k5exampleact1v1ty0000001",
"attributes": {
"status": "approved",
"approved_via": "auto",
"reversal": false,
"notes": "",
"rejection_reason": "",
"external_id": null,
"reviewed_at": "2026-09-06T18:00:00Z",
"created_at": "2026-09-06T18:00:00Z",
"updated_at": "2026-09-06T18:00:00Z"
},
"relationships": {
"advocate": {
"data": {
"type": "advocates",
"id": "01k5exampleadv0cate0000001"
},
"links": {
"related": "https://integrations.stokedhq.com/api/v1/advocates/01k5exampleadv0cate0000001"
}
},
"activity_definition": {
"data": {
"type": "activity_definitions",
"id": "01k5examplereward000000001"
},
"links": {
"related": "https://integrations.stokedhq.com/api/v1/activity_definitions/01k5examplereward000000001"
}
},
"reviewed_by": {
"data": null
},
"wallet_transaction": {
"data": {
"type": "wallet_transactions",
"id": "01k5examplewallettxn000011"
},
"links": {
"related": "https://integrations.stokedhq.com/api/v1/wallet_transactions/01k5examplewallettxn000011"
}
},
"subject": {
"data": {
"type": "conversations",
"id": "01k5examplec0nversat10n001"
},
"links": {
"related": "https://integrations.stokedhq.com/api/v1/conversations/01k5examplec0nversat10n001"
}
}
},
"links": {
"self": "https://integrations.stokedhq.com/api/v1/activities/01k5exampleact1v1ty0000001"
}
},
{
"type": "activities",
"id": "01k5exampleact1v1ty0000002",
"attributes": {
"status": "approved",
"approved_via": "manual",
"reversal": false,
"notes": "Springfield farmers market",
"rejection_reason": "",
"external_id": "demo-day-2026-09-13",
"reviewed_at": "2026-09-13T16:00:00Z",
"created_at": "2026-09-13T16:00:00Z",
"updated_at": "2026-09-13T16:00:00Z"
},
"relationships": {
"advocate": {
"data": {
"type": "advocates",
"id": "01k5exampleadv0cate0000001"
},
"links": {
"related": "https://integrations.stokedhq.com/api/v1/advocates/01k5exampleadv0cate0000001"
}
},
"activity_definition": {
"data": {
"type": "activity_definitions",
"id": "01k5examplereward000000002"
},
"links": {
"related": "https://integrations.stokedhq.com/api/v1/activity_definitions/01k5examplereward000000002"
}
},
"reviewed_by": {
"data": {
"type": "admins",
"id": "01k5exampleadm1n0000000001"
}
},
"wallet_transaction": {
"data": {
"type": "wallet_transactions",
"id": "01k5examplewallettxn000012"
},
"links": {
"related": "https://integrations.stokedhq.com/api/v1/wallet_transactions/01k5examplewallettxn000012"
}
},
"subject": {
"data": null
}
},
"links": {
"self": "https://integrations.stokedhq.com/api/v1/activities/01k5exampleact1v1ty0000002"
}
}
],
"links": {
"self": "https://integrations.stokedhq.com/api/v1/activities?filter%5Bupdated_since%5D=2026-09-01T00%3A00%3A00Z&page%5Bnumber%5D=1&page%5Bsize%5D=50",
"first": "https://integrations.stokedhq.com/api/v1/activities?filter%5Bupdated_since%5D=2026-09-01T00%3A00%3A00Z&page%5Bnumber%5D=1&page%5Bsize%5D=50",
"prev": null,
"next": null,
"last": "https://integrations.stokedhq.com/api/v1/activities?filter%5Bupdated_since%5D=2026-09-01T00%3A00%3A00Z&page%5Bnumber%5D=1&page%5Bsize%5D=50"
},
"meta": {
"page": 1,
"per_page": 50,
"total_count": 2,
"total_pages": 1
}
}

GET /api/v1/activities/:id returns one activity in the same shape. An ID that doesn’t exist in your community returns 404.

Activity attributes

Records with "type": "activities".

Attribute Type Description
status string pending (waiting for an admin), approved or rejected
approved_via string or null manual (an admin approved it, or an API key they created logged it) or auto (a reward that needs no approval). null until approved.
reversal boolean true for a reversal, which takes a reward back (a refunded Shopify order, for example)
notes string Notes from whoever logged it, such as the advocate’s request. Empty when there are none.
rejection_reason string Why an admin rejected it. Empty otherwise.
external_id string or null The external_id your system sent when it logged the activity. null for every other activity.
reviewed_at timestamp or null When it was approved or rejected
created_at, updated_at timestamp  
Relationship Type Description
advocate advocates Who earned it
activity_definition activity_definitions Which reward
reviewed_by admins The admin who approved or rejected it, or who created the API key that logged it. null while pending and for automatic approvals.
wallet_transaction wallet_transactions The wallet credit (or, for a reversal, debit) its approval made. null until approved.
subject conversations, … The record the claim is tied to, when the API serves it. null otherwise.

Log an activity

POST https://integrations.stokedhq.com/api/v1/activities

Log a reward from your catalog for an advocate, such as for helping at an event you track in your own system. It’s approved at once, the same as clicking the reward on the advocate’s wallet in the admin portal, so the advocate’s wallet is credited with the reward’s amount and the reward’s name is the reason they see. Requires both activities and activities:write.

Only these attributes are accepted; anything else is a 422 that names it.

Attribute Description
advocate_id The advocate’s id, from the Advocates API. Inactive advocates are allowed.
activity_definition_id The reward’s id, from List activity definitions
external_id Your own id for what is being rewarded, such as an event id, up to 255 characters. Stored exactly as sent. Required. See Retrying safely.
notes Optional notes. Required when the reward’s notes_requirement is required.
curl -X POST https://integrations.stokedhq.com/api/v1/activities \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/vnd.api+json" \
  -d '{"data": {"type": "activities", "attributes": {"advocate_id": "ADVOCATE_ID", "activity_definition_id": "REWARD_ID", "external_id": "demo-day-2026-12", "notes": "Springfield farmers market"}}}'

The response is 201 Created with the new activity, in the same shape as the list, its wallet_transaction pointing at the credit it made.

  • It’s approved by the admin who created the API key. reviewed_by is that admin and approved_via is manual. If that admin has been deleted, the request is a 422; create a new key.
  • The reward’s limits still apply. A claim past its per-advocate limit is a 422, and nothing is saved.
  • The advocate’s type must be able to earn it. A reward whose wallet the advocate’s type isn’t included in is a 422.
  • Rewards tied to a record can’t be logged yet. A reward with a subject_type is a 422; log it in the admin portal.

To add or remove an amount you choose rather than one from your catalog, use Create a wallet transaction.

Retrying safely

Each advocate can be given each reward once per external_id: sending the same external_id again for the same advocate and reward is a 409, and meta.existing_id on the error is the id of the activity that already went through. A request that timed out, or a whole night’s batch, can be re-sent without paying twice.

The same external_id works for different advocates and different rewards, so an event’s id covers everyone who attended it and every reward they earned there.


Keeping a copy in sync

  1. On the first run, follow links.next through everything and upsert each activity by id
  2. Remember the newest updated_at you received
  3. On the next run, pass it as filter[updated_since], follow links.next to the end, and upsert each activity by id. Approvals and rejections since the last run come back with it.

© 2024-2026 Stoked — Real conversations. Real trust.