Documentation
API Reference

Create a run

Creates a run from a matrix of entries, each pairing a target with a set of tests and authentication settings. Returns immediately with a `run_id`. Poll `GET /runs/{run_id}` until the run completes.

POST
/runs

Authorization

BearerAuth
AuthorizationBearer <token>

API key issued from Settings > Integrations > CI/CD. Keys have the format dk_live_<40-hex>.

In: header

Request Body

application/json

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.doksi.ai/external/integration/cicd/runs" \  -H "Content-Type: application/json" \  -d '{    "matrix": [      {        "platform": "web",        "web_url": "https://staging.example.com",        "test_ids": [          "abc123"        ]      }    ]  }'
{
  "run_id": "string",
  "results": [
    {
      "result_id": "string",
      "test_id": "string",
      "url": "http://example.com"
    }
  ]
}
{
  "error": "string"
}
{
  "error": "string"
}
{
  "error": "string",
  "requested": 0,
  "remaining": 0
}
{
  "error": "string"
}

Examples

Single web entry

The minimum request. Runs one test against a web URL with no authentication.

curl -X POST "https://api.doksi.ai/external/integration/cicd/runs" \
  -H "Authorization: Bearer $DOKSI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "matrix": [
      {
        "platform": "web",
        "web_url": "https://staging.example.com",
        "test_ids": ["abc123"]
      }
    ]
  }'

Android with a publicly hosted APK

Doksi downloads the APK from binary_url at session start.

curl -X POST "https://api.doksi.ai/external/integration/cicd/runs" \
  -H "Authorization: Bearer $DOKSI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "matrix": [
      {
        "platform": "android",
        "binary_url": "https://builds.example.com/app.apk",
        "test_ids": ["abc123"]
      }
    ]
  }'

Android with an uploaded target

Registers the APK once via POST /targets and then references target_id for every run.

# 1. Create the presigned URL.
MINT=$(curl -sX POST "$BASE/uploads" \
  -H "Authorization: Bearer $DOKSI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"storefront"}')
UPLOAD_ID=$(echo "$MINT" | jq -r '.upload_id')
UPLOAD_URL=$(echo "$MINT" | jq -r '.upload_url')

# 2. Upload the APK.
zip app.zip app/build/outputs/apk/release/app-release.apk
curl -X PUT "$UPLOAD_URL" \
  -H "Content-Type: application/zip" \
  --data-binary @app.zip

# 3. Register the target.
TARGET=$(curl -sX POST "$BASE/targets" \
  -H "Authorization: Bearer $DOKSI_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"upload_id\":\"$UPLOAD_ID\"}")
TARGET_ID=$(echo "$TARGET" | jq -r '.target_id')

# 4. Trigger the run.
curl -sX POST "$BASE/runs" \
  -H "Authorization: Bearer $DOKSI_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"matrix\":[
      {\"platform\":\"android\",\"target_id\":\"$TARGET_ID\",\"test_ids\":[\"abc123\"]}
    ]
  }"

Category expansion

Provide category_ids in place of test_ids to run every non-hidden test in a category.

curl -X POST "https://api.doksi.ai/external/integration/cicd/runs" \
  -H "Authorization: Bearer $DOKSI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "matrix": [
      {
        "platform": "android",
        "target_id": "bin_abc123",
        "category_ids": ["cat_smoke"]
      }
    ]
  }'

Authentication

Each matrix entry controls its own authentication through the artifacts array. Three strategies are supported.

none

Runs the test unauthenticated. This is the default when artifacts is omitted.

{
  "matrix": [
    {
      "platform": "web",
      "web_url": "https://staging.example.com",
      "test_ids": ["abc123"]
    }
  ]
}

generated

Provisions a fresh account for each session. Useful when every test needs its own clean state.

{
  "matrix": [
    {
      "platform": "android",
      "target_id": "bin_abc123",
      "test_ids": ["abc123"],
      "artifacts": [
        { "type": "authentication", "strategy": "generated" }
      ]
    }
  ]
}

specific

Uses an account registered in the dashboard under Platform > Accounts. The account_id is required and must belong to the authenticated company.

{
  "matrix": [
    {
      "platform": "web",
      "web_url": "https://staging.example.com",
      "test_ids": ["abc123"],
      "artifacts": [
        { "type": "authentication", "strategy": "specific", "account_id": "acc_789" }
      ]
    }
  ]
}

Fanning out across platforms

Include the same test in multiple entries to execute it against different platforms or authentication strategies in a single run.

curl -X POST "https://api.doksi.ai/external/integration/cicd/runs" \
  -H "Authorization: Bearer $DOKSI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "matrix": [
      {
        "platform": "web",
        "web_url": "https://staging.example.com",
        "test_ids": ["abc123"],
        "artifacts": [
          { "type": "authentication", "strategy": "specific", "account_id": "acc_789" }
        ]
      },
      {
        "platform": "android",
        "target_id": "bin_abc123",
        "test_ids": ["abc123"],
        "artifacts": [
          { "type": "authentication", "strategy": "generated" }
        ]
      }
    ]
  }'