# Add or Update Custom Data
source: https://developer.mastercard.com/mastercard-processing-core/documentation/use-cases/data-management/add-update-custom-data/index.md

## Overview {#overview}

The use case describes how you add or update custom data for the client or the contract (card contract or account contract) using dedicated API operations.

## Sequence diagram {#sequence-diagram}

![Sequence diagram](https://static.developer.mastercard.com/content/mastercard-processing-core/uploads/add-update-custom-data.png)

### Explanation {#explanation}

1. The server sends a `POST` request to the
   * `/clients/{client_id}/custom-data` endpoint to add or update custom data for the client
   * `/contracts/{contract_id}/custom-data` endpoint to add or update custom data for the contract (account contract or card contract). The server must pass the `accountContractId` or the `cardContractId`, respectively, in place of the `contract_id` in the path.  
     In both requests, the server must send the required fields `tagContainer` and `tagName` in the request body.
2. The API returns the HTTP status `200`. Tip: To clear the value of the currently stored `tagName` in the CMS, you must send the following fields in the request body:
   * the `tagValue` field with an empty value
   * the required fields `tagName` and `tagContainer`, where the `tagName` is stored

   To remove the entire tag stored in the CMS, you must pass the following fields in the request body:
   * the `removeTag` field with the `true` value
   * the required fields `tagName` and `tagContainer`, where the `tagName` is stored
   Refer to [Sandbox testing](https://developer.mastercard.com/mastercard-processing-core/documentation/sandbox-testing/data-management/add-update-custom-data/index.md) for information on how to execute the use case in the Sandbox environment.

## Endpoint {#endpoint}


API Reference: `POST /clients/{client_id}/custom-data`


API Reference: `POST /contracts/{contract_id}/custom-data`

<br />

