---
title: "Create artifact version"
method: POST
path: "/groups/{groupId}/artifacts/{artifactId}/versions"
tags: ["Versions"]
---

# Create artifact version

`POST /groups/{groupId}/artifacts/{artifactId}/versions`

Creates a new version of the artifact by uploading new content.  The configured rules for
the artifact are applied, and if they all pass, the new content is added as the most recent 
version of the artifact.  If any of the rules fail, an error is returned.

The body of the request can be the raw content of the new artifact version, or the raw content 
and a set of references pointing to other artifacts, and the type
of that content should match the artifact's type (for example if the artifact type is `AVRO`
then the content of the request should be an Apache Avro document).

This operation can fail for the following reasons:

* Provided content (request body) was empty (HTTP error `400`)
* No artifact with this `artifactId` exists (HTTP error `404`)
* The new content violates one of the rules configured for the artifact (HTTP error `409`)
* A server error occurred (HTTP error `500`)

## Headers

- `X-Registry-Version` string — A single version of an artifact. Can be provided by the client when creating a new version, or it can be server-generated. The value can be any string unique to the artifact, but it is recommended to use a simple integer or a semver value.
- `X-Registry-Name` string — Name of the artifact.
- `X-Registry-Description` string — Description of the artifact.
- `X-Registry-Description-Encoded` string — Base64 encoded description of the artifact.
- `X-Registry-Name-Encoded` string — Base64 encoded name of the artifact.

## Response `200`

The artifact version was successfully created.

- VersionMetaData
  - `version` string, required
  - `name` string
  - `description` string
  - `createdBy` string, required
  - `createdOn` string, date-time, required
  - `type` string, required
  - `globalId` integer, required
  - `state` 'ENABLED' | 'DISABLED' | 'DEPRECATED' — Describes the state of an artifact or artifact version. The following states are possible: * ENABLED * DISABLED * DEPRECATED
  - `id` string, required — The ID of a single artifact.
  - `labels` string[]
  - `properties` Properties — User-defined name-value pairs. Name and value must be strings.
  - `groupId` string — An ID of a single artifact group.
  - `contentId` integer, required

## Other responses

- `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.
- `404` — Common response for all operations that can return a `404` error.
- `409` — Common response used when an input conflicts with existing data.
- `500` — Common response for all operations that can fail with an unexpected server error.

---

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