Meet Toki Operator

Docs/Manage API

Completions & approvals

Completed activities: list them, approve or deny submissions, credit a member by hand, or remove one.

A completion records that a member completed an activity. Activities that need review create completions in the pending state until you approve or deny them. Approve, deny and rollback process each ID separately and report which ones succeeded.

activityCompletions#

Lists completions of your activities, newest first. Filter by verificationStatus (pending for your approval queue), activityId or userId.

Arguments

  • queryString

    Filters by completion date with created_at terms, such as created_at:>-30d or created_at:<2025-01-01. Operators: :, :!=, :>, :>=, :<, :<=; relative dates count back from now (-24h, -7d, -2w, -6m, -1y). Terms combine with AND unless joined by OR; other fields return BADUSERINPUT.

  • exactActivityIdID

    Only completions of this activity, excluding challenge children.

  • formAnswersOnlyBoolean

    When true, include only submissions to existing survey, poll and quiz activities.

  • activityIdID

    Only completions of this activity. For a challenge, also those of the activities it is made of.

  • userIdID

    Only completions by this member.

  • verificationStatusTokiVerificationStatus

    Only items whose verificationStatus equals this value.

    approvedpendingdenied

Returns

TokiActivityCompletionConnection!

A page of TokiActivityCompletion in nodes, with pageInfo for the next page. Each item:

A record of a member completing one of your activities.

  • idID!
  • activityIdID!

    The activity the member completed.

  • verificationStatusTokiVerificationStatus!

    pending while a completion waits for your review, approved once it's accepted, denied if it was turned down. Rewards are issued on approval.

    approvedpendingdenied
  • createdAtString!
  • shopIdID

    The store where the activity was completed. null when the completion isn't tied to one store.

  • additionalFieldsTokiJSON!

    Stored completion details, including form answers and order metadata. Requires member or approval read access.

  • memberEmailString

    Email recorded for the member who completed the activity.

  • rewardAmountFloat

    Issued reward amount, or null when no reward was issued.

  • donationTokiActivityCompletionDonation!

    Donation details recorded on a charity completion.

  • answersTokiJSON!

    Submitted form answers keyed by question labels; text or lists of choices. Requires MembersRead.

  • userIdID!

    The member who completed the activity.

  • userTokiUser

    The member who completed the activity. null if they're no longer in any of your stores.

  • activityTokiActivity

    The completed activity. null if it has since been deleted.

  • filesTokiFileConnection!

    Files the member uploaded with the completion.

  • issuedRewardTokiIssuedReward

    The reward issued for this completion. null while there is none, for example while the completion is pending.

  • orderTokiOrder

    The order that earned this completion, if there is one.

