Skip to main content
public preview

These docs are a public preview. The endpoint reference is still firming up as the API host is finalized.

Quickstart Guide

Spawn your first instance in minutes. Destroy it when the work is done.

quickstartlive
curl -X POST "https://{your-api-host}/orgs/{org_uuid}/api/instances"
-d '{"image": "ubuntu-22.04", "size": "small"}'
{"instance_uuid": "1234-5678-90ab-cdef", "status": "running"}
curl -X DELETE .../api/instances/1234-5678-90ab-cdef
204 No Content
instance destroyed. nothing persists.

Prerequisites

Before you begin, make sure you have:

A Legba account

Sign up at legba.app if you haven't already

An API key

See Authentication for instructions on obtaining an API key

Your organization UUID

Find this in your Legba dashboard under Settings

Step 1: List Available Images

List the browser images available to your organization:

curl -X GET "https://{your-api-host}/orgs/{org_uuid}/api/images" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Example response

{
  "images": [
    "ubuntu-20.04",
    "ubuntu-22.04",
    "windows-10",
    "windows-11"
  ]
}

Step 2: Create a Browser Instance

Create your first isolated browser instance:

curl -X POST "https://{your-api-host}/orgs/{org_uuid}/api/instances" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "ubuntu-20.04",
    "size": "small"
  }'

Example response

{
  "instance_uuid": "1234-5678-90ab-cdef",
  "status": "running",
  "image": "ubuntu-20.04",
  "size": "small",
  "created_at": "2025-01-10T12:00:00Z",
  "access_url": "https://instance-1234-5678.legba.app"
}

Tip: Save the instance_uuid. You need it to manage this instance later.

Step 3: List Your Instances

List every running instance in your organization:

curl -X GET "https://{your-api-host}/orgs/{org_uuid}/api/instances" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Step 4: Destroy an Instance

Destroy the instance when the work is done:

curl -X DELETE "https://{your-api-host}/orgs/{org_uuid}/api/instances/{instance_uuid}" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

A successful deletion returns a 204 No Content status code.

Next Steps

That is the full loop. Spawn, work, destroy. Explore next: