Use the following API methods to request details about templates (field layouts for cases/results).
get_templates
Returns a list of available templates for a project_id.
GET index.php?/api/v2/get_templates/{project_id}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| project_id | integer | true | The ID of the project |
Response content
The response includes an array of templates (field layouts). Each template has a unique ID and a name. The is_default field is true for the default template and false otherwise.
[
{
"id": 1,
"name": "Test Case (Text)",
"i18n_custom_id": "templates_test_case_text",
"is_default": true
},
{
"id": 2,
"name": "Test Case (Steps)",
"i18n_custom_id": "templates_test_case_steps",
"is_default": false
},
{
"id": 3,
"name": "Exploratory Session",
"i18n_custom_id": "templates_exploratory_session",
"is_default": false
},
{
"id": 4,
"name": "Behaviour Driven Development",
"i18n_custom_id": "templates_behaviour_driven_development",
"is_default": false
},
{
"id": 5,
"name": "AI Evaluation",
"i18n_custom_id": "templates_ai_evaluation",
"is_default": false
}
] Response codes
| Status Code | Description |
|---|---|
| 200 | Success (the templates are returned as part of the response) |
| 400 | Invalid or unknown project |
| 403 | No access to the project |
| 429 | TestRail Cloud only—Too many requests (see API rate limit) |