data-book="docs" Subscriptions | The Root Network
Skip to content

2.12 Subscriptions ​
At a glance
What it isLike a blockchain, Asset Register is event driven and therefore subscribers must be given real time feedback on what is happening so they can react to them.
Where it sitsPart II — Building · Chapter 2.12
CoversEvent · Webhook · Usage
Sourcedocs.therootnetwork.com/asset-register/guides/subscriptions · fetched 2026-05-02

Like a blockchain, Asset Register is event driven and therefore subscribers must be given real time feedback on what is happening so they can react to them.

2.12.1 Event ​

When you subscribe to an event you will receive the full transaction that includes the event you are interested in.

json
{
  "status": "SUCCESS",
  "signature": "0x00",
  "message": "",
  "events": [
    {
      "type": "asset-link",
      "action": "delete",
      "args": [
        "equipWith_asmBrain",
        "did:fv-asset:1:evm:0x6bca6de2dbdc4e0d41f7273011785ea16ba47182:1000",
        "did:fv-asset:1:evm:0x1ea66a857de297471bc12dd12d93853ff6617284:200",
      ],
      "collectionId": "1:evm:0x6bca6de2dbdc4e0d41f7273011785ea16ba47182"
    }
  ]
}

2.12.2 Webhook ​

Like any other webhook subscription, the Asset Register Subscription Service will forward the events via a POST request with the API_KEY set in the headers, ensuring the origination of the request.

If an event delivery to a webhook endpoint is attempted and an error occurs, the following takes place:

  • Events associated with error codes 409, 429, and 5xx are retried.
  • Events associated with error codes 1xx, 2xx, 3xx, and 4xx (excluding 429) are not retried.

We read the standard HTTP response header Retry-After to determine how long to wait before making a follow-up request. We then choose the more conservative value between the defined retry policy and the Retry-After header. If Retry-After value is negative, the event will not be retried.

2.12.3 Usage ​

INFO

You must send a valid SIWE token for the following interactions. Please see Admin Authentication.

The following mutations demonstrate the main use cases. However, additional mutations for managing endpoints are available. To explore the complete set of mutations, refer to the GraphQL playground by navigating to the GraphQL URL in your browser.

2.12.3.1 Creating a webhook endpoint ​

Before you can create a subscription, a webhook endpoint must be created. This will point all the subscriptions to the correct URL and will set you up with an API Key for request authentication.

graphql
mutation CreateWebhookEndpoint($input: CreateWebhookEndpointInput!) {
  createWebhookEndpoint(input: $input) {
    webhookEndpoint {
      id
      webhookId
      subscriber
      url
      apiKey
      retries
      createdAt
    }
  }
}
json
{
  "input": {
    "url": "https://example.com/webhook",
    "retries": 5
  }
}

The retries property determines the number of times the webhook endpoint will be retried before stopping. The maximum allowable number of retries is set at 20.

The webhookId from the response should be used whencreating-a-subscription.

2.12.3.2 Creating a subscription ​

graphql
mutation CreateWebhookSubscription($input: CreateWebhookSubscriptionInput!) {
  createWebhookSubscription(input: $input) {
    webhookSubscription {
      id
      subscriptionId
      webhookId
      type
      actions
      collectionId
      createdAt
    }
  }
}
json
{
  "input": {
    "type": "asset-link",
    "actions": ["create", "delete"],
    "collectionId": "1:evm:0x6bca6de2dbdc4e0d41f7273011785ea16ba47182",
    "webhookId": "8fafd82a-ca5e-4495-9ad4-d28c4ea6adf0"
  }
}

2.12.3.3 Querying subscription resources ​

You can use the following queries to get subscription resources created by the requester:

  • webhookEndpoint
  • webhookEndpoints
  • webhookSubscription
  • webhookSubscriptions

Associated docs

Where else you might go from here. Following one is optional — this chapter stands without them.

Part II — Building
Part of — The two API tracks — EVM and Substrate — plus the Asset Register, the contracts deployed on TRN, and the recipes for common work.
Asset Register Dev Portal
See also — ar-docs.futureverse.app — the wallet-gated tooling portal where you create namespaces, define schemas, manage collections and assets, configure webhooks, and generate SIWE tokens for the Asset Register API.
Authentication
See also — There are two different types of authentication required based on the functionality you are trying to access.
Back matter — read in order
See also — The whole of Back matter as one continuous page, reprinted from its chapters without change.
Contents
See also — Every chapter in this book, each with the one line that tells you what you get by reading it.
Front matter — read in order
See also — The whole of Front matter as one continuous page, reprinted from its chapters without change.
Index · A
See also — 583 index terms that start with A, each linked to the pages that define or use it.
Index · B
See also — 289 index terms that start with B, each linked to the pages that define or use it.

The Root Network documentation and history.