---
title: "POST /v2/commands/command-completions"
method: POST
path: "/v2/commands/command-completions"
---

# POST /v2/commands/command-completions

`POST /v2/commands/command-completions`

Query completions list (blocking call)

Subscribe to command completion events.
This streaming endpoint provides more flexibility in filtering than the predecessor ``CompletionStream``.
Notice: This endpoint should be used for small results set.
When number of results exceeded node configuration limit (`http-list-max-elements-limit`)
there will be an error (`413 Content Too Large`) returned.
Increasing this limit may lead to performance issues and high memory consumption.
Consider using websockets (asyncapi) for better efficiency with larger results.

## Query parameters

- `limit` integer
- `stream_idle_timeout_ms` integer

## Request body

- GetCompletionsRequest
  - `parties` string[] — If specified, only completions of commands are included, which have at least one of the ``act_as`` parties in the given set of parties. Only Ledger API users with CanReadAsAnyParty permission allowed to provide no ``parties``. Must be a valid PartyIdString (as described in ``value.proto``). Optional: can be empty
  - `beginExclusive` integer — This optional field indicates the minimum offset for completions. This can be used to resume an earlier completion stream. If not set the ledger uses the ledger begin offset instead. If specified, it must be a valid absolute offset (positive integer) or zero (ledger begin offset). If the ledger has been pruned, this parameter must be specified and greater than the pruning offset. (the pruning offset is accessible on the StateService.GetLatestPrunedOffsets endpoint) Optional

## Response `200`

- CompletionStreamResponse[]
  - `completionResponse` union — Required
    - object
      - `Completion` Completion, required — A completion represents the status of a submitted command on the ledger: it can be successful or failed.
        - `value` Completion1, required — A completion represents the status of a submitted command on the ledger: it can be successful or failed.
          - `commandId` string, required — The ID of the succeeded or failed command. Must be a valid LedgerString (as described in ``value.proto``). Required
          - `status` JsStatus
            - `code` integer, required
            - `message` string, required
            - `details` ProtoAny[]
              - …
          - `updateId` string — The update_id of the transaction or reassignment that resulted from the command with command_id. Only set for successfully executed commands. Must be a valid LedgerString (as described in ``value.proto``). Optional
          - `userId` string, required — The user-id that was used for the submission, as described in ``commands.proto``. Must be a valid UserIdString (as described in ``value.proto``). Required
          - `actAs` string[], required — The set of parties on whose behalf the commands were executed. Contains the ``act_as`` parties from ``commands.proto`` filtered to the requesting parties in CompletionStreamRequest. The order of the parties need not be the same as in the submission. Each element must be a valid PartyIdString (as described in ``value.proto``). Required: must be non-empty
          - `submissionId` string — The submission ID this completion refers to, as described in ``commands.proto``. Must be a valid LedgerString (as described in ``value.proto``). Optional
          - `deduplicationPeriod` union — The actual deduplication window used for the submission, which is derived from ``Commands.deduplication_period``. The ledger may convert the deduplication period into other descriptions and extend the period in implementation-specified ways. Used to audit the deduplication guarantee described in ``commands.proto``. The deduplication guarantee applies even if the completion omits this field. Optional
            - object
              - …
            - object
              - …
            - object
              - …
          - `traceContext` TraceContext
            - `traceparent` string — https://www.w3.org/TR/trace-context/ Optional
            - `tracestate` string — Optional
          - `offset` integer, required — May be used in a subsequent CompletionStreamRequest to resume the consumption of this stream at a later time. Must be a valid absolute offset (positive integer). Required
          - `synchronizerTime` SynchronizerTime, required
            - `synchronizerId` string, required — The id of the synchronizer. Required
            - `recordTime` string, required — All commands with a maximum record time below this value MUST be considered lost if their completion has not arrived before this checkpoint. Required
          - `paidTrafficCost` integer — The traffic cost paid by this participant node for the confirmation request for the submitted command. Commands whose execution is rejected before their corresponding confirmation request is ordered by the synchronizer will report a paid traffic cost of zero. If a confirmation request is ordered for a command, but the request fails (e.g., due to contention with a concurrent contract archival), the traffic cost is paid and reported on the failed completion for the request. If you want to correlate the traffic cost of a successful completion with the transaction that resulted from the command, you can use the ``offset`` field to retrieve the transaction using ``UpdateService.GetUpdateByOffset`` on the same participant node; or alternatively use the ``update_id`` field to retrieve the transaction using ``UpdateService.GetUpdateById`` on any participant node that sees the transaction. Note: for completions processed before the participant started serving traffic cost on the Ledger API, this field will be set to zero. Additionally, the total cost incurred by the submitting node for the submission of the transaction may be greater than the reported cost, for example if retries were issued due to failed submissions to the synchronizer. The cost reported here is the one paid for ordering the confirmation request. Optional
    - object
      - `Empty` Empty4, required
    - object
      - `OffsetCheckpoint` OffsetCheckpoint, required — OffsetCheckpoints may be used to: - detect time out of commands. - provide an offset which can be used to restart consumption.
        - `value` OffsetCheckpoint1, required — OffsetCheckpoints may be used to: - detect time out of commands. - provide an offset which can be used to restart consumption.
          - `offset` integer, required — The participant's offset, the details of the offset field are described in ``community/ledger-api/README.md``. Must be a valid absolute offset (positive integer). Required
          - `synchronizerTimes` SynchronizerTime[] — The times associated with each synchronizer at this offset. Optional: can be empty
            - `synchronizerId` string, required — The id of the synchronizer. Required
            - `recordTime` string, required — All commands with a maximum record time below this value MUST be considered lost if their completion has not arrived before this checkpoint. Required

## Other responses

- `400` — Invalid value, Invalid value for: body, Invalid value for: query parameter limit, Invalid value for: query parameter stream_idle_timeout_ms
- `default`

---

[API](https://skmtc.dev/canton/apis/json-ledger-api-http-endpoints.md) · [All operations](https://skmtc.dev/canton/apis/json-ledger-api-http-endpoints/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/canton/json-ledger-api-http-endpoints/revisions/296292e8b8f1/schema)
