Skip to content
Open Breno

Export

Export knowledge as a JSON bundle, a ZIP of up to 500 items, or an asynchronous job for anything larger, and download and verify the archive.

Every export contains exactly what the token's owner may read, in the portable v2 format described in Export format. All of these need the export scope, and every one is recorded in the audit log.

Choose the right one#

OperationBest for
POST /knowledge/exportA small JSON bundle.
POST /knowledge/export/zipA ZIP of selected items, synchronously, up to 500 items. Above that it returns 413.
POST /knowledge/exportsEverything, or more than 500 items. Runs in the background.

A ZIP, directly#

Your own knowledge as a ZIP
curl -s -X POST -H "Authorization: Bearer $TOKEN" -o breno-export.zip "$BRENO/knowledge/export/zip"

With no list of ids, this exports your own knowledge, not the whole workspace.

An asynchronous export#

Start one
curl -s -X POST -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"scope":"personal"}' "$BRENO/knowledge/exports"

scope is personal (what you created, the default) or workspace (everything you may read; it needs an Admin or Owner, otherwise 403). The response is 202 with the job:

FieldMeaning
idThe job's id.
statusqueued, running, completed, failed, expired or cancelled.
item_count, bytes, sha256Filled in as it finishes.
errorWhy it failed, if it did.
expires_atWhen the archive stops being downloadable: seven days after it finishes.

A caller may have three jobs running and ten a day.

Download it#

Fetch the archive
curl -s -H "Authorization: Bearer $TOKEN" -o export.zip "$BRENO/knowledge/exports/$JOB_ID/download"
  • 200 streams the ZIP, with the archive's SHA-256 in the X-Export-SHA256 header.
  • 409 means the export has not finished, failed, or expired. A token cannot read the job's status, so poll the download: retry while it returns 409, and stop if it keeps failing and start a new export.
  • 404 means there is no such job, or it is not yours.

Verify#

Check every member
unzip export.zip -d export && cd export && sha256sum -c checksums.sha256