Docs menu

Get code execution

GET /v1/organisations/{organisation_id}/code-execution

Code execution on this installation for the organisation: unavailable without gVisor, never unsandboxed.

Authentication

Send an API key, or an access token from your organisation’s identity provider, in the Authorization header. How API keys work

Scope the API key needs: code_runs:read

Security schemes in the OpenAPI document: session_cookie (cookie __Host-ivy_session)bearer (bearer)api_key (bearer)

Parameters

  • organisation_id path string required

Responses

  • 200 application/json CodeExecutionInfo

    Availability and limits

  • 401 application/json ErrorBody

    unauthenticated

  • 404 application/json ErrorBody

    No such organisation (or not yours)

  • 429 application/json ErrorBody

    rate_limited: the API key's requests per minute are used up; retry after Retry-After seconds

  • 503 application/json ErrorBody

    unavailable: the database is briefly unavailable; retry after Retry-After seconds

Error codes

Errors come back as an ErrorBody whose code is one of these.

  • 401 unauthenticated
  • 404 not_found generic code for this status
  • 429 rate_limited
  • 503 unavailable

Examples

curl
curl "$IVY_API_URL/v1/organisations/$ORGANISATION_ID/code-execution" \
  -H "Authorization: Bearer $IVY_API_KEY"
JavaScript SDK
import { client, getCodeExecution } from "@spacivapp/ivy-sdk";

client.setConfig({
  baseUrl: process.env.IVY_API_URL,
  headers: { Authorization: `Bearer ${process.env.IVY_API_KEY}` },
});

const { data, error, response } = await getCodeExecution({
  path: { organisation_id: organisationId },
});
Example response (200)
{
  "available": false,
  "builds": false,
  "default_timeout_seconds": 0,
  "max_concurrent_runs": 0,
  "max_concurrent_sessions": 0,
  "max_timeout_seconds": 0,
  "reason": "string",
  "reason_code": "not_gvisor",
  "sizes": [
    {
      "memory_mib": 0,
      "name": "Ada Lovelace",
      "space_mib": 0,
      "vcpu": 0,
      "workspace_mib": 0
    }
  ],
  "status": "available",
  "tiers": [
    "string"
  ]
}