Skip to main content
POST
/
v2
/
state
/
active-contracts
/v2/state/active-contracts
curl --request POST \
  --url https://api.example.com/v2/state/active-contracts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "activeAtOffset": 123,
  "filter": {
    "filtersByParty": {},
    "filtersForAnyParty": {
      "cumulative": [
        {
          "identifierFilter": {
            "Empty": {}
          }
        }
      ]
    }
  },
  "verbose": true,
  "eventFormat": {
    "filtersByParty": {},
    "filtersForAnyParty": {
      "cumulative": [
        {
          "identifierFilter": {
            "Empty": {}
          }
        }
      ]
    },
    "verbose": true
  },
  "streamContinuationToken": "<string>"
}
'
[
  {
    "workflowId": "<string>",
    "contractEntry": {
      "JsActiveContract": {
        "createdEvent": {
          "offset": 123,
          "nodeId": 123,
          "contractId": "<string>",
          "templateId": "<string>",
          "createArgument": "<unknown>",
          "witnessParties": [
            "<string>"
          ],
          "signatories": [
            "<string>"
          ],
          "createdAt": "<string>",
          "packageName": "<string>",
          "representativePackageId": "<string>",
          "acsDelta": true,
          "contractKey": "<unknown>",
          "contractKeyHash": "<string>",
          "createdEventBlob": "<string>",
          "interfaceViews": [
            {
              "interfaceId": "<string>",
              "viewStatus": {
                "code": 123,
                "message": "<string>",
                "details": [
                  {
                    "typeUrl": "<string>",
                    "value": "<string>",
                    "unknownFields": {
                      "fields": {}
                    },
                    "valueDecoded": "<string>"
                  }
                ]
              },
              "viewValue": "<unknown>",
              "implementationPackageId": "<string>"
            }
          ],
          "observers": [
            "<string>"
          ]
        },
        "synchronizerId": "<string>",
        "reassignmentCounter": 123
      }
    },
    "streamContinuationToken": "<string>"
  }
]

Documentation Index

Fetch the complete documentation index at: https://docs.canton.network/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Ledger API standard JWT token

Query Parameters

limit
integer<int64>

maximum number of elements to return, this param is ignored if is bigger than server setting

stream_idle_timeout_ms
integer<int64>

timeout to complete and send result if no new elements are received (for open ended streams)

Body

application/json

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.

activeAtOffset
integer<int64>
required

The offset at which the snapshot of the active contracts will be computed. Must be no greater than the current ledger end offset. Must be greater than or equal to the last pruning offset. Must be a valid absolute offset (positive integer) or ledger begin offset (zero). If zero, the empty set will be returned.

Required

filter
TransactionFilter · object

Provided for backwards compatibility, it will be removed in the Canton version 3.5.0. Templates to include in the served snapshot, per party. Optional, if specified event_format must be unset, if not specified event_format must be set.

verbose
boolean

Provided for backwards compatibility, it will be removed in the Canton version 3.5.0. If enabled, values served over the API will contain more information than strictly necessary to interpret the data. In particular, setting the verbose flag to true triggers the ledger to include labels for record fields. Optional, if specified event_format must be unset.

eventFormat
EventFormat · object

Format of the contract_entries in the result. In case of CreatedEvent the presentation will be of TRANSACTION_SHAPE_ACS_DELTA. Optional for backwards compatibility, defaults to an EventFormat where:

  • filters_by_party is the filter.filters_by_party from this request
  • filters_for_any_party is the filter.filters_for_any_party from this request
  • verbose is the verbose field from this request
streamContinuationToken
string

Opaque representation of a continuation token defining a position in the active contracts snapshot. The prefix of the active contracts snapshot will be omitted up to and including the element from which the continuation token was read. To reuse the continuation token from a GetActiveContractsPageResponse:

  • subsequent request must be executed on the same participant with the same version of canton,
  • subsequent request must have the same active_at_offset,
  • subsequent request must have the same event_format
  • and the participant must not have been pruned after the active_at_offset.

If not specified, the whole active contracts snapshot will be returned.

Optional: can be empty

Response

workflowId
string

The workflow ID used in command submission which corresponds to the contract_entry. Only set if the workflow_id for the command was set. Must be a valid LedgerString (as described in value.proto).

Optional

contractEntry
JsContractEntry · object

For a contract there could be multiple contract_entry-s in the entire snapshot. These together define the state of one contract in the snapshot. A contract_entry is included in the result, if and only if there is at least one stakeholder party of the contract that is hosted on the synchronizer at the time of the event and the party satisfies the TransactionFilter in the query.

Required

streamContinuationToken
string

Opaque representation of a continuation token which can be used in the request to bypass the already processed part of the active contracts snapshot. Only populated for the streaming GetActiveContracts rpc call.

Optional: can be empty