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

# Update artifact

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

## Request

- The document declares no server URL.
- Auth: none declared

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.

## Request body

- ArtifactContent
  - `content` string, required: Raw content of the artifact or a valid (and accessible) URL where the content can be found.
  - `references` ArtifactReference[], required: Collection of references to other artifacts.
    - `groupId` string, required
    - `artifactId` string, required
    - `version` string
    - `name` string, required

## 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.

## Changes

> 65 revisions in range; 1 not diffed.

- **2023-02-02** (v2) `5152639bee96`: 2 info
  - added the media type `application/vnd.create.extended+json` to the request body
  - the request's body type was generalized from no type to `string`, and format from no format to `binary`
- **2022-11-24** (v2) `29b79a1c2c74`: 10 info
  - removed the `ASYNCAPI` enum value from the `type` response property for the response status `200`
  - removed the `AVRO` enum value from the `type` response property for the response status `200`
  - removed the `GRAPHQL` enum value from the `type` response property for the response status `200`
  - removed the `JSON` enum value from the `type` response property for the response status `200`
  - …6 more
- **2022-04-25** (v2) `d1a3061ccc48`: 1 info
  - the request's body type was generalized from `string` to no type, and format from `binary` to no format
- **2022-04-01** (v2) `79156695de01`: 1 info
  - added the media type `application/create.extended+json` to the request body
- **2022-03-22** (v2) `c7368363b270`: 1 info
  - added the optional property `references` to the response with the `200` status

[Operation history](https://skmtc.dev/apicurio/apis/apicurio-registry-api-v2/changes/groups/:groupId/artifacts/:artifactId/put.md)

---

[API](https://skmtc.dev/apicurio/apis/apicurio-registry-api-v2.md) - [All operations](https://skmtc.dev/apicurio/apis/apicurio-registry-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/apicurio/apis/apicurio-registry-api-v2/revisions/8c48f413fa1f?raw)
