Docs/Developers
The GraphQL API behind the Toki app. Read and change everything you manage in Toki — members and their balances, rewards, memberships, gift cards, campaigns and workflows — from your own code.
https://api.buildwithtoki.com/external/graphqlIn the Toki app, open Integrations and generate your Toki API Key (how). Keep it secret: it acts on your whole program.
POST a GraphQL query to the endpoint, with the key in the Authorization header.
You get back exactly the fields you asked for, as JSON.
curl https://api.buildwithtoki.com/external/graphql \
-H "Authorization: Bearer $TOKI_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "query": "{ users(first: 3) { nodes { id email name } } }" }'{
"data": {
"users": {
"nodes": [
{
"id": "6f3c2e97-6e3c-4d04-a13c-31bd703c302a",
"email": "anna@example.com",
"name": "Anna Petrova"
},
{
"id": "0b4d1f4e-58c1-4b45-a2f7-0f1b8e65c9d2",
"email": "li.wei@example.com",
"name": "Li Wei"
},
{
"id": "c1aa9f6b-03a8-4f1e-bf0d-77d5e4a1f2b3",
"email": "sam@example.com",
"name": null
}
]
}
}
}users in the reference lists every field and argument it takes.
Send your API key as a bearer token in the Authorization header of every request. Your account has one key at a time: regenerating it in the app revokes the old key immediately.
Many operations act on one store, which this reference calls the current store: your main store, or the one you pick with the X-Shop-Domain header if your account runs several. Operations that cover all your stores say so. A missing or invalid key is rejected with HTTP 401 or 403.
The key also signs the webhooks Toki sends you, so keep it on your servers — never in a browser or an app.
Every request is a POST with a JSON body: query holds the GraphQL document, variables its inputs, and operationName picks one operation when the document holds several.
Ask for exactly the fields you need. Related records are fields too, so a single request can follow them — a member's balances and latest orders, or an activity's completions. Related data is only loaded when you select it.
A response always has data. If anything went wrong it also has errors; see Errors.
Lists are connections: each page has its items in nodes and a pageInfo describing where it sits. Ask for the first page with first — 20 items unless you say otherwise, at most 250.
While pageInfo.hasNextPage is true, ask for the next page with after set to pageInfo.endCursor. To page backwards, use last with before set to pageInfo.startCursor.
Cursors are opaque: they belong to one list with the same arguments. Don't build or store them; take them from the page you just read.
Many lists take a query argument. Its description in the reference says what it matches: plain text, such as part of a name or an email address, or field:value filters on the fields it lists.
| status:active | equals |
| status:!=cancelled | doesn't equal |
| total_price:>100 | greater than |
| total_price:>=100 | greater than or equal |
| created_at:<2026-01-01 | before (less than) |
| created_at:<=-1w | on or before |
Dates take ISO values or relative ones: -24h, -30d, -1w, -6m, -1y. Separate terms with spaces to require all of them, or join them with OR to accept any.
Problems come back in errors, each with a machine-readable extensions.code. When input is invalid, extensions.fieldErrors lists every problem with the path of the field it concerns, ready to show next to a form field.
| BAD_USER_INPUT | An argument or input field is invalid. |
| FORBIDDEN | The key may not do this, or the record belongs to another account. |
| NOT_FOUND | The record doesn't exist, or isn't yours. |
| CONFLICT | The change clashes with the record's current state. Read it again and retry. |
| INTERNAL_SERVER_ERROR | Something failed on our side. The details are logged for us; the response never includes them. |
Partial success. Operations that take a list of IDs, such as approving activity completions, handle each ID on its own. They return the IDs that went through in succeededIds and one entry in errors for each ID that didn't, so a single bad ID never undoes the rest.
This reference is generated from the API itself and refreshed every day: every operation, field and description you read here comes from the schema the API runs.
Download the schema to generate typed clients, or browse every type. This page shows schema version 558985a32fa3.
Operations grouped the way the Toki app is organized.
Merchant shops, products, variants and community channels with cursor pagination.
5 queries
Import progress, failures and transfer rollbacks.
3 queries2 mutations
Store credits, exchange rules, membership rewards and activity administration.
9 queries9 mutations
Design embeds and integration lookups.
9 queries
Look up, create and update members, their notes, suspensions, referrals and total codes.
10 queries18 mutations
Points transactions, issued discounts and perks, and redeeming on a member's behalf.
4 queries3 mutations
Orders Toki has received from your stores.
2 queries
Ways to earn, the rewards they issue, and what members can spend points on.
11 queries13 mutations
Completed activities: list them, approve or deny submissions, credit a member by hand, or remove one.
2 queries4 mutations
Membership tiers and paid memberships, and when members entered or left them.
7 queries5 mutations
Members' subscriptions: plans, prices, pauses, cancellations, trials and billing history.
11 queries12 mutations
Groups of members who meet conditions you set, and each member's progress towards them.
6 queries5 mutations
Shared wallets for clubs and teams: groups, members, invitations and Shopify B2B companies.
6 queries11 mutations
Issued gift cards and the gift card products you sell.
4 queries7 mutations
Apple Wallet and Google Wallet pass designs, and the passes members have installed.
3 queries3 mutations
Product reviews, replies, review groups, product groups and the Google Shopping feed.
12 queries17 mutations
Push, email and wallet notifications, sent on a schedule or when something happens.
5 queries8 mutations
Automations built from a trigger, conditions and actions, and their executions.
4 queries5 mutations
Subscribe your own endpoints to events, and inspect every delivery.
1 query2 mutations
Program-wide settings, languages, translations, purchase rules and product recommendations.
9 queries8 mutations
Saved designs of Toki's storefront modules: create, edit and publish them, and open the theme editor to install them.
8 queries3 mutations
Connected apps, Tremendous payouts, past order imports and customer sign-in with Toki.
4 queries7 mutations
The stats, charts and tables from the Analytics page.
12 queries
Analytical reports, top customer rankings, sales summaries and reporting dataset descriptions.
1 query1 mutation