Move tests and functional areas between Lastest instances -- e.g. from a staging deployment to production, or between self-hosted servers.
The easiest way to migrate tests:
https://staging.example.com)Migration is idempotent -- re-running updates existing tests by name match rather than creating duplicates.
GET /api/v1/repos/:id/exportReturns all tests and functional areas for a repository in the format accepted by the import endpoint. Includes all fields: code, description, overrides, execution mode, capabilities, quarantine status.
curl -H "Authorization: Bearer $API_KEY" \
"$LASTEST_URL/api/v1/repos/$REPO_ID/export"
Response:
{
"functionalAreas": [
{
"name": "Login Flow",
"description": "User authentication flows",
"parentName": null,
"orderIndex": 0,
"isRouteFolder": false,
"agentPlan": null
}
],
"tests": [
{
"name": "Login happy path",
"code": "export async function test(page, ...) { ... }",
"description": "Tests successful login with valid credentials",
"targetUrl": "https://example.com/login",
"functionalAreaName": "Login Flow",
"executionMode": "procedural",
"agentPrompt": null,
"assertions": null,
"setupOverrides": null,
"teardownOverrides": null,
"stabilizationOverrides": null,
"viewportOverride": null,
"diffOverrides": null,
"playwrightOverrides": null,
"requiredCapabilities": null,
"quarantined": false,
"isPlaceholder": false
}
]
}
POST /api/v1/repos/:id/importUpserts functional areas and tests by name matching (case-insensitive). Handles parent-child area relationships automatically.
curl -X POST -H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d @export.json \
"$LASTEST_URL/api/v1/repos/$REPO_ID/import"
Response:
{
"success": true,
"areasCreated": 3,
"areasUpdated": 1,
"testsCreated": 12,
"testsUpdated": 2,
"errors": []
}
curl -H "Authorization: Bearer $SOURCE_KEY" \
"$SOURCE_URL/api/v1/repos/$SOURCE_REPO_ID/export" \
| curl -X POST -H "Authorization: Bearer $TARGET_KEY" \
-H "Content-Type: application/json" \
-d @- "$TARGET_URL/api/v1/repos/$TARGET_REPO_ID/import"
errors array.