API reference

Work files

The files of a Work: the deliverables it produced (reports, data, pages, images) and the context people handed it. List them, read one, and download its content. A sub-Work also sees the files its parent Works share with it. 3 endpoints. Add your API key in the authentication panel to send test requests from this page.

List a Work's files

GET/api/external/v1/works/{workId}/artifacts

The Work's own files and those its parent Works share with their sub-Works, newest first. Each: id, workRunId (the run it belongs to), kind, label, description, fileName, mimeType, sizeBytes, previewMode (how the Work Center shows it: MARKDOWN, CODE, HTML, ...), source (MODEL_PRODUCED, HUMAN_UPLOADED, ...), sharedWithSubWorks, createdAt and contentUrl (download it through this API).

Errors: 404 WORK_NOT_FOUND, 403 FEATURE_NOT_ENABLED.

Parameters

  • workIdstring (uuid)pathRequired

Responses

  • 200OK

Get a Work's file

GET/api/external/v1/works/{workId}/artifacts/{artifactId}

One of the Work's own files, as the list answers it (a file a parent Work shares is listed and downloaded under this Work, and read here under the Work it belongs to).

Errors: 404 WORK_NOT_FOUND, 404 ARTIFACT_NOT_FOUND, 403 FEATURE_NOT_ENABLED.

Parameters

  • workIdstring (uuid)pathRequired
  • artifactIdstring (uuid)pathRequired

Responses

  • 200OK

Download a Work's file

GET/api/external/v1/works/{workId}/artifacts/{artifactId}/content

Streams the file's bytes with its type, wherever they are stored; download=true answers it as an attachment with its file name. A file a Work wrote is never run as a page: it comes with Content-Security-Policy: sandbox, X-Content-Type-Options: nosniff and Cache-Control: private, no-store. The Work's own files and those its parent Works share with it can be downloaded.

Errors: 404 WORK_NOT_FOUND, 404 ARTIFACT_NOT_FOUND (not this Work's, or its content is no longer stored), 503 ARTIFACT_UNREADABLE, 403 FEATURE_NOT_ENABLED.

Parameters

  • workIdstring (uuid)pathRequired
  • artifactIdstring (uuid)pathRequired
  • downloadbooleanquery

    true: as an attachment with its file name.

Responses

  • 200OK