Quickstart Guide
Get up and running with the Legba API in just a few minutes.
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
First, let's see what browser images are available for your organization:
curl -X GET "https://api.example.com/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
Now, let's create your first isolated browser instance:
curl -X POST "https://api.example.com/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"
}Pro Tip: Save the
instance_uuid - you'll need it to manage this instance later.Step 3: List Your Instances
Check all running instances for your organization:
curl -X GET "https://api.example.com/orgs/{org_uuid}/api/instances" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"Step 4: Destroy an Instance
When you're done, clean up by destroying the instance:
curl -X DELETE "https://api.example.com/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
Congratulations! You've successfully completed the quickstart. Here's what to explore next: