---
search:
  tags:
    - V1
    - POST
seo:
  description: >-
    Create a project-owned code artifact and its initial immutable source…
    Reference for the POST /v1/projects/{projectId}/artifacts endpoint in the
    Judgeval API.
sidebar:
  label: Create artifact
  badge: POST
title: Create artifact
type: openapi-operation
---
Create a project-owned code artifact and its initial immutable source revision (version 1). Returns the artifact and revision metadata without the source. Retrying identical input returns the same records; different content at version 1 is a conflict.

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

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

- `scope` (string, required) — The artifact consumer
- `name` (string, required) — The artifact display name
- `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
{
  "scope": "judge_preprocessor",
  "name": "string",
  "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"
  },
  "artifact": {
    "id": "string",
    "organization_id": "string",
    "project_id": "string",
    "scope": "string",
    "name": "string",
    "created_by": "string",
    "created_at": "string"
  }
}
```
