HTTP API

Files

6 routes your API key can call. Each says who may call it; every example assumes KEY is your API key. What only the dashboard does (signing in, making API keys, connecting accounts) isn't listed here: it's in the full OpenAPI spec.

GET/v1/workspaces/{wid}/sandboxes/{id}/files

One page of what is in a directory of a running sandbox, by name

People and API keys

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
idInpathTypestringAbout
pathInqueryTypestringAboutAbsolute (422 otherwise)
page?InqueryTypeintegerAboutA missing or invalid page is 1
perPage?InqueryTypeintegerAboutHeld between 1 and 100

Answer · 200

  • filesobject[]required
    • namestring
    • pathstring
    • type"file" | "dir"
    • sizeinteger

      Bytes

    • modified_atstring
  • metaMetarequired
    • pageinteger
    • totalinteger

      Items matching, across all pages

    • pageCountinteger

      ceil(total / perPage)

    • perPageinteger
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/sandboxes/id/files' \
  -H 'Authorization: Bearer anx_live_…'
DELETE/v1/workspaces/{wid}/sandboxes/{id}/files

Delete a file or directory (send Content-Type application/json, as for every non-GET request)

People and API keys

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
idInpathTypestringAbout
pathInqueryTypestringAboutAbsolute (422 otherwise)
recursive?InqueryType"true"AboutNeeded to delete a directory with things in it

Answer · 204

Deleted

Terminal
curl -X DELETE 'https://annex.eversonder.com/v1/workspaces/wsp_…/sandboxes/id/files' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/sandboxes/{id}/files/content

Download a file, as raw bytes (or preview it, scrubbed)

People and API keys

Content-Type follows the file's extension (application/octet-stream if unknown). It always comes as an attachment, with nosniff and a Content-Security-Policy that runs nothing, as the file is untrusted. A download is the file exactly as it is, secret values included: the files are the user's own. With preview=true it is instead text/plain of a file of 256 KiB at most (413 over that), with the sandbox's secret values masked as ••••NAME, for showing on screen.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
idInpathTypestringAbout
pathInqueryTypestringAboutAbsolute (422 otherwise)
preview?InqueryTypebooleanAbouttrue: scrubbed text for showing on screen

Answer · 200

The file

Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/sandboxes/id/files/content' \
  -H 'Authorization: Bearer anx_live_…'
PUT/v1/workspaces/{wid}/sandboxes/{id}/files/content

Upload a file, as raw bytes (100 MiB at most), replacing what is there

People and API keys

The only write that isn't JSON: send the bytes as the body, with any Content-Type. With an API key nothing more is needed. With a session cookie, send X-Annex-Upload: 1 or it is 403.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
idInpathTypestringAbout
pathInqueryTypestringAboutAbsolute (422 otherwise)
X-Annex-Upload?InheaderType"1"AboutRequired with a session cookie

Answer · 204

Written

Terminal
curl -X PUT 'https://annex.eversonder.com/v1/workspaces/wsp_…/sandboxes/id/files/content' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/checkpoints/{ckp}/files

One page of what is in a folder of a stored checkpoint, by name, read from Annex's own copy

People and API keys

No sandbox starts and no provider is asked, so it works after the sandbox is stopped and costs nothing. Paths are absolute, as they were in the sandbox the checkpoint came from. 409 while the checkpoint is being made or when it failed; 422 for a path that is a file.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
ckpInpathTypestringAboutCheckpoint id
path?InqueryTypestringAboutAbsolute folder; left out: the checkpoint's root
page?InqueryTypeintegerAboutA missing or invalid page is 1
perPage?InqueryTypeintegerAboutHeld between 1 and 100

Answer · 200

  • filesCheckpointFile[]required
    • namestring
    • pathstring

      Absolute

    • type"file" | "dir" | "symlink"
    • sizeinteger

      Bytes

    • modeinteger

      Permission bits, such as 420 (0644)

    • modified_atstring
    • targetstring | null

      A symlink's target

  • metaMetarequired
    • pageinteger
    • totalinteger

      Items matching, across all pages

    • pageCountinteger

      ceil(total / perPage)

    • perPageinteger
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/checkpoints/ckp/files' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/checkpoints/{ckp}/files/content

Download one file of a stored checkpoint, as it was saved, read from Annex's own copy

People and API keys

Streamed out of Annex's store a piece at a time, each piece checked against the hash it was saved with; no sandbox starts. Sent as an attachment that browsers won't run, like a sandbox's files. Content-Length is the size it was saved with, so a download cut short by a storage error reads as cut short. 422 for a folder or a link.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
ckpInpathTypestringAboutCheckpoint id
pathInqueryTypestringAboutAbsolute (422 otherwise)

Answer · 200

The file's bytes

Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/checkpoints/ckp/files/content' \
  -H 'Authorization: Bearer anx_live_…'