Upload an artifact
const url = 'https://example.com/v1/artifacts';const form = new FormData();form.append('file', 'file');form.append('name', 'example');form.append('contentType', 'example');form.append('tags', '"example"');form.append('ownerRunId', '2489E9AD-2EE2-8E00-8EC9-32D5F69181C0');form.append('projectId', 'example');form.append('expectedHash', 'example');form.append('forRun', 'true');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/artifacts \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form file=@file \ --form name=example \ --form contentType=example \ --form 'tags="example"' \ --form ownerRunId=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --form projectId=example \ --form expectedHash=example \ --form forRun=trueUse files.create. Removed in 0.9.0.
Multipart upload. file part carries the bytes; other form fields carry metadata (name, contentType, tags (JSON), ownerRunId, projectId, expectedHash, forRun). Framework computes sha256 and returns it in BlobMeta.hash. If expectedHash was supplied and diverges, response is 400 blob-hash-mismatch. Content-type sniffing is NOT performed server-side — the framework trusts the caller. The artifact belongs to its owner run’s project, else projectId, else the project the caller’s API key is limited to, else the workspace’s default project; uploading needs write there, and a key limited to a project uploads into that project only. A person with run there and no write may upload a file that names no ownerRunId: an input for a run they start, which they may download again. Such an upload is always forRun. The runtime limits what one person uploads that way in a workspace in 24 hours, by default to 1 GiB and 1,000 files: past it, the upload is 429 upload-limit-reached, saying when it fits. A forRun upload is deleted once the server’s unused-upload time has passed (24 hours by default) unless a run that names it in its input has started by then; until one does, BlobMeta.expiresAt says when. An upload over the runtime’s cap (default 100 MiB) is 413 artifact-too-large. One that the workspace’s storage limit has no room for is 403 storage-limit-reached, and nothing is stored.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Multipart form. file is the byte stream (required). Other fields are optional metadata: name (defaults to file part filename), contentType (defaults to file part MIME), tags (JSON-encoded object), ownerRunId (RunId string), expectedHash (sha256 hex, framework rejects on mismatch), forRun (true for an input to a run that hasn’t started).
object
Responses
Section titled “Responses”Upload accepted; metadata returned.
object
Examplegenerated
{ "blobId": "example", "tenantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "contentType": "example", "size": 1, "hash": "example", "tags": { "additionalProperty": "example" }, "ownerRunId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "projectId": "example", "createdBy": "example", "createdAt": "2026-04-15T12:00:00Z", "expiresAt": "2026-04-15T12:00:00Z", "bucket": "example", "key": "example", "fileId": "example", "version": 1}Malformed multipart body, bad tag JSON, a forRun that isn’t true or false or comes with ownerRunId, hash mismatch, declared size mismatch, or a projectId that isn’t the owner run’s.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}No write on the project, and no run there for an upload of the caller’s own that names no run (permission-denied); the caller’s API key is limited to another project (key-project-mismatch); or the workspace’s storage limit has no room for the file (storage-limit-reached; details.storageMiB, usedBytes and neededBytes say how much).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}No such owner run (run-not-found).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Idempotency-Key was reused with a different body, or resource-state conflict. Or idempotency-key-in-flight (with Retry-After): a request with the same Idempotency-Key still runs, so this one wasn’t run; send it again after Retry-After to get that request’s answer.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”Over the upload cap (artifact-too-large; details.maxBytes says how much).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}An upload passing on run alone, past what one person may upload that way in the window (upload-limit-reached). details carries the limit (maxBytes, maxFiles), what’s used (usedBytes, usedFiles), windowSeconds and retryAt; Retry-After says when this upload fits. Nothing is stored. Or rate-limit-exceeded with details.limit: "api-requests", on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; Retry-After says when to send it again.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”Server error (unmapped domain code or framework crash).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The Idempotency-Key store (idempotency-store-unavailable) or the authorization store (authz-backend-unavailable) couldn’t be reached before the request ran, or the database was too busy for its authorization check (database-busy), so nothing was changed; Retry-After (whole seconds) says when to try again with the same key. Or tenant-state-unavailable (with Retry-After), on a runtime serving many workspaces: the workspace’s state couldn’t be read, so nothing was changed.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”See also
GET /v1/artifacts: List artifact metadata- Files and versions
- Kindgi 0.1.10
- Kindgi 0.1.8
- Error code
artifact-too-large - Error code
authz-backend-unavailable - Error code
database-busy - Error code
idempotency-key-in-flight - Error code
idempotency-store-unavailable - Error code
key-project-mismatch - Error code
permission-denied - Error code
rate-limit-exceeded - Error code
run-not-found - Error code
storage-limit-reached - Error code
tenant-state-unavailable - Error code
upload-limit-reached - Every error code