OpenGov
Tracks and decodes OpenGov events.
AGENT ID
opengov
PROVIDES
webhooks, streams, messaging
NETWORKS
All networks with OpenGov
The OpenGov API tracks governance activity in real time across all Substrate chains that implement OpenGov. It monitors and decodes governance-related events, enriches them with on-chain metadata, and delivers updates as webhook messages.
Input Arguments
To start receiving OpenGov updates, you will need to make a persistent subscription with the following agent input argument:
| Argument | Description | Required |
|---|---|---|
networks |
A list of network IDs to monitor. At least one network is required. | yes |
Note
A valid API token with write permissions is required to create a subscription to the OpenGov API. If you donβt have a token, please contact us to request one.
Example
OpenGov Subscription Example
{
"id": "my-unique-subscription-id",
"agent": "opengov",
"args": {
"networks": ["urn:ocn:polkadot:1000", "urn:ocn:kusama:1000"]
},
"channels": [
{
"type": "webhook",
"url": "https://example.com/opengov",
"events": "*"
}
]
}Output Messages
Each message includes metadata and a payload.
Metadata
| Field | Description | Type |
|---|---|---|
type |
Always "referendum.update" |
string |
subscriptionId |
The subscription ID that produced this message | string |
agentId |
Always "opengov" |
string |
networkId |
Network where the event occurred | string |
timestamp |
Delivery timestamp (Unix ms) | number |
Payload
The payload contains the referendum state and all decoded context.
| Field | Description | Type |
|---|---|---|
id |
Referendum identifier. | number |
chainId |
URN identifying the chain where the event occurred. | string |
triggeredBy |
Metadata about the event that fired the notification. | object |
blockNumber |
Block number at which the event occurred. | string |
status |
Current referendum status (e.g., Ongoing, Confirming, Approved). |
string |
info |
Full decoded referendum state and details. | object |
decodedCall |
Decoded propsal preimage. | object or null |
timeline |
Milestones with block timestamps and UTC-formatted execution ETA. | object |
deposits |
Submission and decision deposits with amounts and account IDs. | object |
content |
Human-friendly metadata (title, link) when available. | object or null |
humanized |
Convenience summary fields such as human-readable status. | object |
Example
OpenGov Message Example
{
"id": 1783,
"chainId": "urn:ocn:polkadot:1000",
"triggeredBy": {
"name": "Referenda.ConfirmStarted",
"data": { "index": 1783 },
"blockHash": "0x4cf0678e0ef634d219364d25724e6253de2d87b9571839851af89615998102d6",
"blockNumber": "10642771"
},
"blockNumber": "10642771",
"status": "Ongoing",
"info": {
"track": 0,
"origin": { "type": "system", "value": { "type": "Root" } },
"proposal": {
"type": "Lookup",
"value": {
"hash": "0x922dcf38ebf7980fcb2c8888e8776b087c0b2ff80ada00761dd115df695b4c88",
"len": 521
}
},
"enactment": { "type": "After", "value": 100 },
"submitted": 28523700,
"submission_deposit": {
"who": "1rqM48LQVgWAsqgk35WqUVoqwQ7wyBf19Lkh3T4DeMvmmkE",
"amount": "10000000000"
},
"decision_deposit": {
"who": "13sDzot2hwoEAzXJiNe3cBiMEq19XRqrS3DMAxt9jiSNKMkA",
"amount": "1000000000000000"
},
"deciding": { "since": 28524900, "confirming": 28915127 },
"tally": {
"ayes": "1608784172206382968",
"nays": "226236858436670250",
"support": "551475014017290056"
},
"in_queue": false,
"alarm": [28915127, [28915127, 0]]
},
"decodedCall": {
"module": "Utility",
"method": "batch_all",
"args": {
"calls": [
{
"type": "Utility",
"value": {
"type": "dispatch_as",
"value": {
"as_origin": {
"type": "system",
"value": {
"type": "Signed",
"value": "13UVJyLnbVp9RBZYFwFGyDvVd1y27Tt8tkntv6Q7JVPhFsTB"
}
},
"call": {
"type": "PolkadotXcm",
"value": {
"type": "execute",
"value": "..."
}
}
}
}
},
{
"type": "Scheduler",
"value": {
"type": "schedule_after",
"value": "..."
}
}
]
}
},
"timeline": {
"submittedAt": 28523700,
"decisionStartedAt": 28524900,
"confirmationStartedAt": 28915127,
"willFinalizeAt": 28915127,
"willExecuteAt": 28915227,
"etaMs": 109634736000,
"willExecuteAtUtc": "2025-12-04T00:35:36.543Z"
},
"deposits": {
"submissionDeposit": {
"amount": "10000000000",
"who": "1rqM48LQVgWAsqgk35WqUVoqwQ7wyBf19Lkh3T4DeMvmmkE"
},
"decisionDeposit": {
"amount": "1000000000000000",
"who": "13sDzot2hwoEAzXJiNe3cBiMEq19XRqrS3DMAxt9jiSNKMkA"
}
},
"content": {
"title": "Polkadot People Initiative: Incentives for Mass Polkadot Activation Campaign",
"link": "https://polkadot.subsquare.io/referenda/1783"
},
"humanized": { "status": "β
Confirm Started" }
}