Sourced
llms.txt
View Markdown

Artifacts ยท version 0.1.0

Download a run artifact

GET/api/artifacts/download

Streams a generated SDK bundle, docs, report file, or authenticated source input file for a run. Pass the run id plus an artifact key from `run.artifactManifest.artifacts[]`. Source input artifacts such as `input.openapi` and `input.config` require the same workspace membership and artifact entitlement as generated artifacts.

Request

cURL
curl -X GET 'https://sourced.sh/api/artifacts/download' \
  -H 'Authorization: Bearer $SOURCED_API_KEY'
TypeScript
const response = await fetch("https://sourced.sh/api/artifacts/download", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.SOURCED_API_KEY}`,
  },
});
const data = await response.json();
Python
import os
import requests

response = requests.request(
    "GET",
    "https://sourced.sh/api/artifacts/download",
    headers={"Authorization": f"Bearer {os.environ['SOURCED_API_KEY']}"},
)

data = response.json()

Parameters

Query parameters

NameTypeRequiredDescription
runIdstringYesRun id that owns the artifact.
keystringYesArtifact storage key from `run.artifactManifest.artifacts[]`. Generated artifacts and authenticated source input artifacts are downloadable by workspace members with artifact access.

Responses

200

Artifact contents.

application/octet-stream

Schema
type: string

400

401

402

403

404

410

The artifact has expired.

application/json

Schema
Error:
  type: object
  required: error
  properties:
    error (required): string
      Stable machine-readable error code.
    message: string
      Optional human-readable description.
Was this helpful?