---
title: "POST /#X-Amz-Target=PaymentCryptographyControlPlane.TagResource"
method: POST
path: "/#X-Amz-Target=PaymentCryptographyControlPlane.TagResource"
---

# POST /#X-Amz-Target=PaymentCryptographyControlPlane.TagResource

`POST /#X-Amz-Target=PaymentCryptographyControlPlane.TagResource`

Adds or edits tags on an Amazon Web Services Payment Cryptography key.

Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the key.

Each tag consists of a tag key and a tag value, both of which are case-sensitive strings. The tag value can be an empty (null) string. To add a tag, specify a new tag key and a tag value. To edit a tag, specify an existing tag key and a new tag value. You can also add tags to an Amazon Web Services Payment Cryptography key when you create it with [CreateKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html).

**Cross-account use:** This operation supports cross-account use when the key has a resource-based policy that grants access. For more information, see [Resource-based policies](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/security_iam_resource-based-policies.html).

**Related operations:**

*   [ListTagsForResource](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ListTagsForResource.html)
    
*   [UntagResource](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_UntagResource.html)

## Headers

- `X-Amz-Target` 'PaymentCryptographyControlPlane.TagResource', required

## Request body

- TagResourceInput
  - `ResourceArn` string, required — The <code>KeyARN</code> of the key whose tags are being updated.
  - `Tags` Tag[], required — <p>One or more tags. Each tag consists of a tag key and a tag value. The tag value can be an empty (null) string. You can't have more than one tag on an Amazon Web Services Payment Cryptography key with the same tag key. If you specify an existing tag key with a different tag value, Amazon Web Services Payment Cryptography replaces the current tag value with the new one.</p> <important> <p>Don't include personal, confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p> </important> <p>To use this parameter, you must have <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_TagResource.html">TagResource</a> permission in an IAM policy.</p> <important> <p>Don't include personal, confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p> </important>
    - `Key` string, required — The key of the tag.
    - `Value` string, required — The value of the tag.

## Response `200`

Success

- TagResourceOutput

## Other responses

- `480` — ServiceQuotaExceededException
- `481` — ServiceUnavailableException
- `482` — ValidationException
- `483` — ConflictException
- `484` — AccessDeniedException
- `485` — ResourceNotFoundException
- `486` — ThrottlingException
- `487` — InternalServerException

---

[API](https://skmtc.net/aws/apis/payment-cryptography.md) · [All operations](https://skmtc.net/aws/apis/payment-cryptography/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/payment-cryptography/versions/1b0b83160e8d/schema)
