Skip to content
Documentation/canton-network-docs/Ledger APIOpenAPIView on canton-network-docs
canton-network-docs/Ledger APIOpenAPI

PATCH /v2/parties/:party

PATCH
/
v2
/
parties
/
{party}
Try it
PATCH /v2/parties/:party

cURL

curl --request PATCH \
  --url https://api.example.com/v2/parties/{party} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "partyDetails": {
    "party": "<string>",
    "isLocal": true,
    "localMetadata": {
      "resourceVersion": "<string>",
      "annotations": {}
    },
    "identityProviderId": "<string>"
  },
  "updateMask": {
    "unknownFields": {
      "fields": {}
    },
    "paths": [
      "<string>"
    ]
  }
}
'
import requests

url = "https://api.example.com/v2/parties/{party}"

payload = {
    "partyDetails": {
        "party": "<string>",
        "isLocal": True,
        "localMetadata": {
            "resourceVersion": "<string>",
            "annotations": {}
        },
        "identityProviderId": "<string>"
    },
    "updateMask": {
        "unknownFields": { "fields": {} },
        "paths": ["<string>"]
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    partyDetails: {
      party: '<string>',
      isLocal: true,
      localMetadata: {resourceVersion: '<string>', annotations: {}},
      identityProviderId: '<string>'
    },
    updateMask: {unknownFields: {fields: {}}, paths: ['<string>']}
  })
};

fetch('https://api.example.com/v2/parties/{party}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.example.com/v2/parties/{party}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PATCH",
  CURLOPT_POSTFIELDS => json_encode([
    'partyDetails' => [
        'party' => '<string>',
        'isLocal' => true,
        'localMetadata' => [
                'resourceVersion' => '<string>',
                'annotations' => [
                                
                ]
        ],
        'identityProviderId' => '<string>'
    ],
    'updateMask' => [
        'unknownFields' => [
                'fields' => [
                                
                ]
        ],
        'paths' => [
                '<string>'
        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v2/parties/{party}"

	payload := strings.NewReader("{\n  \"partyDetails\": {\n    \"party\": \"<string>\",\n    \"isLocal\": true,\n    \"localMetadata\": {\n      \"resourceVersion\": \"<string>\",\n      \"annotations\": {}\n    },\n    \"identityProviderId\": \"<string>\"\n  },\n  \"updateMask\": {\n    \"unknownFields\": {\n      \"fields\": {}\n    },\n    \"paths\": [\n      \"<string>\"\n    ]\n  }\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.example.com/v2/parties/{party}")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"partyDetails\": {\n    \"party\": \"<string>\",\n    \"isLocal\": true,\n    \"localMetadata\": {\n      \"resourceVersion\": \"<string>\",\n      \"annotations\": {}\n    },\n    \"identityProviderId\": \"<string>\"\n  },\n  \"updateMask\": {\n    \"unknownFields\": {\n      \"fields\": {}\n    },\n    \"paths\": [\n      \"<string>\"\n    ]\n  }\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v2/parties/{party}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"partyDetails\": {\n    \"party\": \"<string>\",\n    \"isLocal\": true,\n    \"localMetadata\": {\n      \"resourceVersion\": \"<string>\",\n      \"annotations\": {}\n    },\n    \"identityProviderId\": \"<string>\"\n  },\n  \"updateMask\": {\n    \"unknownFields\": {\n      \"fields\": {}\n    },\n    \"paths\": [\n      \"<string>\"\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
200
400
default
{
  "partyDetails": {
    "party": "<string>",
    "isLocal": true,
    "localMetadata": {
      "resourceVersion": "<string>",
      "annotations": {}
    },
    "identityProviderId": "<string>"
  }
}
"<string>"
{
  "code": "<string>",
  "cause": "<string>",
  "context": {},
  "errorCategory": 123,
  "correlationId": "<string>",
  "traceId": "<string>",
  "resources": [
    [
      "<string>"
    ]
  ],
  "grpcCodeValue": 123,
  "retryInfo": "<string>",
  "definiteAnswer": true
}

Authorizations

Authorization
string
header
required

Ledger API standard JWT token

Path Parameters

party
string
required

Body

application/json

Required authorization: HasRight(ParticipantAdmin) OR IsAuthenticatedIdentityProviderAdmin(party_details.identity_provider_id)

partyDetails
PartyDetails · object
required

Party to be updated Modifiable

Required

Show child attributes

updateMask
FieldMask · object
required

An update mask specifies how and which properties of the PartyDetails message are to be updated. An update mask consists of a set of update paths. A valid update path points to a field or a subfield relative to the PartyDetails message. A valid update mask must:

  1. contain at least one update path,
  2. contain only valid update paths.

Fields that can be updated are marked as Modifiable. An update path can also point to non-Modifiable fields such as 'party' and 'local_metadata.resource_version' because they are used:

  1. to identify the party details resource subject to the update,
  2. for concurrent change control.

An update path can also point to non-Modifiable fields such as 'is_local' as long as the values provided in the update request match the server values. Examples of update paths: 'local_metadata.annotations', 'local_metadata'. For additional information see the documentation for standard protobuf3's google.protobuf.FieldMask. For similar Ledger API see com.daml.ledger.api.v2.admin.UpdateUserRequest.

Required

Show child attributes

Response

200
application/json
partyDetails
PartyDetails · object
required

Updated party details

Required

Show child attributes