---
title: "Update Aws Secret Reference"
method: POST
path: "/workspaces/{workspace_id}/secrets/aws/{secret_id}"
tags: ["secrets"]
---

# Update Aws Secret Reference

`POST /workspaces/{workspace_id}/secrets/aws/{secret_id}`

## Request

- Base URL: `https://platform.tracecat.com/api`
- URL: `https://platform.tracecat.com/api/workspaces/{workspace_id}/secrets/aws/{secret_id}`
- Auth: one of:
  - API key in cookie `fastapiusersauth`
  - HTTP bearer

Update the reference or key mapping of an AWS-backed secret.

## Path parameters

- `workspace_id` string, uuid, required
- `secret_id` string, required

## Request body

- AwsSecretReferenceUpdate: Update an AWS-backed workspace secret. Values are never accepted.
  - `name` string, nullable
  - `description` string, nullable
  - `environment` string, nullable
  - `tags` object, nullable
  - `store_id` string, uuid, nullable
  - `remote_reference` string, nullable
  - `key_mapping` AwsSecretKeyMapping: Declares how a remote AWS secret value maps onto output keys. ``whole_string`` maps the entire ``SecretString`` onto exactly one key. ``json`` maps selected top-level string fields onto declared keys.
    - `mode` 'whole_string' | 'json', required: How an AWS Secrets Manager value maps onto declared secret keys.
    - `keys` string[]
    - `fields` AwsSecretJsonField[]
      - `key` string, required
      - `field` string, required

## Response `204`

Successful Response

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/tracecat/apis/tracecat-api.md) - [All operations](https://skmtc.dev/tracecat/apis/tracecat-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tracecat/apis/tracecat-api/revisions/2efdda25045f?raw)
