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

Create artifact revision

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
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
artifactIdstring<uuid>required
matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Request body
requiredapplication/json
versionintegerrequired

The revision version; reuse it when retrying the same save

min 1 · max 2147483647
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
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://api.judgmentlabs.ai/v1/projects/YOUR_PROJECT_ID/artifacts/YOUR_ARTIFACT_ID/revisions' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'X-Organization-Id: YOUR_ORGANIZATION_ID' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "version": 1,
  "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"
  }
}

Was this page helpful?