Huarp API Documentation

Browser RPA Execution Platform

Overview

Huarp is a Browser RPA (Robotic Process Automation) platform that allows you to automate browser interactions through a simple REST API.

You can build automations visually using the drag-and-drop interface, or execute them directly via API from tools like n8n.

Authentication

🔐 Supabase Authentication
All API endpoints require authentication using Supabase JWT tokens.

Authentication Method: Bearer Token (JWT)

Include your Supabase access token in the Authorization header:

Authorization: Bearer {your_jwt_token}

How to get your token:

  1. Sign in through the Huarp frontend
  2. The frontend automatically manages your session
  3. API calls from the frontend include the token automatically

For external API calls:

Use the Supabase client to obtain a session token:

// JavaScript/Node.js example
import { createClient } from '@supabase/supabase-js';

const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY);
const { data, error } = await supabase.auth.signInWithPassword({
  email: 'user@example.com',
  password: 'password'
});

const token = data.session.access_token;
// Use this token in Authorization: Bearer {token}

API Endpoints

POST/api/rpa/run

Execute browser automation from raw steps or a saved workflow.

Request Body (Option A - Raw Steps)

{
  "steps": [
    { "action": "goto", "url": "https://example.com" },
    { "action": "type", "selector": "#email", "text": "user@example.com" },
    { "action": "click", "selector": "button[type=submit]" },
    { "action": "wait_for", "selector": ".dashboard" },
    { "action": "extract_text", "selector": ".balance", "var": "balance" }
  ],
  "return_vars": ["balance"],
  "timeout_seconds": 60
}

Request Body (Option B - Saved Workflow)

{
  "workflow_id": "uuid-of-saved-workflow",
  "timeout_seconds": 60
}

Response (Success)

{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "success",
  "data": {
    "balance": "$1,234.56"
  },
  "error": null
}

Response (Error)

{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "error",
  "data": {},
  "error": "Element not found: .balance"
}

POST/api/workflows

Save a new workflow.

{
  "name": "Login and Extract Balance",
  "description": "Logs into banking portal and extracts account balance",
  "steps": [...]
}

GET/api/workflows

List all saved workflows.

GET/api/workflows/:id

Get a specific workflow by ID.

PUT/api/workflows/:id

Update an existing workflow.

DELETE/api/workflows/:id

Delete a workflow.

Supported Actions

Action Description Required Parameters
goto Navigate to a URL url
click Click an element selector
type Type text into an input field selector, text
wait_for Wait for an element to appear selector
extract_text Extract text content from an element selector, var
extract_attribute Extract an attribute value from an element selector, attribute, var
screenshot Capture a screenshot (base64) None
get_html Get the full page HTML None

Security

Huarp implements the following security restrictions:

Using with n8n

To call Huarp from n8n:

  1. Add an HTTP Request node
  2. Set method to POST
  3. Set URL to
  4. Add authentication:
    • Authentication: Generic Credential Type
    • Credential Type: Header Auth
    • Name: Authorization
    • Value: Bearer {your_token}
  5. Set body to JSON with your steps or workflow_id
{
  "steps": [
    { "action": "goto", "url": "https://example.com" },
    { "action": "extract_text", "selector": "h1", "var": "title" }
  ],
  "return_vars": ["title"]
}

Note: You'll need to obtain a Supabase JWT token first by signing in through the Huarp frontend or using the Supabase API directly.

Rate Limits

Concurrent browser executions are limited (default: 2-3 simultaneous jobs).

Jobs exceeding the timeout will be terminated and marked as timeout.