---
title: "POST /v2/commands/submit-and-wait-for-reassignment"
method: POST
path: "/v2/commands/submit-and-wait-for-reassignment"
---

# POST /v2/commands/submit-and-wait-for-reassignment

`POST /v2/commands/submit-and-wait-for-reassignment`

Submits a single composite reassignment command, waits for its result, and returns the reassignment.
Propagates the gRPC error of failed submission.

## Request body

- SubmitAndWaitForReassignmentRequest — This reassignment is executed as a single atomic update.
  - `reassignmentCommands` ReassignmentCommands, required
    - `workflowId` string — Identifier of the on-ledger workflow that this command is a part of. Must be a valid LedgerString (as described in ``value.proto``). Optional
    - `userId` string — Uniquely identifies the participant user that issued the command. Must be a valid UserIdString (as described in ``value.proto``). Required unless authentication is used with a user token. In that case, the token's user-id will be used for the request's user_id. Optional
    - `commandId` string, required — Uniquely identifies the command. The triple (user_id, submitter, command_id) constitutes the change ID for the intended ledger change. The change ID can be used for matching the intended ledger changes with all their completions. Must be a valid LedgerString (as described in ``value.proto``). Required
    - `submitter` string, required — Party on whose behalf the command should be executed. If ledger API authorization is enabled, then the authorization metadata must authorize the sender of the request to act on behalf of the given party. Must be a valid PartyIdString (as described in ``value.proto``). Required
    - `submissionId` string — A unique identifier to distinguish completions for different submissions with the same change ID. Typically a random UUID. Applications are expected to use a different UUID for each retry of a submission with the same change ID. Must be a valid LedgerString (as described in ``value.proto``). If omitted, the participant or the committer may set a value of their choice. Optional
    - `commands` ReassignmentCommand[], required — Individual elements of this reassignment. Must be non-empty. Required: must be non-empty
      - `command` union — A command can either create a new contract or exercise a choice on an existing contract.
        - object
          - `AssignCommand` AssignCommand, required — Assign a contract
            - `value` AssignCommand1, required — Assign a contract
              - …
        - object
          - `Empty` Empty2, required
        - object
          - `UnassignCommand` UnassignCommand, required — Unassign a contract
            - `value` UnassignCommand1, required — Unassign a contract
              - …
  - `eventFormat` EventFormat — A format for events which defines both which events should be included and what data should be computed and included for them. Note that some of the filtering behavior depends on the `TransactionShape`, which is expected to be specified alongside usages of `EventFormat`.
    - `filtersByParty` MapFilters
    - `filtersForAnyParty` Filters — The union of a set of template filters, interface filters, or a wildcard.
      - `cumulative` CumulativeFilter[] — Every filter in the cumulative list expands the scope of the resulting stream. Each interface, template or wildcard filter means additional events that will match the query. The impact of include_interface_view and include_created_event_blob fields in the filters will also be accumulated. A template or an interface SHOULD NOT appear twice in the accumulative field. A wildcard filter SHOULD NOT be defined more than once in the accumulative field. If no ``CumulativeFilter`` defined, the default of a single ``WildcardFilter`` with include_created_event_blob unset is used. Optional: can be empty
        - `identifierFilter` union — Required
          - object
            - `Empty` Empty1, required
          - object
            - `InterfaceFilter` InterfaceFilter, required — This filter matches contracts that implement a specific interface.
              - …
          - object
            - `TemplateFilter` TemplateFilter, required — This filter matches contracts of a specific template.
              - …
          - object
            - `WildcardFilter` WildcardFilter, required — This filter matches all templates.
              - …
    - `verbose` boolean — 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

## Response `200`

- JsSubmitAndWaitForReassignmentResponse
  - `reassignment` JsReassignment, required — Complete view of an on-ledger reassignment.
    - `updateId` string, required — Assigned by the server. Useful for correlating logs. Must be a valid LedgerString (as described in ``value.proto``). Required
    - `commandId` string — The ID of the command which resulted in this reassignment. Missing for everyone except the submitting party on the submitting participant. Must be a valid LedgerString (as described in ``value.proto``). Optional
    - `workflowId` string — The workflow ID used in reassignment command submission. Only set if the ``workflow_id`` for the command was set. Must be a valid LedgerString (as described in ``value.proto``). Optional
    - `offset` integer, required — The participant's offset. The details of this field are described in ``community/ledger-api/README.md``. Must be a valid absolute offset (positive integer). Required
    - `events` JsReassignmentEvent[], required — The collection of reassignment events. Required: must be non-empty
      - union
        - object
          - `JsAssignmentEvent` JsAssignmentEvent, required
            - `source` string, required
            - `target` string, required
            - `reassignmentId` string, required
            - `submitter` string, required
            - `reassignmentCounter` integer, required
            - `createdEvent` CreatedEvent, required — Records that a contract has been created, and choices may now be exercised on it.
              - …
        - object
          - `JsUnassignedEvent` JsUnassignedEvent, required — Records that a contract has been unassigned, and it becomes unusable on the source synchronizer
            - `value` UnassignedEvent, required — Records that a contract has been unassigned, and it becomes unusable on the source synchronizer
              - …
    - `traceContext` TraceContext
      - `traceparent` string — https://www.w3.org/TR/trace-context/ Optional
      - `tracestate` string — Optional
    - `recordTime` string, required — The time at which the reassignment was recorded. The record time refers to the source/target synchronizer for an unassign/assign event respectively. Required
    - `synchronizerId` string, required — A valid synchronizer id. Identifies the synchronizer that synchronized this Reassignment. Required
    - `paidTrafficCost` integer — The traffic cost that this participant node paid for the corresponding (un)assignment request. Not set for transactions that were - initiated by another participant - initiated offline via the repair service - processed before the participant started serving traffic cost on the Ledger API - returned as part of a query filtering for a non submitting party Optional

## Other responses

- `400` — Invalid value, Invalid value for: body
- `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)
