---
search:
  tags:
    - V1
    - POST
seo:
  description: >-
    Store a later immutable source revision for an… Reference for the POST
    /v1/projects/{projectId}/artifacts/{artifactId}/revisions endpoint in the
    Judgeval API.
sidebar:
  label: Create artifact revision
  badge: POST
title: Create artifact revision
type: openapi-operation
---
Store a later immutable source revision for an existing artifact. Reuse the version when retrying the same save: identical source and filename return the existing revision, different content is a conflict. Returns revision metadata without the source.

`POST /v1/projects/{projectId}/artifacts/{artifactId}/revisions`

**Request body** (`application/json`, required)

- `version` (integer, required) — The revision version; reuse it when retrying the same save
- `filename` (string, required) — The source filename, such as preprocess.js
- `source_code` (string, required) — The complete source code to store without truncation

Request body example:

```json
{
  "version": 1,
  "filename": "string",
  "source_code": "string"
}
```

**Responses**

- `200` — Response for status 200

Response example, 200:

```json
{
  "revision": {
    "id": "string",
    "artifact_id": "string",
    "version": 1,
    "storage": "string",
    "filename": "string",
    "size_bytes": 0,
    "created_by": "string",
    "created_at": "string"
  }
}
```
