---
title: "Canonicalize content"
method: POST
path: "/content/canonicalize"
tags: ["Content"]
---

# Canonicalize content

`POST /content/canonicalize`

Canonicalizes the provided content using the rules for the specified artifact type.  Canonicalization is specific to each artifact type, but typically involves removing extra whitespace, sorting object keys, and formatting the content in a consistent manner.  The canonicalized content is returned as the response body.

Note: this endpoint operates on the content as provided and does not resolve external references (`$ref`).  To canonicalize content with references resolved, use `GET /groups/{groupId}/artifacts/{artifactId}/versions/{versionExpression}/content?canonical=true` on a stored artifact instead.

This operation can fail for the following reasons:

* Provided content (request body) was empty (HTTP error `400`)
* The artifact type was not provided or was invalid (HTTP error `400`)
* A server error occurred (HTTP error `500`)

## Query parameters

- `artifactType` string, required

## Response `200`

The content of one version of one artifact.

## Other responses

- `400` — Common response for all operations that can return a `400` error.
- `401` — Common response for all operations that can return a `401` error indicating authentication is required.
- `403` — Common response for all operations that can return a `403` error indicating the user is authenticated but not authorized.
- `500` — Common response for all operations that can fail with an unexpected server error.

---

[API](https://skmtc.net/apicurio/apis/apicurio-registry-api-v3.md) · [All operations](https://skmtc.net/apicurio/apis/apicurio-registry-api-v3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/apicurio/apicurio-registry-api-v3/revisions/c39cb56d7dbc/schema)
