Skip to content
CCPEDIAby Unity Nodes
Canton Network docsLedger API › AsyncAPI › v2/state/active-contracts

Subscribe active contracts

Updated 03-12-2026

/v2/state/active-contracts

Subscribe active contracts

WebSocketUpdated 3.8
/v2/state/active-contracts
Returns a stream of the snapshot of the active contracts and incomplete (un)assignments at a ledger offset. This endpoint does not accept filters_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

Either_JsCantonError_JsGetActiveContractsResponse

DirectionServer -> Client
MessageEither_JsCantonError_JsGetActiveContractsResponse
Variants

JsCantonError

object

codestringrequired
causestringrequired
contextobjectrequired
errorCategorystringrequired

JsGetActiveContractsResponse

object

workflowIdstring
contractEntryobject
streamContinuationTokenstring
Variants

contractEntry

oneOf

JsActiveContractobject
Variants

JsActiveContract

object

JsActiveContractobjectrequired

JsEmpty

object

JsEmptyobjectrequired

JsIncompleteAssigned

object

JsIncompleteAssignedobjectrequired

JsIncompleteUnassigned

object

JsIncompleteUnassignedobjectrequired

Either_JsCantonError_JsGetActiveContractsResponse

Variants

JsCantonError

object

codestringrequired
causestringrequired
contextobjectrequired
errorCategorystringrequired

JsGetActiveContractsResponse

object

workflowIdstring
contractEntryobject
streamContinuationTokenstring
Variants

contractEntry

oneOf

JsActiveContractobject
Variants

JsActiveContract

object

JsActiveContractobjectrequired

JsEmpty

object

JsEmptyobjectrequired

JsIncompleteAssigned

object

JsIncompleteAssignedobjectrequired

JsIncompleteUnassigned

object

JsIncompleteUnassignedobjectrequired

History

Updated3.8

channel description updated

Updated3.7

channel description updated

Updated3.5

channel description updated; subscribe description updated

wscat
wscat
npx wscat -c <WEBSOCKET_URL>
messageapplication/json
message
{
  "code": "<string>",
  "cause": "<string>",
  "context": {},
  "errorCategory": "<integer>"
}