Skip to content
StatefoldDocsChangelogOpen app

Threads API

Get the saved result

Read the manifest of the thread's latest saved result.

GET/api/v1/tasks/{taskId}/result

A saved result is the workspace as it was last saved: the repository and a patch from the commit the thread started on. The manifest says when it was saved and where to download it. It is not a live view of the workspace; unsaved changes are not in it.

Requires a personal API token with the tasks:read scope, sent as Authorization: Bearer over HTTPS.

Path parameters

taskIdstring (UUID)required

The thread. A thread that is not yours answers 404, never 403.

Returns

200 OK with the result manifest.

Response fields

version1required

Payload version.

taskobjectrequired

taskId, title and status when the result was read.

sourceobjectrequired

Where the thread started: kind (artifacts, github or task), repository, ref, commit and branch.

resultobjectrequired

The saved result itself.

result.backupIdstring (UUID)required

Identifies this saved result.

result.savedAtstring (ISO 8601)required

When it was saved.

result.baseCommitstringrequired

The commit the thread started from.

result.headCommitstringrequired

The saved commit.

result.branchstringrequired

A branch name for the result, statefold/result- and 8 hex digits.

result.archiveBytesintegerrequired

Archive size in bytes, up to 4 GiB.

result.archivePathstringrequired

Path of the archive on the same origin. Download it with the same token.

result.repositoryPath"repo"required

Directory in the archive that holds the repository.

result.patchPath"changes.patch"required

File in the archive with the changes from baseCommit.

Errors

Errors are JSON: { "version": 1, "error": { "code", "message" } }. See Errors for retry advice.

400invalid_request

The thread id is not a UUID.

401unauthorized

The bearer token is missing, invalid or revoked.

403forbidden

The token does not have the tasks:read scope, or the account is suspended.

404not_found

The thread is not yours, or it has no saved result yet.

503unavailable

The result could not be read or is larger than the archive limit.