---
title: "Update artifact"
method: PUT
path: "/groups/{groupId}/artifacts/{artifactId}"
tags: ["Artifacts"]
---

# Update artifact

`PUT /groups/{groupId}/artifacts/{artifactId}`

Updates an artifact by uploading new content.  The body of the request can
be the raw content of the artifact or a JSON object containing both the raw content and
a set of references to other artifacts..  This is typically in JSON format for *most*
of the supported types, but may be in another format for a few (for example, `PROTOBUF`).
The type of the content should be compatible with the artifact's type (it would be
an error to update an `AVRO` artifact with new `OPENAPI` content, for example).

The update could fail for a number of reasons including:

* Provided content (request body) was empty (HTTP error `400`)
* No artifact with the `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`)

When successful, this creates a new version of the artifact, making it the most recent
(and therefore official) version of the artifact.

## 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-Name-Encoded` string — Base64 encoded name of the artifact.
- `X-Registry-Description` string — Description of the artifact.
- `X-Registry-Description-Encoded` string — Base64 encoded description of the artifact.

## Response `200`

When successful, returns the updated artifact metadata.

- ArtifactMetaData
  - `name` string
  - `description` string
  - `createdBy` string, required
  - `createdOn` string, date-time, required
  - `modifiedBy` string, required
  - `modifiedOn` string, date-time, required
  - `id` string, required — The ID of a single artifact.
  - `version` string, required
  - `type` string, required
  - `globalId` integer, required
  - `state` 'ENABLED' | 'DISABLED' | 'DEPRECATED', required — Describes the state of an artifact or artifact version. The following states are possible: * ENABLED * DISABLED * DEPRECATED
  - `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
  - `references` ArtifactReference[]
    - `groupId` string, required
    - `artifactId` string, required
    - `version` string
    - `name` string, 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)
