The projects/{project_id}/automation-links namespace provides API methods for linking automation cases to repository test cases. Creating a link is how an automated test in an automation run becomes connected to a manual test case in your repository, so that automation coverage and the latest automation status appear on the case.
- POST
projects/{project_id}/automation-links— link a single automation case to a repository case - POST
projects/{project_id}/automation-links/bulk— link many pairs in one request
These endpoints power the Testmo automation linking tool (@testmo/testmo-link), which resolves your linking rules and then calls the bulk endpoint to create the links. You can also call the endpoints directly to build your own linking workflow.
An automation case and a repository case have a many-to-many relationship: a single automation case can be linked to more than one repository case, and a repository case can have more than one automation case linked to it. Creating the same link twice is a safe no-op (the request is idempotent).
POST /projects/{project_id}/automation-links
Links a single automation case to a single repository case. If the link already exists, the request succeeds without creating a duplicate.
When a link is created, Testmo marks the repository case as having automation (the repository Automation column) and backfills the case's latest automation status (the Status (latest) column) from the most recent result of the linked automation case.
project_id id required
ID of the project.
Request
case_id integer required
ID of the repository test case to link to.
automation_case_id integer required
ID of the automation case to link. Automation cases are created automatically when you submit automation results; their IDs are returned by GET /automation/runs/{run_id}/tests as automation_case_id.
"case_id": {
"type": "integer",
"format": "int64",
"description": "ID of the repository test case to link to."
},
"automation_case_id": {
"type": "integer",
"format": "int64",
"description": "ID of the automation case to link."
}
Request example
POST /api/v1/projects/1/automation-links
{
"case_id": 42,
"automation_case_id": 101
}Response
204 No ContentStatus codes
204 400 401 403 404 415 422 429 (details)
POST /projects/{project_id}/automation-links/bulk
Links many automation case / repository case pairs in a single request — up to 500 pairs. This is the recommended way to create links at scale, as it avoids sending one request per case. The request is idempotent: pairs that are already linked are ignored, and the same pair listed more than once is only linked once.
As with the single endpoint, each newly linked repository case is marked as having automation and has its latest automation status backfilled.
Validation is all-or-nothing: if any case_id or automation_case_id in the request is invalid (does not exist in the project, or is not a positive integer), the whole request is rejected and no links are created.
project_id id required
ID of the project.
Request
links array required
List of automation case to repository case pairs to link. Minimum 1, maximum 500 pairs per request. Each item is an object with the fields below.
links[].case_id integer required
ID of the repository test case to link to.
links[].automation_case_id integer required
ID of the automation case to link.
"links": {
"type": "array",
"minItems": 1,
"maxItems": 500,
"description": "List of automation case to repository case pairs to link.",
"items": {
"type": "object",
"required": ["case_id", "automation_case_id"],
"properties": {
"case_id": {
"type": "integer",
"format": "int64",
"description": "ID of the repository test case to link to."
},
"automation_case_id": {
"type": "integer",
"format": "int64",
"description": "ID of the automation case to link."
}
}
}
}
Request example
POST /api/v1/projects/1/automation-links/bulk
{
"links": [
{ "case_id": 42, "automation_case_id": 101 },
{ "case_id": 43, "automation_case_id": 102 },
{ "case_id": 100, "automation_case_id": 103 }
]
}Response
204 No ContentStatus codes
204 400 401 403 404 415 422 429 (details)