---
title: "Set Resource Metadata"
description: "Use /metadata/set to replace the complete metadata object associated with a stored resource. This is handy when you want to initialize metadata for a KMS key, DID, or credential or when you want to overwrite all…"
stack: "Enterprise Stack (commercial) — version 0.21.0"
stack_version: "0.21.0"
stack_comparison: https://docs.walt.id/community-vs-enterprise.md
canonical_url: https://docs.walt.id/enterprise-stack/administration/services/metadata/set
generated: 2026-07-20
---
# Set Resource Metadata

Use `/metadata/set` to replace the complete metadata object associated with a stored resource. This is handy when you want to initialize metadata for a KMS key, DID, or credential or when you want to overwrite all metadata fields in one go.

## Set metadata (KMS key example)

**Option: CURL**

Endpoint: `/v1/{target}/kms-service-api/keys/metadata/set` | [API Reference](https://enterprise.sandbox.walt.id/swagger/index.html#/Service%20%7C%20Key%20Management/put_v1__target__kms_service_api_metadata_set)

**Example Request**

```bash
curl -X 'PUT' \
  'https://{orgHost}.enterprise-sandbox.waltid.dev/v1/{target}/kms-service-api/keys/metadata/set' \
  -H 'accept: */*' \
  -H 'Authorization: Bearer {yourToken}' \
  -H 'Content-Type: application/json' \
  -d '{
    "description": "Primary signing key for sandbox issuer",
    "tags": ["issuing", "production"]
  }'
```

**Path Parameters**

- `orgHost`: _String_ - Organization host alias to call against. In sandbox, `test` maps to `https://test.enterprise-sandbox.waltid.dev`.
- `target`: _resourceIdentifier_ - Full path to the KMS key (or other resource) whose metadata you want to replace, e.g. `test.tenant1.kms-eu.key-auth`.

**Body**

```json
{
  "description": "Primary signing key for sandbox issuer",
  "tags": [
    "issuing",
    "production"
  ]
}
```

**Body Parameters**

- `metadata`: _JSON object_ - Arbitrary key/value pairs describing the resource. Send `{}` to clear all fields in a single step.

**Response Codes**

- `200` – Metadata stored successfully.
- `400` – Malformed JSON payload.
- `401/403` – Authentication or authorization failure.
