Push, email and wallet notifications, sent on a schedule or when something happens.
A campaign sends a message to members by push notification to their wallet pass, email or wallet notification. manual campaigns send to their whole audience at the times in settings.executions; automatically campaigns message a member each time they trigger the campaign's event. campaignTest and emailTemplateTestSend send real messages right away to the members you choose.
campaignReturns a campaign, or null if it doesn't exist.campaignsLists your campaigns, newest first.campaignCountsCounts how many of a campaign's notifications reached members: push notifications delivered to wallet passes and wallet notifications viewed.campaignCreateCreates a campaign.campaignUpdateUpdates a campaign, replacing its fields with campaign; an omitted segmentId or action keeps its value.campaignDeleteDeletes a campaign and cancels its waiting scheduled sends, including queued audience batches.campaignTestSends the enabled messages in settings to the members in userIds right away, without creating a campaign.emailTemplatesLists the current merchant's email templates, newest first, optionally searching names and descriptions.emailTemplateReturns one email template belonging to the current merchant, including its HTML and plain text bodies.emailTemplateUpsertCreates an email template, or updates an existing template belonging to the current merchant when id is provided.emailTemplateDeleteDeletes one email template belonging to the current merchant.emailTemplatePreviewSendSends an HTML preview to a member of the current merchant with the subject Email Template Preview.emailTemplateTestSendSends a test email to one member right away, from the sender in your store's email settings.Returns a campaign, or null if it doesn't exist. Unlike campaigns, it fills in settings.executions with the scheduled sends and their live status.
idID!RequiredThe campaign's campaignId.
A message Toki sends to members by wallet pass push notification, email or wallet notification, either at times you schedule (manual) or when a member triggers its event (automatically).
campaignIdID!The ID the other campaign operations take as id.
merchantIdID!Your merchant ID, shown under Settings in the Toki app.
nameString!typeTokiCampaignType!How a campaign sends: a manual campaign (On Schedule in the Toki app) sends to its whole audience at the times in settings.executions, and an automatically campaign messages a member each time they trigger its action.type.
manualautomaticallysegmentIdIDOnly members of this segment receive the campaign; null sends it to all members.
createdAtString!updatedAtString!statusString!active or inactive (a draft). Only active campaigns react to member events or queue scheduled sends, and deactivating a campaign cancels its sends that are still waiting.
settingsTokiCampaignSettings!The message for each channel (push, email, wallet), the condition automatic sends must meet, and a manual campaign's scheduled sends in executions, each with its current status. Only campaign, campaignCreate and campaignUpdate fill in executions; in campaigns it is always empty.
actionTokiCampaignActionObjectFor automatically campaigns, the member event that triggers a send, in type, such as points_earned or tier_unlocked. manual campaigns ignore it.
Lists your campaigns, newest first. settings.executions is always empty here; use campaign to read scheduled sends.
reverseBooleanReverse the sort order.
typeTokiCampaignTypeOnly items whose type equals this value.
manualautomaticallyA page of TokiCampaign in nodes, with pageInfo for the next page. Each item:
A message Toki sends to members by wallet pass push notification, email or wallet notification, either at times you schedule (manual) or when a member triggers its event (automatically).
campaignIdID!The ID the other campaign operations take as id.
merchantIdID!Your merchant ID, shown under Settings in the Toki app.
nameString!typeTokiCampaignType!How a campaign sends: a manual campaign (On Schedule in the Toki app) sends to its whole audience at the times in settings.executions, and an automatically campaign messages a member each time they trigger its action.type.
manualautomaticallysegmentIdIDOnly members of this segment receive the campaign; null sends it to all members.
createdAtString!updatedAtString!statusString!active or inactive (a draft). Only active campaigns react to member events or queue scheduled sends, and deactivating a campaign cancels its sends that are still waiting.
settingsTokiCampaignSettings!The message for each channel (push, email, wallet), the condition automatic sends must meet, and a manual campaign's scheduled sends in executions, each with its current status. Only campaign, campaignCreate and campaignUpdate fill in executions; in campaigns it is always empty.
actionTokiCampaignActionObjectFor automatically campaigns, the member event that triggers a send, in type, such as points_earned or tier_unlocked. manual campaigns ignore it.
Counts how many of a campaign's notifications reached members: push notifications delivered to wallet passes and wallet notifications viewed. Test sends aren't counted.
idID!RequiredThe campaign's campaignId.
Delivery counts for a campaign: push counts its push notifications that reached a member's wallet pass, and wallet its wallet notifications that members have viewed and not deleted.
campaignIdString!The id you asked for.
pushInt!How many of the campaign's push notifications reached a member's wallet pass.
walletInt!How many of the campaign's wallet notifications members have viewed and not deleted.
Creates a campaign. If status is active, it goes live at once: an automatically campaign messages members as they trigger action.type, and a manual campaign queues a send to its audience for each entry in settings.executions, at its scheduledAt (ISO 8601) or right away if that is empty or past.
campaignTokiCampaignInput!RequiredThe campaign to save. Its fields mean the same as on TokiCampaign.
A message Toki sends to members by wallet pass push notification, email or wallet notification, either at times you schedule (manual) or when a member triggers its event (automatically).
campaignIdID!The ID the other campaign operations take as id.
merchantIdID!Your merchant ID, shown under Settings in the Toki app.
nameString!typeTokiCampaignType!How a campaign sends: a manual campaign (On Schedule in the Toki app) sends to its whole audience at the times in settings.executions, and an automatically campaign messages a member each time they trigger its action.type.
manualautomaticallysegmentIdIDOnly members of this segment receive the campaign; null sends it to all members.
createdAtString!updatedAtString!statusString!active or inactive (a draft). Only active campaigns react to member events or queue scheduled sends, and deactivating a campaign cancels its sends that are still waiting.
settingsTokiCampaignSettings!The message for each channel (push, email, wallet), the condition automatic sends must meet, and a manual campaign's scheduled sends in executions, each with its current status. Only campaign, campaignCreate and campaignUpdate fill in executions; in campaigns it is always empty.
actionTokiCampaignActionObjectFor automatically campaigns, the member event that triggers a send, in type, such as points_earned or tier_unlocked. manual campaigns ignore it.
Updates a campaign, replacing its fields with campaign; an omitted segmentId or action keeps its value. The campaign type cannot be changed after creation. For an active manual campaign, settings.executions entries without an id are queued as new sends, entries with an id and a canceledAt are canceled, and the rest are rescheduled to their scheduledAt and pick up your changes; leaving an existing entry out does not cancel it. Setting status to inactive cancels every send still waiting.
campaignTokiCampaignInput!RequiredThe campaign to save. Its fields mean the same as on TokiCampaign.
idID!RequiredThe campaign's campaignId.
A message Toki sends to members by wallet pass push notification, email or wallet notification, either at times you schedule (manual) or when a member triggers its event (automatically).
campaignIdID!The ID the other campaign operations take as id.
merchantIdID!Your merchant ID, shown under Settings in the Toki app.
nameString!typeTokiCampaignType!How a campaign sends: a manual campaign (On Schedule in the Toki app) sends to its whole audience at the times in settings.executions, and an automatically campaign messages a member each time they trigger its action.type.
manualautomaticallysegmentIdIDOnly members of this segment receive the campaign; null sends it to all members.
createdAtString!updatedAtString!statusString!active or inactive (a draft). Only active campaigns react to member events or queue scheduled sends, and deactivating a campaign cancels its sends that are still waiting.
settingsTokiCampaignSettings!The message for each channel (push, email, wallet), the condition automatic sends must meet, and a manual campaign's scheduled sends in executions, each with its current status. Only campaign, campaignCreate and campaignUpdate fill in executions; in campaigns it is always empty.
actionTokiCampaignActionObjectFor automatically campaigns, the member event that triggers a send, in type, such as points_earned or tier_unlocked. manual campaigns ignore it.
Deletes a campaign and cancels its waiting scheduled sends, including queued audience batches. Sending tasks check that the campaign is active and not deleted before sending. Messages already in delivery may still arrive.
idID!RequiredThe campaign's campaignId.
isDeleteNotificationsBooleanAlso delete the wallet notifications this campaign sent, so members no longer see them, and its push notifications not yet delivered. Defaults to false.
true when the change was made. Anything that stops it comes back as an error.
Sends the enabled messages in settings to the members in userIds right away, without creating a campaign. They are real messages, but placeholders stay as typed and nothing counts towards campaignCounts. Toki sends push, then wallet, then email, and stops at the first problem, which it returns in error.
userIds[ID!]!RequiredThe members who receive the test, by member ID (TokiUser.id).
settingsTokiCampaignSettingsInput!RequiredThe messages to send, as in TokiCampaign.settings. Only the enabled push, wallet and email messages are used.
The outcome of a test send.
resultStringThe report of the first channel that sent, such as Apple: Successfully sent, Google: Successfully sent for push or Successfully sent; null when error is set.
errorStringWhy the test stopped, such as No devices found for selected users when push is enabled but none of the members has your wallet pass; null on success.
Lists the current merchant's email templates, newest first, optionally searching names and descriptions.
ids[String!]Restrict results to these template IDs. An empty list returns none.
activeBooleanFilter non-deleted templates by activation status. Omit to keep the full editor catalogue.
searchStringCase-insensitive substring to match against template names and descriptions.
A page of TokiEmailTemplate in nodes, with pageInfo for the next page. Each item:
A reusable email template owned by a merchant.
idString!Unique saved template ID.
merchantIdString!The merchant that owns this template.
nameString!Template name shown in the merchant portal.
descriptionStringInternal description, or null if none was provided.
isActiveBoolean!Whether this template is marked active.
subjectString!Email subject line, which may contain placeholders.
bodyHtmlString!HTML email body, which may contain placeholders.
bodyTextString!Plain text body generated from the HTML when the template was saved.
createdAtString!When the template was created, as an ISO 8601 timestamp.
updatedAtString!When the template was last saved, as an ISO 8601 timestamp.
Returns one email template belonging to the current merchant, including its HTML and plain text bodies.
idString!RequiredID of a saved template belonging to the current merchant.
A reusable email template owned by a merchant.
idString!Unique saved template ID.
merchantIdString!The merchant that owns this template.
nameString!Template name shown in the merchant portal.
descriptionStringInternal description, or null if none was provided.
isActiveBoolean!Whether this template is marked active.
subjectString!Email subject line, which may contain placeholders.
bodyHtmlString!HTML email body, which may contain placeholders.
bodyTextString!Plain text body generated from the HTML when the template was saved.
createdAtString!When the template was created, as an ISO 8601 timestamp.
updatedAtString!When the template was last saved, as an ISO 8601 timestamp.
Creates an email template, or updates an existing template belonging to the current merchant when id is provided. Plain text is generated from the HTML body.
Email template content and activation settings.
idStringExisting template ID to update. Omit to create a new template.
nameString!RequiredNon-empty name shown in the merchant portal.
descriptionStringInternal description. Omit or pass null to clear it.
isActiveBooleanWhether to mark the saved template active. Defaults to false.
subjectString!RequiredNon-empty email subject line, with optional placeholders.
bodyHtmlString!RequiredNon-empty HTML body. The plain text version is generated automatically.
A reusable email template owned by a merchant.
idString!Unique saved template ID.
merchantIdString!The merchant that owns this template.
nameString!Template name shown in the merchant portal.
descriptionStringInternal description, or null if none was provided.
isActiveBoolean!Whether this template is marked active.
subjectString!Email subject line, which may contain placeholders.
bodyHtmlString!HTML email body, which may contain placeholders.
bodyTextString!Plain text body generated from the HTML when the template was saved.
createdAtString!When the template was created, as an ISO 8601 timestamp.
updatedAtString!When the template was last saved, as an ISO 8601 timestamp.
Deletes one email template belonging to the current merchant.
Merchant-owned email template to delete.
idString!RequiredID of a saved template belonging to the current merchant.
true when the change was made. Anything that stops it comes back as an error.
Sends an HTML preview to a member of the current merchant with the subject Email Template Preview. Replaces simple placeholders using the provided string variables.
Recipient, HTML and substitutions for an email preview.
customerIdString!RequiredMember ID (TokiUser.id) in the current merchant. The member must have an email address.
bodyHtmlString!RequiredPreview HTML. Simple placeholders such as {{name}} are replaced using variables.
variables[TokiEmailTemplatePreviewSendVariablesEntryInput!]String substitutions sent as key/value entries. Each key is a placeholder name without braces; value is its replacement text. Unknown placeholders remain unchanged.
true when the change was made. Anything that stops it comes back as an error.
Sends a test email to one member right away, from the sender in your store's email settings. It uses the subject and bodyHtml you pass rather than a saved template, with placeholders filled in from the member's details and variables.
templateIdIDThe saved template you're testing, if any. Toki only checks that it exists; the email is built from subject and bodyHtml.
customerIdID!RequiredThe member who receives the email, by member ID (TokiUser.id). They need an email address.
subjectString!RequiredThe subject line. Placeholders such as {{customer.name}} are filled in.
bodyHtmlString!RequiredThe email's HTML body. Placeholders are filled in as in subject.
variablesTokiJSONValues for placeholders, as a JSON object such as {"amount": 50}. They are merged over the member's own values (customer, userProperties) and win on conflicts.
true when the change was made. Anything that stops it comes back as an error.