Skip to content
FiveCord Docs

Archives

An archive is a snapshot of one user account or one guild, built in the background and downloaded as a file. Create user archive and Create guild archive request one. The operations here read archive state and issue time-limited download URLs.

While FiveCord builds an archive, it leaves out any stored file that is missing from storage. Any other read or write failure fails that build attempt and sets failed_at.

Every operation needs an ACL covering the subject type it touches.

  • A user archive needs archive:view_all or archive:trigger:user.
  • A guild archive needs archive:view_all or archive:trigger:guild.
  • Reading both types at once needs archive:view_all, or archive:trigger:user and archive:trigger:guild together.

An archive is in one of these lifecycle states. It is building while completed_at and failed_at are both null, complete once completed_at is set, and failed once failed_at is set. When FiveCord starts a new attempt at a failed archive, it clears failed_at and error_message, so the archive reads as building again while that attempt runs.

FieldTypeDescription
archive_idsnowflakeThe ID of the archive, used with its subject to address the record
subject_typestringThe archive subject type the record is stored under
subject_idsnowflakeThe user or guild the archive was taken of
requested_bysnowflakeThe Admin account that requested the archive
requested_atISO8601 timestampThe time the archive record was created
started_at?ISO8601 timestampThe time construction began, or null while the task has not started
completed_at?ISO8601 timestampThe time construction completed, or null when it has not completed
failed_at?ISO8601 timestampThe time construction failed, or null when it has not failed
file_size1?stringThe size of the stored archive object in bytes, or null before completion
progress_percent2numberThe construction progress from 0 to 100
progress_step2?stringThe step the construction task last reported
error_message?stringThe failure text the construction task reported, or null when it has not failed
download_url_expires_at3?ISO8601 timestampThe cache expiry stamped on the stored archive object at completion, or null before completion
expires_at4?ISO8601 timestampThe time the archive stops being readable

1 The size is a decimal string

2 A new archive starts at 0 with the step Queued, and completion sets 100 and Completed. Failure leaves progress_percent where it was and sets the step to Failed

3 Written at completion using the archive’s fixed expires_at. Create archive download returns a URL with its own expiry

4 The value is 365 days after requested_at

{
"archive_id": "1501314428688998182",
"subject_type": "user",
"subject_id": "1478812292088791040",
"requested_by": "1478812292088791041",
"requested_at": "2026-08-14T11:02:03.000Z",
"completed_at": "2026-08-14T11:06:41.000Z",
"file_size": "48211904",
"progress_percent": 100,
"progress_step": "Completed",
"expires_at": "2027-08-14T11:02:03.000Z"
}
ValueDescription
userThe archive captures one user account
guildThe archive captures one guild

List archives also accepts all as a filter value, and it is the default there. No path segment accepts it.

This object uses camelCase field names, unlike every other Admin response body.

FieldTypeDescription
downloadUrl1stringThe time-limited URL the archive file is fetched from
expiresAt2ISO8601 timestampThe time this URL stops working

1 The URL is a presigned object storage link with no Admin credential, so possession of it grants access until it expires

2 The value is seven days after the grant was issued, regardless of the archive’s own expires_at

{
"downloadUrl": "https://storage.example.com/harvests/1501314428688998182.zip?signature=abc123",
"expiresAt": "2026-09-07T11:06:41.000Z"
}
GET/v1/admin/archivesAudit reason

Returns archive objects matching the supplied filters, newest first. Requires an ACL covering the requested subject_type.

FieldTypeDescription
subject_type?1stringuser, guild, or all (default all)
subject_id?2snowflakeThe exact subject whose archives are returned
requested_by?3snowflakeThe Admin account that requested the returned archives
limit?4integerThe maximum number of archives to return (1-200, default 50)
include_expired?5booleanWhether to include archives past their expires_at (default false)

1 all returns the newest limit archives across both subject types, so a busy subject type can crowd out the other

2 subject_type also has to name user or guild

3 Ignored when subject_id is supplied. When requested_by applies, FiveCord ignores subject_type and returns that account’s archives of both subject types

4 The listing is not paginated and returns no cursor. Only a narrower filter reaches older records

5 The value counts as true only for true, True, or 1. Excluding expired archives can leave fewer than limit results

FieldTypeDescription
archivesarray[archive object]The archives matching the filters, newest first
StatusBodyCondition
200response bodyThe archives were returned
400error responsesubject_id is supplied while subject_type is all. INVALID_FORM_BODY has INVALID_FORMAT on subject_type
403error responseMISSING_ACL without an ACL covering the requested subject type

The operation records one Admin audit entry with action list_archives, target type archive, target ID 0, and metadata keys subject_type, limit, include_expired, and result_count. subject_type is the value after FiveCord narrows all to the account’s ACLs. The entry also has subject_user_id or subject_guild_id when subject_id is supplied, and requested_by_user_id when requested_by is supplied.

200 requests per minute for each authenticated user, on the admin:lookup bucket.

GET/v1/admin/archives/{subject_type}/{subject_id}/{archive_id}Audit reason

Returns one archive object. Requires an ACL covering the subject type.

FieldTypeDescription
subject_typestringThe archive subject type, either user or guild
subject_idsnowflakeThe user or guild the archive was taken of
archive_idsnowflakeThe ID of the archive
FieldTypeDescription
archive1?archive objectThe archive, or null when the subject and identifier resolve to nothing

1 A missing archive answers 200 with a null archive, which is also the answer when the identifier belongs to a different subject and when the archive has passed expires_at

StatusBodyCondition
200response bodyA lookup was done, whether or not it resolved
403error responseMISSING_ACL without an ACL covering the subject type

The read issues no download grant.

The operation records one Admin audit entry with action get_archive, target type equal to subject_type, target ID equal to subject_id, and metadata keys archive_id and found. found is false when the response has a null archive.

200 requests per minute for each authenticated user, on the admin:lookup bucket.

GET/v1/admin/archives/{subject_type}/{subject_id}/{archive_id}/downloadAudit reason

Issues a temporary download URL for a completed archive. Returns an archive download object on success. Requires an ACL covering the subject type.

FieldTypeDescription
subject_typestringThe archive subject type, either user or guild
subject_idsnowflakeThe user or guild the archive was taken of
archive_idsnowflakeThe ID of a completed archive
StatusBodyCondition
200archive download objectThe grant was issued
4001error responseThe archive is not downloadable, returned as HARVEST_NOT_READY, HARVEST_FAILED, or HARVEST_EXPIRED
403error responseMISSING_ACL without an ACL covering the subject type
4042error responseThe subject and identifier resolve to nothing, returned as UNKNOWN_HARVEST

1 HARVEST_FAILED while failed_at is set, HARVEST_NOT_READY while the archive has no completion time or no stored object, and HARVEST_EXPIRED once expires_at has passed, tested in that order

2 The archive record stops being readable at expires_at, so an archive past its expiry answers UNKNOWN_HARVEST, not HARVEST_EXPIRED

The operation creates a presigned download URL valid for seven days and changes no field of the archive, including download_url_expires_at.

The operation records one Admin audit entry with action get_archive_download_url, target type equal to subject_type, target ID equal to subject_id, and metadata key archive_id. The entry has no URL. A request that returns 400 or 404 records no entry.

200 requests per minute for each authenticated user, on the admin:lookup bucket.