HTTP API

Other

7 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/key

Which workspace an API key is for

People and API keys

For a tool that was given only a key. A person's session gets 403.

Answer · 200

  • keyobjectrequired
    • idstring
    • kind"key" | "device"

      device: a desktop app's access token

    • workspaceobject
Terminal
curl -X GET 'https://annex.eversonder.com/v1/key' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/templates

The workspace's templates, by name

People and API keys

A template is what new sandboxes start as: a size, a route and set-up commands Annex runs in each new sandbox before handing it over. It names no provider's image, so it works on every provider; the commands run again in every sandbox started from it. One template may be the workspace's default.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id

Answer · 200

  • templatesTemplate[]required
    • idstring
    • namestring
    • descriptionstring
    • routestring
    • regionstring
    • vcpuinteger
    • memory_gibinteger
    • setupstring[]
    • secret_groupsstring[]
    • defaultboolean
    • always_runboolean
    • created_atstring
    • updated_atstring
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/templates' \
  -H 'Authorization: Bearer anx_live_…'
POST/v1/workspaces/{wid}/templates

Save a template under its name

People and API keys

A new template (201), or the one of that name replaced whole (200). At most 50 a workspace.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id

Body

  • namestringrequired

    Lower-case letters, digits and dashes, such as node-dev; not "none"

  • descriptionstring
  • routestring

    "cheapest", "fastest" or a provider name; empty leaves it to each start

  • regionstring

    A region code; empty for anywhere

  • vcpuinteger

    0 leaves it to each start

  • memory_gibinteger

    0 leaves it to each start

  • setupstring[]

    Shell commands run in order in a new sandbox; the first that fails stops the rest. After the first run Annex saves the files they changed and puts them back in later sandboxes of the same kind instead of running them again, unless always_run is true

  • secret_groupsstring[]

    Secret groups added to each sandbox's environment

  • defaultboolean

    Every start in the workspace uses it unless the request names another template, or "none"

  • always_runboolean

    Run the set-up commands in every sandbox and never reuse their saved result. For a set-up that starts a program: a saved result holds files, not running programs

Answer · 200

  • templateTemplate
    • idstring
    • namestring
    • descriptionstring
    • routestring
    • regionstring
    • vcpuinteger
    • memory_gibinteger
    • setupstring[]
    • secret_groupsstring[]
    • defaultboolean
    • always_runboolean
    • created_atstring
    • updated_atstring
Terminal
curl -X POST 'https://annex.eversonder.com/v1/workspaces/wsp_…/templates' \
  -H 'Authorization: Bearer anx_live_…' \
  -H 'Content-Type: application/json' \
  -d '{"name":"…"}'
GET/v1/workspaces/{wid}/templates/{name}

One template

People and API keys

Answer · 200

  • templateTemplate
    • idstring
    • namestring
    • descriptionstring
    • routestring
    • regionstring
    • vcpuinteger
    • memory_gibinteger
    • setupstring[]
    • secret_groupsstring[]
    • defaultboolean
    • always_runboolean
    • created_atstring
    • updated_atstring
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/templates/name' \
  -H 'Authorization: Bearer anx_live_…'
DELETE/v1/workspaces/{wid}/templates/{name}

Delete a template

People and API keys

Sandboxes already started from it keep what they have.

Answer · 204

Deleted

Terminal
curl -X DELETE 'https://annex.eversonder.com/v1/workspaces/wsp_…/templates/name' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/credits

The workspace's Annex credit, for sandboxes on Annex's own provider accounts

People and API keys

With Annex credit a sandbox can start on Annex's own account at a provider (its connection is annex:<provider>) when the workspace has no account of its own there, or its own can't take it: its own accounts are always tried first. balance_micros is what came in less what those sandboxes cost at their rates, to now; Annex stops them once it reaches 0, so it can dip a minute's cost below. Members and API keys.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id

Answer · 200

  • creditsCreditsrequired
    • balance_microsinteger

      What is left, in micro-dollars. Annex stops its sandboxes when 2 minutes of what they burn is left, so it stays above 0

    • held_microsinteger

      Held for the sandboxes on Annex's accounts running now: their first 10 minutes each

    • free_microsinteger

      balance_micros less held_micros: a new sandbox on Annex's account needs 10 minutes of its price free to start

    • in_microsinteger

      Every grant

    • spent_microsinteger

      What sandboxes on Annex's own accounts cost

    • currencystring
    • providersstring[]

      Where Annex has an account of its own

    • can_buyboolean

      Top-ups are set up on this server

    • entriesobject[]

      The newest 20

Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/credits' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/rules

One page of the workspace's routing rules, oldest first (members and API keys)

People and API keys

Rules say where the workspace's sandboxes may run and on which providers: allow (only these) or deny (never these), for regions (codes or areas such as eu, apac) or providers. Every rule must hold and deny wins; they bind every start by any route (create, resume, carrying on, plan apply, native resume), Annex credit included. With any region rule an account is always asked for an allowed region by name, and a provider that doesn't say where it runs is left out. GET …/limits shows what they allow together.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
page?InqueryTypeintegerAboutA missing or invalid page is 1
perPage?InqueryTypeintegerAboutHeld between 1 and 100

Answer · 200

  • rulesRule[]required
    • idstring

      rul_…

    • effect"allow" | "deny"

      allow: only these; deny: never these

    • subject"region" | "provider"
    • valuesstring[]

      Region codes or areas (eu, us, apac…), as written; or provider names

    • notestring

      Why, in the owner's words; "" for none

    • summarystring

      The rule in words, such as "Only eu" or "Never boxcompute"

    • created_bystring | null

      The person who added it

    • created_atstring
    • updated_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_…/rules' \
  -H 'Authorization: Bearer anx_live_…'