query ActivityCompletions($first: Int) {
  activityCompletions(first: $first) {
    nodes {
      id
      activityId
      verificationStatus
      createdAt
      donation {
        amount
        charities
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "activityCompletions": {
      "nodes": [
        {
          "id": "00322f27-ff32-4d94-a232-324d013230ba",
          "activityId": "b3ade77a-b4ad-490d-a1ad-e454b2ade5e7",
          "verificationStatus": "approved",
          "createdAt": "2026-10-14T09:30:00.000Z",
          "donation": {
            "amount": 49.99,
            "charities": [
              "Charities"
            ]
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}
query

activityCompletionApprovalCount#

Counts your completions in one verification state, such as the pending ones waiting for your review.

Arguments

  • verificationStatusTokiVerificationStatus!Required

    pending while a completion waits for your review, approved once it's accepted, denied if it was turned down. Rewards are issued on approval.

    approvedpendingdenied

Returns

Int!
query ActivityCompletionApprovalCount($verificationStatus: TokiVerificationStatus!) {
  activityCompletionApprovalCount(verificationStatus: $verificationStatus)
}
Variables
{
  "verificationStatus": "approved"
}
Response
{
  "data": {
    "activityCompletionApprovalCount": 3
  }
}

activityCompletionsApprove#

Approves completions and issues their rewards, checking the activity's schedule and completion limit again. Completions already approved fail with CONFLICT, as do denied ones unless allowDeny is true. Toki fires the Toki Activity Approved event for your campaigns, workflows and connected apps, and once the member reaches the completion limit, denies their other pending completions of that activity.

Input

TokiActivityCompletionsApproveInput!
  • ids[ID!]!Required

    Completion IDs, 1 to 250. Each is processed on its own, in order: succeededIds lists the ones that worked, errors the rest.

  • allowDenyBoolean

    Set to true to also approve completions that were denied; otherwise they fail with CONFLICT. With preventReSubmissions on, another denied completion by the same member for this activity still blocks approval.

Returns

TokiBulkResult!

Each ID is processed on its own: succeededIds lists the ones that went through, errors explains the rest.

The outcome for each ID. IDs are processed one by one, so some can fail while others succeed.

  • succeededIds[ID!]!

    The IDs that succeeded.

  • errors[TokiBulkError!]!

    One entry for each ID that failed. The other IDs were processed regardless.

mutation ActivityCompletionsApprove($input: TokiActivityCompletionsApproveInput!) {
  activityCompletionsApprove(input: $input) {
    succeededIds
    errors {
      id
      code
      message
    }
  }
}
Variables
{
  "input": {
    "ids": [
      "30e83638-31e8-47cb-a2e8-395e33e83af1"
    ],
    "allowDeny": true
  }
}
Response
{
  "data": {
    "activityCompletionsApprove": {
      "succeededIds": [
        "96c6eb3d-95c6-49aa-a4c6-e81793c6e684"
      ],
      "errors": [
        {
          "id": "ab3d552a-ac3d-46bd-a93d-5204aa3d5397",
          "code": "BAD_USER_INPUT",
          "message": "Message"
        }
      ]
    }
  }
}

activityCompletionsDeny#

Denies completions, optionally with a reason. It works on completions in any state; denying an approved one doesn't take back its reward. Toki doesn't message the member, but fires the Toki Activity Denied event, with the reason, for your campaigns, workflows and connected apps.

Input

TokiActivityCompletionsDenyInput!
  • ids[ID!]!Required

    Completion IDs, 1 to 250. Each is processed on its own, in order: succeededIds lists the ones that worked, errors the rest.

  • reasonString

    Why you denied them. Saved on each completion as additionalFields.deniedReason and sent with the Toki Activity Denied event.

Returns

TokiBulkResult!

Each ID is processed on its own: succeededIds lists the ones that went through, errors explains the rest.

The outcome for each ID. IDs are processed one by one, so some can fail while others succeed.

  • succeededIds[ID!]!

    The IDs that succeeded.

  • errors[TokiBulkError!]!

    One entry for each ID that failed. The other IDs were processed regardless.

mutation ActivityCompletionsDeny($input: TokiActivityCompletionsDenyInput!) {
  activityCompletionsDeny(input: $input) {
    succeededIds
    errors {
      id
      code
      message
    }
  }
}
Variables
{
  "input": {
    "ids": [
      "752aff71-742a-4dde-a32a-fc4b722afab8"
    ],
    "reason": "Duplicate account"
  }
}
Response
{
  "data": {
    "activityCompletionsDeny": {
      "succeededIds": [
        "8d427a24-8e42-4bb7-af42-7d4a90427edd"
      ],
      "errors": [
        {
          "id": "5976e4ad-5876-431a-a776-e1875676dff4",
          "code": "BAD_USER_INPUT",
          "message": "Message"
        }
      ]
    }
  }
}
mutation

activityCompletionCreate#

Creates an approved activity completion for a member and issues the selected rewardRuleId or one-off customRewardRule, even when the activity requires approval. The activity may be a draft or outside its schedule. Its completion limit and preventReSubmissions still apply.

Input

TokiActivityCompletionCreateInput!
  • activityIdID!Required

    The activity the member completed.

  • userIdID!Required

    The member.

  • rewardRuleIdID

    One of the activity's reward rules (see TokiActivity.rewards). Toki issues it without checking whether the member qualifies for it, for example by segment.

  • customRewardRuleTokiCustomRewardRuleInput

    A one-off reward for this completion only; the activity isn't changed. Toki validates it for the activity's type. Its discount is a referral setting: the input type requires it, but it doesn't change what this member receives.

Returns

TokiActivityCompletionCreatePayload!
  • activityCompletionIdID!
mutation ActivityCompletionCreate($input: TokiActivityCompletionCreateInput!) {
  activityCompletionCreate(input: $input) {
    activityCompletionId
  }
}
Variables
{
  "input": {
    "activityId": "35c29d2c-36c2-4ebf-a7c2-a05238c2a1e5",
    "userId": "d46d99f6-d56d-4b89-a26d-96d0d36d9863",
    "rewardRuleId": "e69d1378-e79d-450b-a89d-169ee99d1831"
  }
}
Response
{
  "data": {
    "activityCompletionCreate": {
      "activityCompletionId": "be0a8ab0-bf0a-4c43-a00a-8dd6c10a8f69"
    }
  }
}

activityCompletionsRollback#

Deletes completions of the member given by userId; they stop counting towards the activity's completion limit. The member keeps any reward already issued, including points, and Toki re-evaluates the member's segments whose conditions use the activity. IDs of other members' completions fail with NOT_FOUND.

Input

TokiActivityCompletionsRollbackInput!
  • ids[ID!]!Required

    Completion IDs, 1 to 250. Each is processed on its own, in order: succeededIds lists the ones that worked, errors the rest.

  • userIdID!Required

    The member the completions belong to.

Returns

TokiBulkResult!

Each ID is processed on its own: succeededIds lists the ones that went through, errors explains the rest.

The outcome for each ID. IDs are processed one by one, so some can fail while others succeed.

  • succeededIds[ID!]!

    The IDs that succeeded.

  • errors[TokiBulkError!]!

    One entry for each ID that failed. The other IDs were processed regardless.

mutation ActivityCompletionsRollback($input: TokiActivityCompletionsRollbackInput!) {
  activityCompletionsRollback(input: $input) {
    succeededIds
    errors {
      id
      code
      message
    }
  }
}
Variables
{
  "input": {
    "ids": [
      "03db975b-02db-45c8-a5db-9a8104db98ee"
    ],
    "userId": "642609dd-6326-484a-a226-06b761260524"
  }
}
Response
{
  "data": {
    "activityCompletionsRollback": {
      "succeededIds": [
        "cf6a4a16-d06a-4ba9-ad6a-46f0ce6a4883"
      ],
      "errors": [
        {
          "id": "c5af93a3-c4af-4210-a7af-96c9c6af9536",
          "code": "BAD_USER_INPUT",
          "message": "Message"
        }
      ]
    }
  }
}