TANITARDevelopers
WebhooksEvent catalogPlayers

player.membership.changed

Version 2 of the player.membership.changed webhook event.

The player.membership.changed event.

Event typeplayer.membership.changed
Schema version2
Routing keyevent.player.membership.changed.v2
Produced byAccount Auth
Schemaurn:defendr:contract:player:player-membership-changed:2

data fields

FieldTypeRequiredDescription
accountIdstringyes
playerIdstringyes
revisionintegeryes
levelKeystringyes
status"active", "inactive", "expired", "revoked"yes
startsAtstring (date-time)yes
endsAtstring (date-time)no
sourcestringyes
externalReferencestringno
updatedAtstring (date-time)yes
reason"granted", "renewed", "revoked", "expired"yes
activationIdstringno

Some fields are required only in particular states. The JSON Schema below is authoritative.

Example delivery

Signed with the example secret whsec_placeholder_example_webhooks_signing_secret, so you can check your verifier against it. See Verifying signatures.

POST /your/webhook/endpoint HTTP/1.1
content-type: application/json
webhook-id: whd_00000000-0000-4000-8000-000000000021
webhook-timestamp: 1800000000
webhook-signature: v1,tWr4P/FlQ3ghgko/o2FwTJimvC0Il4wH8YlidVMdqNo=
tanitar-event-type: player.membership.changed
tanitar-schema-version: 2
tanitar-delivery-attempt: 1

{"messageId":"evt_00000000-0000-4000-8000-000000000021","kind":"event","type":"player.membership.changed","schemaVersion":2,"occurredAt":"2027-01-15T10:00:00.000Z","producer":"account-auth-service","accountId":"acc_11111111-1111-4111-8111-111111111111","correlationId":"corr_00000000-0000-4000-8000-000000000021","data":{"accountId":"acc_demo","playerId":"507f1f77bcf86cd799439011","revision":2,"levelKey":"ninja","status":"active","startsAt":"2026-08-24T10:00:00.000Z","endsAt":"2026-09-24T10:00:00.000Z","source":"internal-command","updatedAt":"2026-08-24T10:00:00.000Z","reason":"renewed"}}

The same body, formatted:

{
  "messageId": "evt_00000000-0000-4000-8000-000000000021",
  "kind": "event",
  "type": "player.membership.changed",
  "schemaVersion": 2,
  "occurredAt": "2027-01-15T10:00:00.000Z",
  "producer": "account-auth-service",
  "accountId": "acc_11111111-1111-4111-8111-111111111111",
  "correlationId": "corr_00000000-0000-4000-8000-000000000021",
  "data": {
    "accountId": "acc_demo",
    "playerId": "507f1f77bcf86cd799439011",
    "revision": 2,
    "levelKey": "ninja",
    "status": "active",
    "startsAt": "2026-08-24T10:00:00.000Z",
    "endsAt": "2026-09-24T10:00:00.000Z",
    "source": "internal-command",
    "updatedAt": "2026-08-24T10:00:00.000Z",
    "reason": "renewed"
  }
}

JSON Schema

urn:defendr:contract:player:player-membership-changed:2
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:defendr:contract:player:player-membership-changed:2",
  "title": "Player membership changed event payload",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "accountId",
    "playerId",
    "revision",
    "levelKey",
    "status",
    "startsAt",
    "source",
    "updatedAt",
    "reason"
  ],
  "properties": {
    "accountId": {
      "type": "string",
      "minLength": 1
    },
    "playerId": {
      "type": "string",
      "minLength": 1
    },
    "revision": {
      "type": "integer",
      "minimum": 1
    },
    "levelKey": {
      "type": "string",
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "status": {
      "enum": [
        "active",
        "inactive",
        "expired",
        "revoked"
      ]
    },
    "startsAt": {
      "type": "string",
      "format": "date-time"
    },
    "endsAt": {
      "type": "string",
      "format": "date-time"
    },
    "source": {
      "type": "string",
      "minLength": 1
    },
    "externalReference": {
      "type": "string",
      "minLength": 1
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "reason": {
      "enum": [
        "granted",
        "renewed",
        "revoked",
        "expired"
      ]
    },
    "activationId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    }
  }
}

On this page