Configurations

Use the following API methods to request details about test plan configurations and to create or modify configurations used to generate test plans.

get_configs

Returns a list of available configurations, grouped by configuration groups.

GET index.php?/api/v2/get_configs/{project_id}

Parameters

Name Type Required Description
project_id integer true The ID of the project

Response content

The response includes an array of configuration groups, each with a list of configurations. Please see below for a typical example:

[
    {
        "id": 1,
        "name": "Browsers",
        "project_id": 1,
        "configs": [
            {
                "id": 3,
                "name": "Chrome",
                "group_id": 1
            },
            {
                "id": 4,
                "name": "Firefox ",
                "group_id": 1
            },
            {
                "id": 1,
                "name": "IE 10",
                "group_id": 1
            },
            {
                "id": 2,
                "name": "IE 11",
                "group_id": 1
            },
            {
                "id": 5,
                "name": "Safari",
                "group_id": 1
            }
        ]
    }
]

The example response shows different browser configuration groups:

ID Configuration
1 Internet Explorer 10
2 Internet Explorer 11
3 Chrome
4 Firefox
5 Safari

Please also see add_plan_entry and add_plan for an example on how to use configurations.

Response codes

Status Code Description
200 Success (the configurations 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)

add_config_group

 

This endpoint requires TestRail 5.2 or later.

Creates a new configuration group.

POST index.php?/api/v2/add_config_group/{project_id}

Parameters

Name Type Required Description
project_id integer true The ID of the project the configuration group should be added to

Request body

Name Type Required Description
name string true The name of the configuration group

Request example

Also, see the following example which shows how to create a new configuration group:

{
    "name": "Browsers"
}

Response codes

Status Code Description
200 Success (the configuration group was created and is returned as part of the response)
400 Invalid or unknown project
403 No permissions to add configuration groups or no access to the project
429

TestRail Cloud only—Too many requests (see API rate limit)

add_config

 

This endpoint requires TestRail 5.2 or later.

Creates a new configuration.

POST index.php?/api/v2/add_config/{config_group_id}

Parameters

Name Type Required Description
config_group_id integer true The ID of the configuration group the configuration should be added to

Request body

Name Type Required Description
name string true The name of the configuration

Request example

Also, see the following example which shows how to create a new configuration:

{
"name": "Chrome" }

Response codes

Status Code Description
200 Success (the configuration group was created and is returned as part of the response)
400 Invalid or unknown project
403 No permissions to add configuration or no access to the project
429

TestRail Cloud only—Too many requests (see API rate limit)

update_config_group

 

This endpoint requires TestRail 5.2 or later.

Updates an existing configuration group.

POST index.php?/api/v2/update_config_group/{config_group_id}

Parameters

Name Type Required Description
config_group_id integer true The ID of the configuration group

Request body

Name Type Required Description
name string false The name of the configuration group

Request example

Also, see the following example which shows how to update a configuration group:

{
    "name": "Operating Systems"
}

Response codes

Status Code Description
200 Success (the configuration group was updated and is returned as part of the response)
400 Invalid or unknown configuration group
403 No permissions to modify configuration groups or no access to the project
429

TestRail Cloud only—Too many requests (see API rate limit)

update_config

 

This endpoint requires TestRail 5.2 or later.

Updates an existing configuration.

POST index.php?/api/v2/update_config/{config_id}

Parameters

Name Type Required Description
config_id integer true The ID of the configuration

Request body

Name Type Required Description
name string false The name of the configuration

Request example

Also, see the following example which shows how to update a configuration:

{
    "name": "Firefox"
}

Response codes

Status Code Description
200 Success (the configuration was updated and is returned as part of the response)
400 Invalid or unknown configuration
403 No permissions to modify configurations or no access to the project
429

TestRail Cloud only—Too many requests (see API rate limit)

delete_config_group

 

This endpoint requires TestRail 5.2 or later.

 

Deleting a configuration group cannot be undone and also permanently deletes all configurations in this group. It does not, however, affect closed test plans/runs, or active test plans/runs unless they are updated.

Deletes an existing configuration group and its configurations.

POST index.php?/api/v2/delete_config_group/{config_group_id}

Parameters

Name Type Required Description
config_group_id integer true The ID of the configuration group

Response codes

Status Code Description
200 Success (the configuration group and all its configurations were deleted)
400 Invalid or unknown configuration group
403 No permissions to delete configuration groups or no access to the project
429

TestRail Cloud only—Too many requests (see API rate limit)

delete_config

 

This endpoint requires TestRail 5.2 or later.

 

 

Deleting a configuration group cannot be undone and also permanently deletes all configurations in this group. It does not, however, affect closed test plans/runs, or active test plans/runs unless they are updated.

Deletes an existing configuration.

POST index.php?/api/v2/delete_config/{config_id}

Parameters

Name Type Required Description
config_id integer true The ID of the configuration

Response codes

Status Code Description
200 Success (the configuration was deleted)
400 Invalid or unknown configuration
403 No permissions to delete configurations or no access to the project
429

TestRail Cloud only—Too many requests (see API rate limit)

Was this article helpful?
0 out of 1 found this helpful