API reference

Export and erasure

Export the organization's dev data as a signed archive, or erase it after a 24-hour grace.

GET/v1/dev/exports

List exports

The organisation's newest exports, without download urls.

The organisation's exports, newest first: 20 unless limit says otherwise, 50 at most, and no cursor (has_more says whether older ones exist). An entry never carries download: only dev.org.export.get mints the 15-minute url and records it.

Permission: dev:org.export

Parameters

NameTypeRequiredDescription
limitqueryintegerOptionalclamped to 1 to 50

Response200 OK

dataarray of objectsRequired
newest first; download is always null
data[].bytesinteger or null
the archive's size
data[].completed_atstring (date-time) or null
data[].downloadobject or null
on dev.org.export.get of a ready export only
data[].download.expires_atstring (date-time)Required
data[].download.urlstring (uri)Required
data[].errorstring or null
why a failed export failed
data[].expires_atstring (date-time) or null
when the archive is deleted
data[].idstringRequired
devexp_<32 hex>, with the cell's prefix
data[].requested_atstring (date-time)Required
data[].requested_bystringRequired
the person who asked for it
data[].rowsmap of integer or null
the rows of each file
data[].sha256string or null
the archive's sha-256, hex
data[].statestringRequired
One of pending, running, ready, failed, expired
has_morebooleanRequired
older exports exist past limit
next_cursorstring or null
always absent; the list has no cursor

Errors

curl "$CIRESK_API/v1/dev/exports" \
  -H "Authorization: Bearer $CIRESK_KEY"
POST/v1/dev/exports

Create an export

Export the organisation's dev data as a signed archive.

