Docs menu

Start app instance

POST /v1/organisations/{organisation_id}/spaces/{space_id}/apps/{app_id}/instances

Starts the app, or answers the instance of it already running there.

With a conversation_id, it runs in the sandbox session of the conversation, which starts if none runs: the session's job stages the app read-only at /app/{app_id} and runs its processes beside the agent's shell, as the person the session acts for. A session runs at most 3 apps.

Without one, the space runs it for its members in a sandbox of its own, as the space identity, which it bills; one instance per app. It takes one of the organisation's app slots (Free 0, Business 5) and stops after 15 minutes without activity.

write apps are for the space's editors and admins; read apps for any member, and what they change in the space's files is never saved.

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: conversations:write

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

Parameters

  • organisation_id path string required
  • space_id path string required
  • app_id path string required

Request body

application/json StartAppInstance required

  • conversation_id string | null

    The conversation whose sandbox session runs the app; its session starts if none runs. Without one, the space runs the app for its members in a sandbox of its own, as the space identity.

Responses

  • 200 application/json AppInstance

    The app already runs there (the conversation's session, or the space's own sandbox): its instance

  • 201 application/json AppInstance

    The instance, starting until its job has staged the app and started its processes

  • 401 application/json ErrorBody

    unauthenticated

  • 403 application/json ErrorBody

    Viewers can't start a write app; workspace_content_restricted, insufficient_scope

  • 404 application/json ErrorBody

    No such space, conversation or app (or the caller can't see it)

  • 409 application/json ErrorBody

    app_not_approved: one of the space's own apps no person approved yet (or an imported space's app); app_runtime_unavailable: no sandbox environment the installation has on is the app's environment (a session's runs apps of the session environment, of the environments it provides and shell; the space's own any built-in environment); too_many_apps: the session already runs 3; app_start_conflict: concurrent starts kept winning, try again; file_scanning, workspace_archived

  • 422 application/json ErrorBody

    app_not_runnable: the app declares no processes; invalid_app, app_too_large, validation_failed, invalid_body

  • 429 application/json ErrorBody

    sandbox_busy: the organisation's sandbox sessions, or for a space's instance its app slots, are all in use; for app slots details.holders names the instances holding them that the caller can see (instance_id, workspace_id, app_id) and details.other_holders counts the rest

  • 500 application/json ErrorBody

    internal

  • 503 application/json ErrorBody

    sandbox_unavailable: code execution is off or no sandbox worker runs; or 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
  • 403 workspace_content_restrictedinsufficient_scope
  • 404 not_found generic code for this status
  • 409 app_not_approvedapp_runtime_unavailabletoo_many_appsapp_start_conflictfile_scanningworkspace_archived
  • 422 app_not_runnableinvalid_appapp_too_largevalidation_failedinvalid_body
  • 429 sandbox_busyworkspace_idapp_id
  • 500 internal
  • 503 sandbox_unavailableunavailable

Examples

curl
curl -X POST "$IVY_API_URL/v1/organisations/$ORGANISATION_ID/spaces/$SPACE_ID/apps/$APP_ID/instances" \
  -H "Authorization: Bearer $IVY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
JavaScript SDK
import { client, startAppInstance } 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 startAppInstance({
  path: { organisation_id: organisationId, space_id: spaceId, app_id: appId },
  body: {},
});
Example request body
{
  "conversation_id": "conversation_123"
}
Example response (200)
{
  "access": "read",
  "app_id": "app_123",
  "conversation_id": "conversation_123",
  "frontend": "builtin",
  "id": "id_123",
  "last_active_at": "2026-01-15T09:30:00Z",
  "name": {
    "de": "string",
    "el": "string",
    "en": "string",
    "es": "string",
    "fr": "string",
    "hu": "string",
    "it": "string"
  },
  "owner": "session",
  "reason": "string",
  "snapshot_hash": "string",
  "started_at": "2026-01-15T09:30:00Z",
  "state": "starting",
  "status": {
    "dropped": [
      "string"
    ],
    "processes": [
      {
        "busy": "string",
        "error": "string",
        "exit_code": 1,
        "id": "id_123",
        "ports": [],
        "progress": 1,
        "restarts": 0,
        "state": {},
        "text": "Hello, Ivy"
      }
    ],
    "skipped": [
      "string"
    ]
  },
  "stopped_at": "2026-01-15T09:30:00Z"
}