---
id: CreatePublisher
name: Create publisher
version: 1.0.0
badges:
  - content: Catalog Management
    backgroundColor: green
    textColor: green
summary: Creates a publisher in the Catalog.
owners:
  - catalog-experience-team
schemaPath: schema.json
operation:
  method: POST
  path: /api/v1/publishers
  statusCodes: ["200", "400"]
sidebar:
  badge: "POST"
---

`CreatePublisher` creates a new publisher record in [[service|catalog-api]] (`POST /catalog/api/v1/publishers`) and returns its generated UUIDv7 identifier as a JSON string. Callers use the returned identifier when linking publishers in [[command|CreateBook]] and [[command|UpdateBook]].

## Overview

| Property                           | Value                                                                                                                            |
| :--------------------------------- | :------------------------------------------------------------------------------------------------------------------------------- |
| **Bounded Context**                | Catalog                                                                                                                          |
| **Owner Service**                  | [[service\|catalog-api]]                                                                                                         |
| **Protocol / Format**              | HTTP `POST`, `application/json` request and JSON string response                                                                 |
| **Gateway Endpoint**               | `POST /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**      | Not idempotent; duplicate names violate the unique name constraint, and 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 list cache |
| **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                   |
| :----- | :------- | :------- | :-------------------------------------- | :---------------------------- |
| `name` | `string` | Yes      | Non-empty, max `100` characters, unique | Display name of the publisher |

:::note
`CreatePublisher` allows up to `100` characters, whereas [[command|UpdatePublisher]] currently enforces a `50`-character maximum.
:::

### Success Response (`200 OK`)

Returns `200 OK` without a `Location` header.

| Name       | Type     | Required | Constraints | Description                                          |
| :--------- | :------- | :------- | :---------- | :--------------------------------------------------- |
| Root value | `string` | Yes      | UUIDv7      | Generated unique identifier of the created publisher |

## Behavior & Side Effects

- **Persistence & uniqueness:** Inserts a new [[entity|publisher]] record with a generated UUIDv7 primary key; publisher names are unique-indexed, so submitting a duplicate name fails with `500 Internal Server Error`.
- **Cache invalidation:** Clears the cached publisher list (`catalog:publishers:v1`) upon successful creation.
- **Vector indexing:** No vector-index refresh is queued on publisher creation; vector updates are triggered only when an existing publisher is updated or deleted.

## Error Responses

| Status / Code               | Condition                                                                                       | Client Recovery Action                                                          |
| :-------------------------- | :---------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------ |
| `400 Bad Request`           | `name` is missing, empty, whitespace-only, exceeds `100` characters, or payload is malformed    | 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                               |
| `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 existing publishers for a duplicate name and inspect logs using `traceId` |

## Related Documentation

- [[service|catalog-api]] — Service overview, routing, and authorization policies.
- [[entity|publisher]] — Publisher entity model.
- [[command|UpdatePublisher]] — Rename an existing publisher.
- [[command|DeletePublisher]] — Remove a publisher with no active books.
- [[command|CreateBook]] — Assign a publisher to a new book listing.

<NodeGraph />

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


 ## Raw Schema:schema.json

{
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"title": "CreatePublisher",
	"description": "Payload for CreatePublisher.",
	"type": "object",
	"additionalProperties": false,
	"required": ["name"],
	"properties": {
		"name": {
			"type": "string",
			"minLength": 1,
			"description": "Display name of the catalog resource."
		}
	}
}
