---
title: "Add or update custom metadata"
method: PUT
path: "/rest/api/index/document/{docId}/custom-metadata/{groupName}"
tags: ["Custom Metadata"]
---

# Add or update custom metadata

`PUT /rest/api/index/document/{docId}/custom-metadata/{groupName}`

Associates custom metadata with a specific document. Custom metadata enables you to enrich documents with additional structured information that can be used for search, filtering, and faceting.

## Request body

- CustomMetadataPutRequest — Request body for adding or updating custom metadata on a document
  - `customMetadata` CustomProperty[], required — Array of custom metadata key-value pairs
    - `name` string
    - `value` unknown

## Response `200`

OK

- SuccessResponse — Success response for custom metadata operations
  - `success` boolean — Indicates if the operation was successful

## Other responses

- `400` — Bad Request
- `401` — Not Authorized
- `404` — Not Found
- `429` — Too Many Requests
- `500` — Internal Server Error

---

[API](https://skmtc.dev/gleanwork/apis/glean-indexing-api.md) · [All operations](https://skmtc.dev/gleanwork/apis/glean-indexing-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gleanwork/glean-indexing-api/revisions/b47bf641faba/schema)
