Update metadata

put/v1-beta/users/updateMetaData

The metadata can be used to store additional information about the user in the form of key-value pairs. Up to 50 key-value pairs can be added. The key is limited to 50 characters, and the value is limited to 500 characters. The stored metadata will be included in the document transaction CSV export as a separate column for each key-value pair.

Code snippet

curl --location --request PUT 'https://api.boldsign.com/v1-beta/users/updateMetaData' \
--header 'accept: */*' \
--header 'X-API-KEY: {apikey}' \
--header 'Content-Type: application/json' \
--data '{
  "userId": "6e455aa5-xxx-xxxx-xxx-2c6590521811",
  "metaData": {
    "Department": "Sales"
  }
}'
// requires beta version of the SDK at least v4.10.18-beta
var apiClient = new ApiClient("https://api.boldsign.com", "{apikey}");
var userClient = new UserClient(apiClient);

var updateUserMetaData = new UpdateUserMetaData()
{
    UserId = "6e455aa5-xxx-xxxx-xxx-2c6590521811",
    MetaData = new Dictionary<string, string>()
    {
        ["Department"] = "Sales",
    },
};

await userClient.UpdateUsersMetaDataAsync(updateUserMetaData);
import requests
import json

url = "https://api.boldsign.com/v1-beta/users/updateMetaData"

payload = {
    "userId": "6e455aa5-xxx-xxxx-xxx-2c6590521811",
    "metaData": {
        "Department": "Sales"
    }
}

headers = {
    "accept": "*/*",
    "X-API-KEY": "{your API key}",
    "Content-Type": "application/json",
}

response = requests.put(url, headers=headers, data=json.dumps(payload))
const axios = require('axios');

axios
  .put(
    'https://api.boldsign.com/v1-beta/users/updateMetaData',
    {
      userId: '6e455aa5-xxx-xxxx-xxx-2c6590521811',
      metaData: {
        Department: 'Sales',
      },
    },
    {
      headers: {
        accept: '*/*',
        'X-API-KEY': '{your API key}',
        'Content-Type': 'application/json',
      },
    }
  )
  .then((response) => {
    console.log(response.data);
  });
<?php
require_once "vendor/autoload.php";

use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;
use \GuzzleHttp\Psr7\Utils;

$client = new Client();
$headers = [
    'accept' => '*/*',
    'X-API-KEY' => '{your API key}',
    'Content-Type' => 'application/json'
];

$data = [
    "userId" => "6e455aa5-xxx-xxxx-xxx-2c6590521811",
    "metaData" => [
        "Department" => "Sales",
    ],
];

$body = json_encode($data);

$request = new Request('PUT', 'https://api.boldsign.com/v1-beta/users/updateMetaData', $headers, $body);

$res = $client->sendAsync($request)->wait();

echo $res->getBody();

Request body

userIdstringRequiredThe user ID of the user whose metadata needs to be updated.
metaDatadictionaryRequiredAdditional information about the user in the form of key-value pairs. Up to 50 key-value pairs can be added. The key is limited to 50 characters, and the value is limited to 500 characters.

Partial update

The metadata update always performs a partial update. If the metadata already exists, it will be updated with the new value. If the metadata does not exist, it will be added to the user. If any of the existing metadata is not passed in the request, the existing key-value pairs will not be affected.