A person with dev:org.export asks for an export of everything dev holds for the organisation that retention has not yet deleted: its sessions with their writers, device grants, members, needs, ci records and web handoffs, every session's journal, every policy version, template versions, promotions and files, egress decisions, connection windows, the usage ledger, workers, session secrets' names and bindings (never a value), erasures, exports, and every dev audit record as dev.audit.list shows it. One JSONL file per table in a zip with manifest.json (each file's sha-256 and row count) and manifest.sig, a dvx_ assertion over the manifest's sha-256 by the cell's signing key (GET /v1/dev/keys). The export is built in the background; a pending or running export of the organisation answers that one. Recorded as dev.org.export at request and dev.org.exported or dev.org.export.failed at the end. Without the installation's object store it answers 503 export_unavailable.

Permission: dev:org.export

Response202 Accepted

bytesinteger or null
the archive's size
completed_atstring (date-time) or null
downloadobject or null
on dev.org.export.get of a ready export only
download.expires_atstring (date-time)Required
download.urlstring (uri)Required
errorstring or null
why a failed export failed
expires_atstring (date-time) or null
when the archive is deleted
idstringRequired
devexp_<32 hex>, with the cell's prefix
requested_atstring (date-time)Required
requested_bystringRequired
the person who asked for it
rowsmap of integer or null
the rows of each file
sha256string or null
the archive's sha-256, hex
statestringRequired
One of pending, running, ready, failed, expired

Errors

  • 403an error
  • 503export_unavailable: the installation has no object store for exports
curl -X POST "$CIRESK_API/v1/dev/exports" \
  -H "Authorization: Bearer $CIRESK_KEY"
GET/v1/dev/exports/{export_id}

Get an export

An export of the organisation, with a download url once it is ready.

A ready export carries download, a GET url valid 15 minutes, minted at each read and recorded as dev.org.export.downloaded. The archive is deleted 7 days after it was built (state expired) and with the organisation's erasure.

Permission: dev:org.export

Parameters

NameTypeRequiredDescription
export_idpathstringRequiredThe export's ID.

Response200 OK

bytesinteger or null
the archive's size
completed_atstring (date-time) or null
downloadobject or null
on dev.org.export.get of a ready export only
download.expires_atstring (date-time)Required
download.urlstring (uri)Required
errorstring or null
why a failed export failed
expires_atstring (date-time) or null
when the archive is deleted
idstringRequired
devexp_<32 hex>, with the cell's prefix
requested_atstring (date-time)Required
requested_bystringRequired
the person who asked for it
rowsmap of integer or null
the rows of each file
sha256string or null
the archive's sha-256, hex
statestringRequired
One of pending, running, ready, failed, expired

Errors

curl "$CIRESK_API/v1/dev/exports/591b4a91-0807-456c-a866-7ebbca042b12" \
  -H "Authorization: Bearer $CIRESK_KEY"
GET/v1/dev/erasure

Get the latest erasure

Permission: dev:org.erase

Response200 OK

checkpointsinteger or null
the checkpoint objects and versions deleted, once erased; null when the installation has no store configured and the bucket's 30-day rule removes them
completed_atstring (date-time) or null
when it was erased or cancelled
erase_afterstring (date-time)Required
the end of the 24-hour grace
killedintegerRequired
the live sessions the request stopped
requested_atstring (date-time)Required
rowsinteger or null
the dev rows deleted, once erased
statestringRequired
cancelled: dev.org.erasure.cancel within the grace; the sessions the request killed stay endedOne of erasing, erased, cancelled
subjectsinteger or null
the audit subjects erased, once erased

Errors

curl "$CIRESK_API/v1/dev/erasure" \
  -H "Authorization: Bearer $CIRESK_KEY"
POST/v1/dev/erasure

Erase the organization's data

Erase the organisation's dev data after a 24-hour grace.

A person with dev:org.erase types the organisation's id back. Every live session is killed at once (the kill switch, reason org_erasure) and dev.sessions.up answers 409 org_erasing until the erasure completes. After erase_after (24 hours on) the sweeper deletes every dev row of the organisation, its checkpoint objects when the installation configured the store, and erases every subject its audit records name (the records stay, pseudonymised); the erasure is recorded as dev.org.erase at request and dev.org.erased at the end. A request while one is pending answers that one.

Permission: dev:org.erase

Request body

confirmstringRequired
the organisation's id, typed back

Response202 Accepted

checkpointsinteger or null
the checkpoint objects and versions deleted, once erased; null when the installation has no store configured and the bucket's 30-day rule removes them
completed_atstring (date-time) or null
when it was erased or cancelled
erase_afterstring (date-time)Required
the end of the 24-hour grace
killedintegerRequired
the live sessions the request stopped
requested_atstring (date-time)Required
rowsinteger or null
the dev rows deleted, once erased
statestringRequired
cancelled: dev.org.erasure.cancel within the grace; the sessions the request killed stay endedOne of erasing, erased, cancelled
subjectsinteger or null
the audit subjects erased, once erased

Errors

  • 403an error
  • 422validation_failed: confirm is not the organisation's id
curl -X POST "$CIRESK_API/v1/dev/erasure" \
  -H "Authorization: Bearer $CIRESK_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "confirm": "acme/platform"
  }'
DELETE/v1/dev/erasure

Cancel the pending erasure

Cancel the organisation's pending erasure within its 24-hour grace.

A person with dev:org.erase cancels the pending erasure while erase_after is still ahead: its state becomes cancelled with completed_at set, the row stays as the evidence, and dev.sessions.up works again. The sessions the request killed stay ended. Recorded as dev.org.erasure.cancelled. A cancel of an erasure already cancelled answers it as it is; once erase_after has passed the sweeper may be deleting and the cancel answers 409 erasure_started; with no erasure pending or cancelled, 404 erasure_not_found.

Permission: dev:org.erase

Response200 OK

checkpointsinteger or null
the checkpoint objects and versions deleted, once erased; null when the installation has no store configured and the bucket's 30-day rule removes them
completed_atstring (date-time) or null
when it was erased or cancelled
erase_afterstring (date-time)Required
the end of the 24-hour grace
killedintegerRequired
the live sessions the request stopped
requested_atstring (date-time)Required
rowsinteger or null
the dev rows deleted, once erased
statestringRequired
cancelled: dev.org.erasure.cancel within the grace; the sessions the request killed stay endedOne of erasing, erased, cancelled
subjectsinteger or null
the audit subjects erased, once erased

Errors

  • 403an error
  • 404erasure_not_found: no erasure is pending or cancelled
  • 409erasure_started: the grace is over and the erasure may be under way
curl -X DELETE "$CIRESK_API/v1/dev/erasure" \
  -H "Authorization: Bearer $CIRESK_KEY"