Canton Network docsLedger API › AsyncAPI › v2/state/active-contracts
Subscribe active contracts
Updated 03-12-2026
SUBSCRIBE
Returns a stream of the snapshot of the active contracts and incomplete (un)assignments at a ledger offset.
This endpoint does not accept /v2/state/active-contractsfilters_by_contract_id in EventFormat.
Once the stream of GetActiveContractsResponses completes,
the client SHOULD begin streaming updates from the update service,
starting at the GetActiveContractsRequest.active_at_offset specified in this request.
Clients SHOULD NOT assume that the set of active contracts they receive reflects the state at the ledger end.
If the given offset is different than the ledger end, and there are (un)assignments in-flight at the given offset,
the snapshot may fail with “FAILED_PRECONDITION/PARTICIPANT_PRUNED_DATA_ACCESSED”.
Note that it is ok to request acs snapshots for party migration with offsets other than ledger end, because party
migration is not concerned with incomplete (un)assignments.Required permissions: ledger:read and CanReadAs for the required parties.Protocol Details
ProtocolWebSocket
Channel/v2/state/active-contracts
Actionsubscribe
Operation IDonV2StateActive-contracts
Content typeapplication/json
PayloadoneOf
Inputs
Outputs
DirectionServer -> Client
MessageEither_JsCantonError_JsGetActiveContractsResponse
Variants
codestringrequiredcausestringrequiredcontextobjectrequirederrorCategorystringrequiredworkflowIdstringcontractEntryobjectstreamContinuationTokenstringRelated Schemas
Either_JsCantonError_JsGetActiveContractsResponse
Either_JsCantonError_JsGetActiveContractsResponse
Variants
JsCantonError
object
codestringrequiredcausestringrequiredcontextobjectrequirederrorCategorystringrequiredJsGetActiveContractsResponse
object
workflowIdstringcontractEntryobjectstreamContinuationTokenstringVariants
contractEntry
oneOf
JsActiveContractobjectVariants
JsActiveContract
object
JsActiveContractobjectrequiredJsEmpty
object
JsEmptyobjectrequiredJsIncompleteAssigned
object
JsIncompleteAssignedobjectrequiredJsIncompleteUnassigned
object
JsIncompleteUnassignedobjectrequiredHistory
Updated
3.8channel description updated
Updated
3.7channel description updated
Updated
3.5channel description updated; subscribe description updated
wscat
wscat
npx wscat -c <WEBSOCKET_URL>
messageapplication/json
message
{
"code": "<string>",
"cause": "<string>",
"context": {},
"errorCategory": "<integer>"
}