Canton Network docsLedger API › OpenAPI
POST /v2/commands/command-completions
Updated 24-11-2026
cURL
Python
JavaScript
PHP
Go
Java
Ruby
curl --request POST \
--url 'http://localhost:7575/v2/commands/command-completions' \
--header 'Authorization: Bearer $TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"parties": [
"<string>"
],
"beginExclusive": 123
}'
import json
import requests
url = "http://localhost:7575/v2/commands/command-completions"
headers = {'Authorization': 'Bearer <token>', 'Content-Type': 'application/json'}
payload = json.loads(r'''{
"parties": [
"<string>"
],
"beginExclusive": 123
}''')
response = requests.request(
"POST", url, headers=headers, json=payload
)
print(response.text)
const response = await fetch('http://localhost:7575/v2/commands/command-completions', {
method: 'POST',
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"parties": [
"<string>"
],
"beginExclusive": 123
}),
});
console.log(await response.text());
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'http://localhost:7575/v2/commands/command-completions',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => <<<'JSON'
{
"parties": [
"<string>"
],
"beginExclusive": 123
}
JSON,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
echo $response;
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("POST", "http://localhost:7575/v2/commands/command-completions", bytes.NewBufferString(`{
"parties": [
"<string>"
],
"beginExclusive": 123
}`))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
response, _ := http.DefaultClient.Do(req)
defer response.Body.Close()
body, _ := io.ReadAll(response.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
var request = HttpRequest.newBuilder()
.uri(URI.create("http://localhost:7575/v2/commands/command-completions"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"parties": [
"<string>"
],
"beginExclusive": 123
}
"""))
.build();
var response = HttpClient.newHttpClient().send(
request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require 'net/http'
require 'uri'
uri = URI('http://localhost:7575/v2/commands/command-completions')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
"parties": [
"<string>"
],
"beginExclusive": 123
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port) do |http|
http.request(request)
end
puts response.body
200
400
default
[
{
"completionResponse": {
"Completion": {
"value": {
"commandId": "<string>",
"status": {
"code": 123,
"message": "<string>",
"details": [
"<object>"
]
},
"updateId": "<string>",
"userId": "<string>",
"actAs": [
"<string>"
],
"submissionId": "<string>",
"deduplicationPeriod": "<object>",
"traceContext": {
"traceparent": "<string>",
"tracestate": "<string>"
},
"offset": 123,
"synchronizerTime": {
"synchronizerId": "<string>",
"recordTime": "<string>"
},
"paidTrafficCost": 123,
"transactionHash": "<string>"
}
}
}
}
]
<string>
{
"code": "<string>",
"cause": "<string>",
"correlationId": "<string>",
"traceId": "<string>",
"context": {},
"resources": [
[
"<string>"
]
],
"errorCategory": 123,
"grpcCodeValue": 123,
"retryInfo": "<string>",
"definiteAnswer": false
}
POST
/
v2
/
commands
/
command-completions
cURL
Python
JavaScript
PHP
Go
Java
Ruby
curl --request POST \
--url 'http://localhost:7575/v2/commands/command-completions' \
--header 'Authorization: Bearer $TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"parties": [
"<string>"
],
"beginExclusive": 123
}'
import json
import requests
url = "http://localhost:7575/v2/commands/command-completions"
headers = {'Authorization': 'Bearer <token>', 'Content-Type': 'application/json'}
payload = json.loads(r'''{
"parties": [
"<string>"
],
"beginExclusive": 123
}''')
response = requests.request(
"POST", url, headers=headers, json=payload
)
print(response.text)
const response = await fetch('http://localhost:7575/v2/commands/command-completions', {
method: 'POST',
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"parties": [
"<string>"
],
"beginExclusive": 123
}),
});
console.log(await response.text());
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'http://localhost:7575/v2/commands/command-completions',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => <<<'JSON'
{
"parties": [
"<string>"
],
"beginExclusive": 123
}
JSON,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
echo $response;
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("POST", "http://localhost:7575/v2/commands/command-completions", bytes.NewBufferString(`{
"parties": [
"<string>"
],
"beginExclusive": 123
}`))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
response, _ := http.DefaultClient.Do(req)
defer response.Body.Close()
body, _ := io.ReadAll(response.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
var request = HttpRequest.newBuilder()
.uri(URI.create("http://localhost:7575/v2/commands/command-completions"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"parties": [
"<string>"
],
"beginExclusive": 123
}
"""))
.build();
var response = HttpClient.newHttpClient().send(
request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require 'net/http'
require 'uri'
uri = URI('http://localhost:7575/v2/commands/command-completions')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
"parties": [
"<string>"
],
"beginExclusive": 123
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port) do |http|
http.request(request)
end
puts response.body
200
400
default
[
{
"completionResponse": {
"Completion": {
"value": {
"commandId": "<string>",
"status": {
"code": 123,
"message": "<string>",
"details": [
"<object>"
]
},
"updateId": "<string>",
"userId": "<string>",
"actAs": [
"<string>"
],
"submissionId": "<string>",
"deduplicationPeriod": "<object>",
"traceContext": {
"traceparent": "<string>",
"tracestate": "<string>"
},
"offset": 123,
"synchronizerTime": {
"synchronizerId": "<string>",
"recordTime": "<string>"
},
"paidTrafficCost": 123,
"transactionHash": "<string>"
}
}
}
}
]
<string>
{
"code": "<string>",
"cause": "<string>",
"correlationId": "<string>",
"traceId": "<string>",
"context": {},
"resources": [
[
"<string>"
]
],
"errorCategory": 123,
"grpcCodeValue": 123,
"retryInfo": "<string>",
"definiteAnswer": false
}
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.
cURL
Python
JavaScript
PHP
Go
Java
Ruby
curl --request POST \
--url 'http://localhost:7575/v2/commands/command-completions' \
--header 'Authorization: Bearer $TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"parties": [
"<string>"
],
"beginExclusive": 123
}'
import json
import requests
url = "http://localhost:7575/v2/commands/command-completions"
headers = {'Authorization': 'Bearer <token>', 'Content-Type': 'application/json'}
payload = json.loads(r'''{
"parties": [
"<string>"
],
"beginExclusive": 123
}''')
response = requests.request(
"POST", url, headers=headers, json=payload
)
print(response.text)
const response = await fetch('http://localhost:7575/v2/commands/command-completions', {
method: 'POST',
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"parties": [
"<string>"
],
"beginExclusive": 123
}),
});
console.log(await response.text());
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'http://localhost:7575/v2/commands/command-completions',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => <<<'JSON'
{
"parties": [
"<string>"
],
"beginExclusive": 123
}
JSON,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
echo $response;
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("POST", "http://localhost:7575/v2/commands/command-completions", bytes.NewBufferString(`{
"parties": [
"<string>"
],
"beginExclusive": 123
}`))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
response, _ := http.DefaultClient.Do(req)
defer response.Body.Close()
body, _ := io.ReadAll(response.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
var request = HttpRequest.newBuilder()
.uri(URI.create("http://localhost:7575/v2/commands/command-completions"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"parties": [
"<string>"
],
"beginExclusive": 123
}
"""))
.build();
var response = HttpClient.newHttpClient().send(
request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require 'net/http'
require 'uri'
uri = URI('http://localhost:7575/v2/commands/command-completions')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
"parties": [
"<string>"
],
"beginExclusive": 123
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port) do |http|
http.request(request)
end
puts response.body
200
400
default
[
{
"completionResponse": {
"Completion": {
"value": {
"commandId": "<string>",
"status": {
"code": 123,
"message": "<string>",
"details": [
"<object>"
]
},
"updateId": "<string>",
"userId": "<string>",
"actAs": [
"<string>"
],
"submissionId": "<string>",
"deduplicationPeriod": "<object>",
"traceContext": {
"traceparent": "<string>",
"tracestate": "<string>"
},
"offset": 123,
"synchronizerTime": {
"synchronizerId": "<string>",
"recordTime": "<string>"
},
"paidTrafficCost": 123,
"transactionHash": "<string>"
}
}
}
}
]
<string>
{
"code": "<string>",
"cause": "<string>",
"correlationId": "<string>",
"traceId": "<string>",
"context": {},
"resources": [
[
"<string>"
]
],
"errorCategory": 123,
"grpcCodeValue": 123,
"retryInfo": "<string>",
"definiteAnswer": false
}
Authorizations
httpAuth
HTTP bearer authentication. Send the token as
Authorization: Bearer <token>. Ledger API standard JWT tokenapiKeyAuth
API key authentication in the header. Ledger API standard JWT token (websocket)
Query parameters
OpenAPI type:
integer (int64).maximum number of elements to return, this param is ignored if is bigger than server settingOpenAPI type:
integer (int64).timeout to complete and send result if no new elements are received (for open ended streams)Body
application/json
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 emptyOpenAPI type:
integer (int64).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) OptionalResponses
200
application/json
Show child attributes
Show child attributes
Required
Show child attributes
Show child attributes
Show child attributes
Show child attributes
A completion represents the status of a submitted command on the ledger: it can be successful or failed.
Show child attributes
Show child attributes
A completion represents the status of a submitted command on the ledger: it can be successful or failed.
Show child attributes
Show child attributes
The ID of the succeeded or failed command. Must be a valid LedgerString (as described in
value.proto). RequiredIdentifies the exact type of the error. It uses the same format of conveying error details as it is used for the RPC responses of the APIs. Optional
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). OptionalThe user-id that was used for the submission, as described in
commands.proto. Must be a valid UserIdString (as described in value.proto). RequiredThe 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-emptyThe submission ID this completion refers to, as described in
commands.proto. Must be a valid LedgerString (as described in value.proto). OptionalThe 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. OptionalShow child attributes
Show child attributes
Show child attributes
Show child attributes
The Ledger API trace context The trace context transported in this message corresponds to the trace context supplied by the client application in a HTTP2 header of the original command submission. We typically use a header to transfer this type of information. Here we use message body, because it is used in gRPC streams which do not support per message headers. This field will be populated with the trace context contained in the original submission. If that was not provided, a unique ledger-api-server generated trace context will be used instead. Optional
Show child attributes
Show child attributes
https://www.w3.org/TR/trace-context/ Optional
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
The synchronizer along with its record time. The synchronizer id provided, in case of - successful/failed transactions: identifies the synchronizer of the transaction - for successful/failed unassign commands: identifies the source synchronizer - for successful/failed assign commands: identifies the target synchronizer Required
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. OptionalThe transaction hash signed by the external party for prepared transactions that were submitted using
InteractiveSubmissionService.ExecuteSubmission or one of its variants. Use this to correlate prepared transactions with their execution result on the same participant that executed the transaction. Not available for: - transactions executed on Canton versions prior to 3.5 - transactions of internal parties submitted using CommandSubmissionService.Submit and its variants Optional: can be emptyShow child attributes
Show child attributes
OffsetCheckpoints may be used to: - detect time out of commands. - provide an offset which can be used to restart consumption.
Show child attributes
Show child attributes
OffsetCheckpoints may be used to: - detect time out of commands. - provide an offset which can be used to restart consumption.
Show child attributes
Show child attributes
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). RequiredThe times associated with each synchronizer at this offset. Optional: can be empty
400
Invalid value, Invalid value for: body, Invalid value for: query parameter limit, Invalid value for: query parameter stream_idle_timeout_mstext/plain
default
application/json
History
Updated
3.6The POST /v2/commands/command-completions operation changed in this snapshot.
Added
3.5