Meet Toki Operator

Docs/Manage API

Webhooks

Subscribe your own endpoints to events, and inspect every delivery.

Toki sends a JSON POST to your endpoint when an event happens. Each delivery carries an X-Toki-HMAC-SHA256 signature computed with your API key and an X-Toki-Webhook-Id that stays the same across retries. A delivery succeeds when your endpoint answers with a 2xx status; otherwise Toki tries again, up to 7 attempts over about seven hours.

webhookSubscriptions#

Lists your webhook subscriptions, newest first. Select webhooks and their logs to see what Toki sent and how your endpoint answered.

Arguments

  • queryString

    Text in the topic or endpoint.

  • reverseBoolean

    Reverse the sort order.

  • idID

    Only items whose id equals this value.

  • topicTokiWebhookSubscriptionTopic

    Only items whose topic equals this value.

    TRANSACTION_CREATEDPAID_MEMBERSHIP_SUBSCRIBEDPAID_MEMBERSHIP_RENEWEDPAID_MEMBERSHIP_CHANGEDPAID_MEMBERSHIP_CANCELLEDTIER_EARNEDTIER_LOST
  • endpointString

    Only items whose endpoint contains this text (case-sensitive).

Returns

TokiWebhookSubscriptionConnection!

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

An endpoint of yours that receives one topic.

  • idID!
  • createdAtString!
  • updatedAtString!
  • topicTokiWebhookSubscriptionTopic!

    The event a subscription receives: a points transaction, a paid membership being subscribed to, renewed, changed or cancelled, or a member earning or losing a tier.

    TRANSACTION_CREATEDPAID_MEMBERSHIP_SUBSCRIBEDPAID_MEMBERSHIP_RENEWEDPAID_MEMBERSHIP_CHANGEDPAID_MEMBERSHIP_CANCELLEDTIER_EARNEDTIER_LOST
  • endpointString!

    The URL that receives the webhooks.

  • webhooksTokiWebhookConnection!

    Webhooks sent for this subscription, newest first.

query WebhookSubscriptions($first: Int) {
  webhookSubscriptions(first: $first) {
    nodes {
      id
      createdAt
      topic
      endpoint
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "webhookSubscriptions": {
      "nodes": [
        {
          "id": "3bc49d00-3cc4-4e93-adc4-a0263ec4a1b9",
          "createdAt": "2026-10-14T09:30:00.000Z",
          "topic": "TRANSACTION_CREATED",
          "endpoint": "https://example.com/toki/webhooks"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}
mutation

webhookSubscriptionCreate#

Subscribes an endpoint to a topic. A subscription covers one topic, so create one for each topic you need.

Input

TokiWebhookSubscriptionCreateInput!
  • topicTokiWebhookSubscriptionTopic!Required

    The event a subscription receives: a points transaction, a paid membership being subscribed to, renewed, changed or cancelled, or a member earning or losing a tier.

    TRANSACTION_CREATEDPAID_MEMBERSHIP_SUBSCRIBEDPAID_MEMBERSHIP_RENEWEDPAID_MEMBERSHIP_CHANGEDPAID_MEMBERSHIP_CANCELLEDTIER_EARNEDTIER_LOST
  • endpointString!Required

    The URL that receives the webhooks. Use https://.

Returns

TokiWebhookSubscription!

An endpoint of yours that receives one topic.

  • idID!
  • createdAtString!
  • updatedAtString!
  • topicTokiWebhookSubscriptionTopic!

    The event a subscription receives: a points transaction, a paid membership being subscribed to, renewed, changed or cancelled, or a member earning or losing a tier.

    TRANSACTION_CREATEDPAID_MEMBERSHIP_SUBSCRIBEDPAID_MEMBERSHIP_RENEWEDPAID_MEMBERSHIP_CHANGEDPAID_MEMBERSHIP_CANCELLEDTIER_EARNEDTIER_LOST
  • endpointString!

    The URL that receives the webhooks.

  • webhooksTokiWebhookConnection!

    Webhooks sent for this subscription, newest first.

mutation WebhookSubscriptionCreate($input: TokiWebhookSubscriptionCreateInput!) {
  webhookSubscriptionCreate(input: $input) {
    id
    createdAt
    updatedAt
    topic
    endpoint
  }
}
Variables
{
  "input": {
    "topic": "TRANSACTION_CREATED",
    "endpoint": "https://example.com/toki/webhooks"
  }
}
Response
{
  "data": {
    "webhookSubscriptionCreate": {
      "id": "bebda158-bfbd-42eb-a0bd-a47ec1bda611",
      "createdAt": "2026-10-14T09:30:00.000Z",
      "updatedAt": "2026-10-14T09:30:00.000Z",
      "topic": "TRANSACTION_CREATED",
      "endpoint": "https://example.com/toki/webhooks"
    }
  }
}
mutation

webhookSubscriptionDelete#

Deletes a subscription. Toki stops sending its topic to the endpoint right away.

Input

TokiWebhookSubscriptionDeleteInput!
  • idID!Required

    The subscription to delete.

Returns

Boolean!

true when the change was made. Anything that stops it comes back as an error.

mutation WebhookSubscriptionDelete($input: TokiWebhookSubscriptionDeleteInput!) {
  webhookSubscriptionDelete(input: $input)
}
Variables
{
  "input": {
    "id": "1459f037-1359-4ea4-a659-f35d1559f1ca"
  }
}
Response
{
  "data": {
    "webhookSubscriptionDelete": true
  }
}