Skip to main content
This guide is the fastest way to validate Revyl API access from a script or CI job.
This API quickstart is for orchestration (run tests/workflows, poll status, cancel runs). For interactive cloud-device control, use Device Automation with CLI or Python SDK.

Prerequisites

  1. Create an API key in Settings -> API Keys
  2. Export it locally:
export REVYL_API_KEY="rev_..."
  1. Have at least one test_id and workflow_id

1. Execute a Test

curl -sS -X POST "https://backend.revyl.ai/api/v1/execution/api/execute_test_id_async" \
  -H "Authorization: Bearer $REVYL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "test_id": "YOUR_TEST_ID",
    "retries": 1
  }'
Expected response (example):
{
  "status": "queued",
  "message": "Execution started",
  "id": "task-123",
  "task_id": "task-123"
}

2. Poll Test Status

curl -sS "https://backend.revyl.ai/api/v1/tests/get_test_execution_task?task_id=task-123" \
  -H "Authorization: Bearer $REVYL_API_KEY"
Poll until status is terminal (completed, failed, cancelled, timeout).

3. Execute a Workflow

curl -sS -X POST "https://backend.revyl.ai/api/v1/execution/api/execute_workflow_id_async" \
  -H "Authorization: Bearer $REVYL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workflow_id": "YOUR_WORKFLOW_ID",
    "override_build_config": false
  }'

4. Poll Workflow Status

curl -sS "https://backend.revyl.ai/api/v1/workflows/status/status/task-456" \
  -H "Authorization: Bearer $REVYL_API_KEY"

Optional: Cancel a Running Test

curl -sS -X POST "https://backend.revyl.ai/api/v1/execution/tests/status/cancel/task-123" \
  -H "Authorization: Bearer $REVYL_API_KEY"

Python Example

import os
import time
import requests

BASE_URL = "https://backend.revyl.ai"
API_KEY = os.environ["REVYL_API_KEY"]
HEADERS = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json",
}

start = requests.post(
    f"{BASE_URL}/api/v1/execution/api/execute_test_id_async",
    headers=HEADERS,
    json={"test_id": "YOUR_TEST_ID", "retries": 1},
    timeout=30,
)
start.raise_for_status()
task_id = start.json()["task_id"]

while True:
    status_resp = requests.get(
        f"{BASE_URL}/api/v1/tests/get_test_execution_task",
        headers=HEADERS,
        params={"task_id": task_id},
        timeout=30,
    )
    status_resp.raise_for_status()
    payload = status_resp.json()
    status = payload.get("status")
    print(f"status={status}")
    if status in {"completed", "failed", "cancelled", "timeout"}:
        break
    time.sleep(5)

Next