REST API
The plain HTTP API behind the SDKs, for curl, Make, Zapier or any HTTP step.
Base URL and authentication
https://api.artefaktum.dev
Every request except /health/live and /health/ready needs an API key, created in the console, sent as:
Authorization: Bearer <key>
A request sent with no Authorization header can instead pay per request over x402, from a wallet and with no account: see Pay per request.
Requests and responses are JSON: send Content-Type: application/json on any body. The one exception is POST /v1/artifacts/files, where the body is the file itself: see Upload in one request.
The OpenAPI document is at https://api.artefaktum.dev/openapi.json; interactive docs from it are at https://api.artefaktum.dev/docs, useful for a typed client in a language the SDKs don’t cover.
For an agent reading about the API before it has a key, the same origin serves https://api.artefaktum.dev/llms.txt (a one-fetch Markdown index of the docs, the OpenAPI document and the MCP endpoint) and https://api.artefaktum.dev/.well-known/agent-card.json (an A2A-shaped agent card naming the MCP server, its skills and how to authenticate). Neither needs authentication.
Limits
Limits apply when you write. Artifacts that are already stored are never re-validated.
| Field | Limit |
|---|---|
title |
1 to 500 characters |
description |
10,000 characters |
tags |
50 per artifact |
| one tag | 1 to 64 characters, not blank |
metadata |
16,384 bytes as compact JSON, nested at most 5 levels deep |
external_key |
512 characters |
filename |
1,024 characters |
content_type |
255 characters |
run_id |
128 characters |
| request body | 262,144 bytes (256 KB) |
| file in a single-request upload | 103,809,024 bytes (99 MiB) |
| one text field in a form upload | 49,152 bytes (48 KiB) |
| text fields in a form upload | 64 |
A field over its limit answers 400 invalid_request. detail starts with the field’s
path, then says what was sent and what the limit is, for example
body.metadata: Value error, metadata is 20011 bytes as JSON; the limit is 16384. A
tag’s path carries its position in the list, as in body.tags.0. Branch on code, not
detail: its wording can change. A request body over 256 KB answers
413 request_too_large before it is read, for example
the request body exceeds the limit of 262144 bytes. This limit does not apply to your
files. With the three-step upload, the file goes straight to storage, up to the file size
of your plan. With the single-request upload, the file passes
through the API, up to 99 MiB.
Metadata depth counts containers: {} is one level, {"a": {"b": 1}} is two. Lists
count the same as objects.
Storage, monthly API calls and file size depend on your plan; see pricing.
Errors
Errors are application/problem+json (RFC 9457):
{
"type": "https://artefact.ai/errors/artifact_not_found",
"title": "Artifact not found",
"status": 404,
"detail": "artifact 0199198a-... not found",
"instance": "/v1/artifacts/0199198a-...",
"code": "artifact_not_found",
"request_id": "..."
}
code is the stable field to branch on; type, title and detail are for humans. Codes you’ll actually see:
| Code | Status | Meaning |
|---|---|---|
invalid_request |
400 | Body or query param failed validation. |
unauthorized |
401 | Missing or invalid bearer token. |
insufficient_scope |
403 | The key lacks the required scope. |
artifact_not_found |
404 | No such artifact, or it belongs to another tenant. |
run_not_found |
404 | No such run. |
artifact_not_ready |
409 | The artifact’s state doesn’t support this call. |
external_key_conflict |
409 | The external key is already used in this project. |
idempotency_conflict |
409 | Idempotency-Key reused with a different body. |
run_sealed |
409 | The run no longer accepts writes. |
upload_expired |
410 | The signed upload window closed before completion. |
object_verification_failed |
422 | The uploaded object failed verification. |
quota_exceeded |
413 | The file or tenant storage exceeds the plan limit. |
quota_exceeded |
429 | The monthly call limit is exhausted. |
request_too_large |
413 | A JSON request body is over 256 KB, or the file in a single-request upload is over 99 MiB. File bytes in the three-step upload never count. |
upload_pending |
409 | Only with if_exists=reuse. Another caller was still uploading under the same external key, and this call waited for it for about 25 seconds before it answered. Retry in a minute. |
upload_busy |
503 | Too many single-request uploads are in progress on the server, or your account already has 4 in progress. Retry after the number of seconds in Retry-After. |
upstream_unavailable |
502 | A dependency Artefaktum calls did not answer, for example object storage during a single-request upload. |
embedding_unavailable |
503 | The embedding provider could not produce a vector. |
quota_exceeded is deliberately the same code at two statuses: clients branch on the code, and 429 (not 402) is used so it doesn’t collide with a payment-required response.
Endpoints
| Method | Path | Scope | Purpose |
|---|---|---|---|
| GET | /health/live |
none | Liveness probe. |
| GET | /health/ready |
none | Liveness plus a database check. |
| GET | /health/whoami |
any | Return the tenant and project the key resolves to. |
| GET | /v1/projects |
artifacts:read |
List the projects this credential can use. |
| POST | /v1/artifacts/search |
artifacts:search |
Find artifacts by text, semantic similarity or filters. |
| POST | /v1/artifacts/resolve |
artifacts:write |
Reuse a fresh artifact by external key, or reserve it. |
| POST | /v1/artifacts/files |
artifacts:write |
Upload a file in one request, up to 99 MiB. |
| POST | /v1/artifacts/uploads |
artifacts:write |
Reserve a new artifact; get a signed upload URL. |
| POST | /v1/artifacts/{artifact_id}/versions/{version_id}/complete |
artifacts:write |
Confirm the bytes were uploaded. |
| GET | /v1/artifacts |
artifacts:read |
List artifacts in a project, with filters and a cursor. |
| GET | /v1/artifacts/by-external-key/{external_key} |
artifacts:read |
Look up an artifact by external key. Requires project_id; optional max_age_seconds. |
| GET | /v1/artifacts/{artifact_id} |
artifacts:read |
Read one artifact’s metadata and lifecycle state. |
| GET | /v1/artifacts/{artifact_id}/versions |
artifacts:read |
List an artifact’s versions, newest first. |
| GET | /v1/artifacts/{artifact_id}/download |
artifacts:read |
Get a short-lived signed download URL. |
| PATCH | /v1/artifacts/{artifact_id} |
artifacts:write |
Update title, description, tags, metadata or TTL. |
| POST | /v1/artifacts/{artifact_id}/uploads |
artifacts:write |
Start a new version; get a signed upload URL. |
| POST | /v1/artifacts/{artifact_id}/relations |
artifacts:write |
Add an explicit lineage relation. |
| GET | /v1/artifacts/{artifact_id}/relations |
artifacts:read |
List an artifact’s direct relations, both directions. |
| DELETE | /v1/artifacts/{artifact_id} |
artifacts:delete |
Request deletion (202 Accepted). |
| POST | /v1/runs |
artifacts:write |
Create or register a run id. |
| POST | /v1/runs/{run_id}/seal |
artifacts:write |
Reject further writes to a run. |
| GET | /v1/runs/{run_id}/artifacts |
artifacts:read |
List artifacts produced in a run. |
| POST | /v1/api-keys |
artifacts:admin |
Mint a key; the secret is returned once. |
| GET | /v1/api-keys |
artifacts:admin |
List keys, never their secrets. |
| DELETE | /v1/api-keys/{key_id} |
artifacts:admin |
Revoke a key. |
| GET | /v1/quota |
artifacts:read |
Plan, limits and current usage for the tenant. |
| GET | /v1/usage |
artifacts:admin |
Time-bucketed request and byte counts. |
A key can never be granted a scope its creator lacks.
Worked examples
Search
Exactly the call the homepage’s REST panel shows:
curl -s -X POST https://api.artefaktum.dev/v1/artifacts/search \
-H "Authorization: Bearer $ARTEFAKTUM_API_KEY" -H "Content-Type: application/json" \
-d '{"project_id": "…", "query": "latest enriched competitor list", "mode": "hybrid"}'
Request body fields:
| Field | Type | Default |
|---|---|---|
project_id |
UUID | required |
query |
string | "" |
mode |
"exact" | "text" | "semantic" | "hybrid" |
"hybrid" |
filters.tags_all |
string[] | [] |
filters.content_types |
string[] | [] |
filters.status |
string[] | ["ready"] |
filters.external_key |
string | none |
filters.created_after / filters.created_before |
date-time | none |
filters.exclude_superseded |
boolean | true |
limit |
integer, 1-200 | 20 |
cursor |
string | none |
Response items carry the artifact, a score and a match_mode; scores aren’t comparable across modes.
Create upload, PUT bytes, complete
curl -s -X POST https://api.artefaktum.dev/v1/artifacts/uploads \
-H "Authorization: Bearer $ARTEFAKTUM_API_KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"project_id": "'"$PID"'",
"title": "Acme enrichment response",
"filename": "acme.json",
"content_type": "application/json",
"size_bytes": 5120,
"tags": ["company", "enrichment"]
}'
Request body fields:
| Field | Type | Default |
|---|---|---|
project_id |
UUID | required |
filename |
string | required |
content_type |
string | required |
size_bytes |
integer | required |
title |
string | required |
description |
string | "" |
tags |
string[] | [] |
metadata |
object | {} |
external_key |
string | none |
expires_at |
date-time | none |
run_id |
string | none |
infer_lineage |
boolean | true |
summary was removed on 2026-09-27. A request that still sends the key is refused with 400 invalid_request, like any other unknown key, and responses no longer carry it. Clients published before then (Python SDK 0.1.1, TypeScript SDK 0.1.0, n8n node 0.1.3) send the key only when you set a summary; stop setting it or upgrade.
This is the one endpoint that accepts an Idempotency-Key header, so a retried request doesn’t create a second reservation.
Response:
{
"artifact": { "id": "...", "version_id": "...", "status": "pending_upload" },
"upload": { "method": "PUT", "url": "...", "headers": {"content-type": "application/json"}, "expires_at": "..." }
}
PUT the bytes to upload.url with the given headers, then complete:
curl -s -X PUT "$UPLOAD_URL" -H "Content-Type: application/json" --data-binary @acme.json
curl -s -X POST "https://api.artefaktum.dev/v1/artifacts/$AID/versions/$VID/complete" \
-H "Authorization: Bearer $ARTEFAKTUM_API_KEY"
Safe to repeat. The artifact is ready once the server verifies the object; embedding for semantic search happens afterwards, tracked separately as semantic_ready.
Upload in one request
POST /v1/artifacts/files sends the file and its details in one request, so you do not need the three steps above. Use it from tools that can send one HTTP request but cannot chain three, such as a phone shortcut or a Make scenario. The file passes through the API, so it is limited to 99 MiB. For a larger file, use the three-step upload above, which sends the bytes straight to storage. A file over the limit answers 413 request_too_large, and its detail points to the three-step upload. A request body over 100 MiB does not reach the API: the proxy in front of it answers 413 with an HTML page instead of JSON. A file over the storage or per-file limit of your plan answers 413 quota_exceeded, as in the three-step upload.
The route needs scope artifacts:write. It takes API keys and signed-in users. It is not available for pay-per-request wallets: a request with no Authorization header answers 401.
There are two ways to send the body.
- Raw body. The body is the file. Its
Content-Typeheader is stored as the artifact’s content type. An empty body is a400. If the header is absent, or isapplication/x-www-form-urlencoded(whatcurl --data-binarysends by default), the content type is stored asapplication/octet-stream. The details go in the query string. - Form body (
multipart/form-data). Send exactly one file part, namedfile. The part’s content type becomes the artifact’s content type. Its file name becomesfilename, unless you give afilenamedetail. The details can be text fields in the form, query parameters, or both. If a detail is in both, the form field wins. A repeatedtagin the form replaces thetagvalues in the query. A text field is limited to 48 KiB and a form to 64 fields.
The details:
| Name | Required | Meaning |
|---|---|---|
title |
yes | The artifact title, 1 to 500 characters. |
project |
no | Project slug or id. Default: default. |
key |
no | External key, 1 to 512 characters. An empty key= is a 400. |
if_exists |
no | error (default), version or reuse. Every value except error needs key. |
max_age_seconds |
no | Only with if_exists=reuse. A positive integer. |
filename |
no | Default: the file name given in the file part for a form upload. Otherwise the name is made from the title, with the extension that fits the content type, for example receipt.png. |
description |
no | Up to 10,000 characters. |
tag |
no | Repeat it for more than one tag. |
expires_in_hours |
no | A positive integer, at most 87,600 (10 years). Applied whenever this call stored bytes. |
run_id |
no | Up to 128 characters. |
A query parameter or form field with any other name answers 400 invalid_request and names it, so tags= instead of tag= is an error and is not ignored. The other limits in Limits apply to these details. For a raw body, the details are checked before the file is read. For a form body, an unknown query parameter name is refused before the body is read, and all other details are checked after the form has been received, because a form field may supply them.
The answers:
| Status | Meaning |
|---|---|
201 |
Bytes were stored: a new artifact or a new version. |
200 |
if_exists=reuse found a fresh artifact. Nothing was stored, and the response has a cache field. |
409 |
external_key_conflict: with if_exists=error, the key is already used. This includes a key that another upload still in progress holds. upload_pending: only with if_exists=reuse. Another caller was still uploading under the same key, and this call waited for it for about 25 seconds (5 rounds of at most 5 seconds) before it answered. Retry in a minute. |
413 |
The file is over 99 MiB (use the three-step upload), or over your plan’s limit (quota_exceeded). |
502 |
upstream_unavailable: storage did not accept the file. Nothing was stored, and the key is free at once. Send the file again. |
503 |
upload_busy: too many uploads are in progress on the server, or your account already has 4 uploads in progress. The Retry-After: 5 header says to retry in 5 seconds. |
With if_exists=version, an upload to a key that another upload still holds is not refused: each upload adds its own version.
A failed upload keeps nothing. If it was creating a new key, the key is free again at once. If it was adding a version to an existing artifact, the artifact keeps its current version. If your connection drops before the whole file has arrived, nothing is stored. If it drops after the whole file has arrived, the upload is not cancelled: the server finishes storing the file. A retry with if_exists=error then answers 409 external_key_conflict, because the first upload already used the key. So for an upload that you may retry, send a key with if_exists=reuse or if_exists=version.
A 201 or 200 response describes the artifact: id, title, status, content_type, size_bytes and more. The call waits up to 5 seconds for the server to verify the file, so status is the artifact’s status after that wait, usually ready or processing. On a reuse hit, status is the existing artifact’s status and there is no wait. Under if_exists=reuse, cache is created on a 201 and hit on a 200. Read it again with GET /v1/artifacts/{artifact_id} until it is ready.
# Raw body: the file is the body, the details are in the query string.
curl -s -X POST "https://api.artefaktum.dev/v1/artifacts/files?title=Receipt&key=receipts/2026-11-17&if_exists=reuse" \
-H "Authorization: Bearer $ARTEFAKTUM_API_KEY" -H "Content-Type: image/png" \
--data-binary @receipt.png
# Form body: the file is the part named "file"; the details are form fields.
curl -s -X POST https://api.artefaktum.dev/v1/artifacts/files \
-H "Authorization: Bearer $ARTEFAKTUM_API_KEY" \
-F "file=@receipt.png;type=image/png" -F "title=Receipt" -F "tag=receipt" -F "tag=2026"
Recipes
Each recipe uploads in one request and then reads the artifact back by its external key. Give the upload a key so that you can find it again. $PROJECT_ID is the project’s UUID. Get it from GET /v1/projects, which lists the projects your key can use. The read-back is the same in every recipe:
curl -s "https://api.artefaktum.dev/v1/artifacts/by-external-key/receipts%2F2026-11-17?project_id=$PROJECT_ID" \
-H "Authorization: Bearer $ARTEFAKTUM_API_KEY"
A key that you put on a phone or in a Make scenario can be copied by anyone who sees it. The console lets you choose the scopes of a key when you create it, so create a separate key for this with only artifacts:write and turn off the other scopes. This key can upload but cannot read, so the read-back above needs your main key. Revoke the key in the console if the phone is lost.
curl. Use either command from the section above. For the raw body, set Content-Type to the type of the file. If you omit it, the file is stored as application/octet-stream.
iOS Shortcut. Add the action “Get Contents of URL” and set it as follows:
- URL:
https://api.artefaktum.dev/v1/artifacts/files?title=Receipt&key=receipts/2026-11-17 - Method:
POST. - Headers: add
Authorizationwith the valueBearerfollowed by your key. - Request Body:
File, and choose the file (or a “Shortcut Input” variable) as its value.
Shortcuts sends the file as a raw body. If you want a specific content type, add a Content-Type header.
Make. Add the module “HTTP: Make a request” and set it as follows:
- URL:
https://api.artefaktum.dev/v1/artifacts/files - Method:
POST. - Headers: add
Authorizationwith the valueBearerfollowed by your key. - Body type:
Multipart/form-data. - Fields: add a field of type
Filenamedfile, mapped to the file from the previous module. Add text fieldstitleandkey.
Get a download URL
curl -s "https://api.artefaktum.dev/v1/artifacts/$AID/download" \
-H "Authorization: Bearer $ARTEFAKTUM_API_KEY"
Optional params: version_id (defaults to latest) and run_id (for lineage inference on a later upload). The response is a short-lived signed URL. Downloads go straight to storage and the API does not pass the bytes through. Fetching the URL records a usage event.
Resolve by external key
curl -s -X POST https://api.artefaktum.dev/v1/artifacts/resolve \
-H "Authorization: Bearer $ARTEFAKTUM_API_KEY" -H "Content-Type: application/json" \
-d '{
"project_id": "'"$PID"'",
"external_key": "company-api/acme/2026-09-17",
"max_age_seconds": 86400,
"filename": "acme.json", "content_type": "application/json",
"size_bytes": 5120, "title": "Acme enrichment"
}'
Request body fields:
| Field | Type | Default |
|---|---|---|
project_id |
UUID | required |
external_key |
string | required |
max_age_seconds |
integer | none (any existing artifact counts as fresh) |
filename |
string | required |
content_type |
string | required |
size_bytes |
integer | required |
title |
string | required |
description |
string | "" |
tags |
string[] | [] |
metadata |
object | {} |
run_id |
string | none |
status is hit (an artifact is returned, no upload needed), create (you hold the reservation: PUT to upload.url, then complete), or pending (retry after retry_after_seconds). For a plain lookup with no side effect, use GET /v1/artifacts/by-external-key/{external_key}?project_id=....
A key lookup requires project_id (omitting it is a 400) and takes an optional max_age_seconds (a positive integer; 0 or a negative value is a 400). An artifact last updated longer ago than that answers 404 artifact_not_found, with a detail such as artifact under key 'K' is 7200s old, older than max_age_seconds=3600:
curl -s "https://api.artefaktum.dev/v1/artifacts/by-external-key/openweather%2Fvilnius?project_id=$PROJECT_ID&max_age_seconds=3600" \
-H "Authorization: Bearer $ARTEFAKTUM_API_KEY"
Add a relation
curl -s -X POST "https://api.artefaktum.dev/v1/artifacts/$OUT_ID/relations" \
-H "Authorization: Bearer $ARTEFAKTUM_API_KEY" -H "Content-Type: application/json" \
-d '{"to_artifact_id": "'"$IN_ID"'", "to_version_id": "'"$IN_VERSION_ID"'", "relation_type": "derived_from"}'
Body: to_artifact_id (required), relation_type (required: derived_from, supersedes, attachment_of, generated_by or related_to), optional to_version_id, optional metadata. For derived_from, send to_version_id: it pins the version of the input you read (its latest_version.id at the time), so the artifact is flagged stale_upstream when the input gets a newer one; without it a new version of the input is not noticed. Explicit relations replace inferred ones. When an upload names a run_id, the server infers derived_from edges from whatever that key downloaded earlier in the run; pass "infer_lineage": false on the upload to suppress it.
Quota and usage
GET /v1/quota never counts against the monthly call limit, so a key can always see why it was refused. It returns the plan name, storage: {used_bytes, limit_bytes}, calls: {used, limit, resets_at}, and max_file_bytes. GET /v1/usage takes start, end, granularity (hour or day), metric, project_id and principal_id, returning time-bucketed counts for requests, requests_error, storage_bytes, bytes_uploaded and bytes_downloaded.
This page as Markdown: /docs/rest.md