> ## 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.

> ## Agent Instructions
> If you are building a Canton Network application, start from https://docs.canton.network/appdev/quickstart.md. To run only a local network for your own Daml code, without building the QuickStart demo, see https://docs.canton.network/sdks-tools/development-tools/localnet.md.

# GetActiveContracts

Ledger API

›

[Protobuf](https://docs.canton.network/reference/protobuf/overview.md)

›

[com.daml.ledger.api.v2](https://docs.canton.network/reference/protobuf/packages/com-daml-ledger-api-v2.md)

›

GetActiveContracts

com.daml.ledger.api.v2

# GetActiveContracts

gRPC

RPC

`/com.daml.ledger.api.v2.StateService/GetActiveContracts`

## Protocol Details

Protocol
gRPC

Service
StateService

RPC
GetActiveContracts

Client stream
No

Server stream
Yes

## Inputs

### GetActiveContractsRequest

Message
com.daml.ledger.api.v2.GetActiveContractsRequest

Client stream
No

`active_at_offset`
int64

`event_format`
EventFormat

`stream_continuation_token`
bytes

`include_incomplete_reassignments`
bool

## Outputs

### GetActiveContractsResponse

Message
com.daml.ledger.api.v2.GetActiveContractsResponse

Server stream
Yes

`workflow_id`
string

`active_contract`
ActiveContract

`incomplete_unassigned`
IncompleteUnassigned

`incomplete_assigned`
IncompleteAssigned

`stream_continuation_token`
bytes

## Related Schemas

> [accordion] com.daml.ledger.api.v2.GetActiveContractsRequest
>
> `active_at_offset`
> int64
>
> `event_format`
> EventFormat
>
> `stream_continuation_token`
> bytes
>
> `include_incomplete_reassignments`
> bool

> [accordion] com.daml.ledger.api.v2.EventFormat
>
> `filters_by_party`
> repeated map
>
> `filters_for_any_party`
> Filters
>
> `verbose`
> bool

> [accordion] com.daml.ledger.api.v2.Filters
>
> `cumulative`
> repeated CumulativeFilter

> [accordion] com.daml.ledger.api.v2.CumulativeFilter
>
> `wildcard_filter`
> WildcardFilter
>
> `interface_filter`
> InterfaceFilter
>
> `template_filter`
> TemplateFilter

> [accordion] com.daml.ledger.api.v2.WildcardFilter
>
> `include_created_event_blob`
> bool

> [accordion] com.daml.ledger.api.v2.InterfaceFilter
>
> `interface_id`
> Identifier
>
> `include_interface_view`
> bool
>
> `include_created_event_blob`
> bool

> [accordion] com.daml.ledger.api.v2.Identifier
>
> `package_id`
> string
>
> `module_name`
> string
>
> `entity_name`
> string

> [accordion] com.daml.ledger.api.v2.TemplateFilter
>
> `template_id`
> Identifier
>
> `include_created_event_blob`
> bool

> [accordion] com.daml.ledger.api.v2.GetActiveContractsResponse
>
> `workflow_id`
> string
>
> `active_contract`
> ActiveContract
>
> `incomplete_unassigned`
> IncompleteUnassigned
>
> `incomplete_assigned`
> IncompleteAssigned
>
> `stream_continuation_token`
> bytes

> [accordion] com.daml.ledger.api.v2.ActiveContract
>
> `created_event`
> CreatedEvent
>
> `synchronizer_id`
> string
>
> `reassignment_counter`
> uint64

> [accordion] com.daml.ledger.api.v2.CreatedEvent
>
> `offset`
> int64
>
> `node_id`
> int32
>
> `contract_id`
> string
>
> `template_id`
> Identifier
>
> `contract_key`
> Value
>
> `contract_key_hash`
> bytes
>
> `create_arguments`
> Record
>
> `created_event_blob`
> bytes
>
> `interface_views`
> repeated InterfaceView
>
> `witness_parties`
> repeated string
>
> `signatories`
> repeated string
>
> `observers`
> repeated string
>
> `created_at`
> Timestamp
>
> `package_name`
> string
>
> `acs_delta`
> bool
>
> `representative_package_id`
> string

> [accordion] com.daml.ledger.api.v2.Value
>
> `unit`
> Empty
>
> `bool`
> bool
>
> `int64`
> sint64
>
> `date`
> int32
>
> `timestamp`
> sfixed64
>
> `numeric`
> string
>
> `party`
> string
>
> `text`
> string
>
> `contract_id`
> string
>
> `optional`
> Optional
>
> `list`
> List
>
> `text_map`
> TextMap
>
> `gen_map`
> GenMap
>
> `record`
> Record
>
> `variant`
> Variant
>
> `enum`
> Enum

> [accordion] com.daml.ledger.api.v2.Optional
>
> `value`
> Value

> [accordion] com.daml.ledger.api.v2.List
>
> `elements`
> repeated Value

> [accordion] com.daml.ledger.api.v2.TextMap
>
> `entries`
> repeated Entry

> [accordion] com.daml.ledger.api.v2.TextMap.Entry
>
> `key`
> string
>
> `value`
> Value

> [accordion] com.daml.ledger.api.v2.GenMap
>
> `entries`
> repeated Entry

> [accordion] com.daml.ledger.api.v2.GenMap.Entry
>
> `key`
> Value
>
> `value`
> Value

> [accordion] com.daml.ledger.api.v2.Record
>
> `record_id`
> Identifier
>
> `fields`
> repeated RecordField

> [accordion] com.daml.ledger.api.v2.RecordField
>
> `label`
> string
>
> `value`
> Value

> [accordion] com.daml.ledger.api.v2.Variant
>
> `variant_id`
> Identifier
>
> `constructor`
> string
>
> `value`
> Value

> [accordion] com.daml.ledger.api.v2.Enum
>
> `enum_id`
> Identifier
>
> `constructor`
> string

> [accordion] com.daml.ledger.api.v2.InterfaceView
>
> `interface_id`
> Identifier
>
> `view_status`
> Status
>
> `view_value`
> Record
>
> `implementation_package_id`
> string

> [accordion] com.daml.ledger.api.v2.IncompleteUnassigned
>
> `created_event`
> CreatedEvent
>
> `unassigned_event`
> UnassignedEvent

> [accordion] com.daml.ledger.api.v2.UnassignedEvent
>
> `reassignment_id`
> string
>
> `contract_id`
> string
>
> `template_id`
> Identifier
>
> `source`
> string
>
> `target`
> string
>
> `submitter`
> string
>
> `reassignment_counter`
> uint64
>
> `assignment_exclusivity`
> Timestamp
>
> `witness_parties`
> repeated string
>
> `package_name`
> string
>
> `offset`
> int64
>
> `node_id`
> int32

> [accordion] com.daml.ledger.api.v2.IncompleteAssigned
>
> `assigned_event`
> AssignedEvent

> [accordion] com.daml.ledger.api.v2.AssignedEvent
>
> `source`
> string
>
> `target`
> string
>
> `reassignment_id`
> string
>
> `submitter`
> string
>
> `reassignment_counter`
> uint64
>
> `created_event`
> CreatedEvent

grpcurl

```bash grpcurl theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Add -plaintext if the server is not using TLS.
# This RPC uses streaming semantics. Send additional JSON messages on stdin as needed.
grpcurl \
  -d @ \
  <HOST:PORT> \
  com.daml.ledger.api.v2.StateService/GetActiveContracts <<'EOF'
{
  "activeAtOffset": "0",
  "eventFormat": {
    "filtersByParty": [
      {
        "key": {
          "cumulative": [
            {
              "wildcardFilter": {}
            }
          ]
        }
      }
    ],
    "filtersForAnyParty": {
      "cumulative": [
        {
          "wildcardFilter": {}
        }
      ]
    },
    "verbose": true
  },
  "streamContinuationToken": "BASE64_ENCODED_BYTES",
  "includeIncompleteReassignments": true
}
EOF
```

OK

application/json

```json OK theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "workflowId": "string",
  "activeContract": {
    "createdEvent": {
      "offset": "0",
      "nodeId": 0,
      "contractId": "string",
      "templateId": {
        "packageId": "string",
        "moduleName": "string",
        "entityName": "string"
      },
      "contractKey": {
        "unit": "string"
      },
      "contractKeyHash": "BASE64_ENCODED_BYTES",
      "createArguments": {
        "recordId": {},
        "fields": [
          {}
        ]
      },
      "createdEventBlob": "BASE64_ENCODED_BYTES"
    },
    "synchronizerId": "string",
    "reassignmentCounter": "0"
  },
  "streamContinuationToken": "BASE64_ENCODED_BYTES"
}
```
