---
id: UpdatePublisher
name: Update publisher
version: 1.0.0
badges:
  - content: Catalog Management
    backgroundColor: green
    textColor: green
summary: Updates an existing publisher in the Catalog.
owners:
  - catalog-experience-team
schemaPath: schema.json
operation:
  method: PUT
  path: /api/v1/publishers
  statusCodes: ["204", "400", "404"]
sidebar:
  badge: "PUT"
---

`UpdatePublisher` updates the display name of an existing publisher in [[service|catalog-api]] (`PUT /catalog/api/v1/publishers`) and returns `204 No Content`. Callers pass both `id` and `name` in the JSON request body rather than as a path parameter.

## Overview

| Property                           | Value                                                                                                                                 |
| :--------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------ |
| **Bounded Context**                | Catalog                                                                                                                               |
| **Owner Service**                  | [[service\|catalog-api]]                                                                                                              |
| **Protocol / Format**              | HTTP `PUT`, `application/json` request and empty response (`204 No Content`)                                                          |
| **Gateway Endpoint**               | `PUT /catalog/api/v1/publishers` (service path `/api/v1/publishers`)                                                                  |
| **Authentication & Authorization** | Microsoft Entra ID JWT — `business_user` policy (role `business_user` or `admin` and scopes `catalog_read`, `catalog_write`)          |
| **Idempotency / Concurrency**      | Naturally idempotent for repeated requests with the same `id` and `name`; no `x-request-id` header is enforced                        |
| **Rate Limit / Caching**           | Global concurrency (`100`) and fixed-window (`30 req/min`) limiters plus per-user token bucket; invalidates publisher and book caches |
| **Contract Version**               | `1.0.0` (`ApiVersions.V1`)                                                                                                            |

## Request & Response Contract

### Request Body (`application/json`)

Leading and trailing whitespace is trimmed from string properties during deserialization.

| Name   | Type              | Required | Constraints                            | Description                                |
| :----- | :---------------- | :------- | :------------------------------------- | :----------------------------------------- |
| `id`   | `string` (`uuid`) | Yes      | Non-empty UUID                         | Identifier of the publisher to update      |
| `name` | `string`          | Yes      | Non-empty, max `50` characters, unique | Replacement display name for the publisher |

:::note
`UpdatePublisher` enforces a `50`-character maximum, which is narrower than the `100`-character limit allowed by [[command|CreatePublisher]]. Updating a publisher to a name between 51 and 100 characters returns `400 Bad Request`.
:::

## Behavior & Side Effects

- **Persistence & uniqueness:** Updates the [[entity|publisher]] display name; publisher names are unique-indexed, so renaming to an existing publisher's name fails with `500 Internal Server Error`.
- **Cache invalidation:** Clears `catalog:publishers:v1` and invalidates `book` and `books:list` cache tags.
- **Vector index queueing:** Database triggers enqueue all linked book IDs for asynchronous vector embedding refresh by [[service|catalog-ingestion]].

## Error Responses

| Status / Code               | Condition                                                                                               | Client Recovery Action                                                  |
| :-------------------------- | :------------------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------- |
| `400 Bad Request`           | `id` is empty or invalid UUID, or `name` is missing, empty, whitespace-only, or exceeds `50` characters | Fix the request body; do not retry unchanged input                      |
| `401 Unauthorized`          | Missing, expired, or invalid Entra ID JWT                                                               | Acquire a valid Entra ID access token and retry                         |
| `403 Forbidden`             | Token lacks role `business_user` or `admin`, or lacks scopes `catalog_read` and `catalog_write`         | Request the required Entra ID app role and scopes                       |
| `404 Not Found`             | No publisher exists with the supplied `id`                                                              | Verify the UUID; do not treat `404` as a completed update               |
| `429 Too Many Requests`     | Rate limit quota exceeded (`Retry-After` header included)                                               | Wait for the `Retry-After` interval before retrying                     |
| `500 Internal Server Error` | Duplicate `name` violating the unique constraint or unhandled server error (`traceId` included)         | Check for a conflicting publisher name and inspect logs using `traceId` |

## Related Documentation

- [[service|catalog-api]] — Service overview, routing, and authorization policies.
- [[entity|publisher]] — Publisher entity model.
- [[command|CreatePublisher]] — Create a new publisher record.
- [[command|DeletePublisher]] — Permanently delete a publisher with no active books.

<NodeGraph />

<SchemaViewer file="schema.json" title="Update publisher schema" maxHeight="500" search="true" />


 ## Raw Schema:schema.json

{
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"title": "UpdatePublisher",
	"description": "Payload for updating a publisher.",
	"type": "object",
	"additionalProperties": false,
	"required": ["id", "name"],
	"properties": {
		"id": {
			"type": "string",
			"format": "uuid",
			"description": "Identifier of the publisher to update."
		},
		"name": {
			"type": "string",
			"minLength": 1,
			"description": "New display name for the publisher."
		}
	}
}
