Skip to content
Judgment Labs
Esc
↑↓navigate↵open⌘Jpreview

Create artifact

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
Authorization
AuthorizationPersonal API key · headerrequired

Your personal API key from Settings > Personal API Keys, sent as Bearer <key>.

X-Organization-IdOrganization ID · headerrequired

The organization to act in. Copy it with Copy organization ID in the organization menu or the settings sidebar.

Path parameters
projectIdstringrequired
Request body
requiredapplication/json
scopestringrequired

The artifact consumer

namestringrequired

The artifact display name

matches \S
filenamestringrequired

The source filename, such as preprocess.js

matches \S
source_codestringrequired

The complete source code to store without truncation

Responses
200

Response for status 200

revisionobjectrequired
Show properties
idstringrequired
artifact_idstringrequired
versionintegerrequired
max 9007199254740991
storagestringrequired
filenamestringrequired
size_bytesintegerrequired
min 0 · max 9007199254740991
created_bystring | nullrequired
created_atstringrequired
artifactobjectrequired
Show properties
idstringrequired
organization_idstringrequired
project_idstringrequired
scopestringrequired
namestringrequired
created_bystring | nullrequired
created_atstringrequired
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://api.judgmentlabs.ai/v1/projects/YOUR_PROJECT_ID/artifacts' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'X-Organization-Id: YOUR_ORGANIZATION_ID' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "scope": "judge_preprocessor",
  "name": "string",
  "filename": "string",
  "source_code": "string"
}'
Response
{
  "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"
  }
}

Was this page helpful?