{"article":{"id":7077292642580,"url":"https://gurock.zendesk.com/api/v2/help_center/en-us/articles/7077292642580.json","html_url":"https://support.testrail.com/hc/en-us/articles/7077292642580-Cases","author_id":415527390832,"comments_disabled":true,"draft":false,"promoted":false,"position":2,"vote_sum":1,"vote_count":23,"upvote_count":12,"downvote_count":11,"section_id":7077185274644,"created_at":"2022-06-16T10:51:45Z","updated_at":"2026-10-07T08:47:21Z","name":"Cases","title":"Cases","source_locale":"en-us","locale":"en-us","outdated":false,"outdated_locales":[],"edited_at":"2026-10-07T08:47:21Z","user_segment_id":null,"permission_group_id":6972358691476,"content_tag_ids":[],"label_names":[],"body":"<p>Use the following <abbr title=\"Application Programming Interface\">API</abbr> methods to retrieve data about test cases—like title, case fields, and history—and to create, modify, or delete test cases.</p><h2 id=\"getcase\">get_case</h2><p>Returns an existing test case.</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">GET index.php?/api/v2/get_case/{case_id}</code></pre><h3 id=\"01G68JZ4AKYR83WPCAFVVN0TKJ\">Parameters</h3><figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"width: 100%;\"><table class=\"table--hover\" style=\"border-collapse: collapse;\">\n<thead><tr>\n<th style=\"width: 19.4286%;\">Name</th>\n<th style=\"width: 15%;\">Type</th>\n<th style=\"width: 16.2858%;\">Required</th>\n<th style=\"width: 49.1428%;\">Description</th>\n</tr></thead>\n<tbody><tr>\n<td style=\"width: 19.4286%;\">case_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">true</td>\n<td style=\"width: 49.1428%;\">The ID of the test case</td>\n</tr></tbody>\n</table></figure><p>Example request:</p><pre class=\"wysiwyg-code-block\"><code class=\"language-xml\"># Get the test case with an ID of 42\nGET index.php?/api/v2/get_case/42</code></pre><h3 id=\"h_01JZ36HDH21QJH4PTWC6PAS0Y8\">Response content</h3><p>Example response:</p><pre class=\"wysiwyg-code-block\"><code class=\"language-xml\">{\n    \"id\": 1,\n    \"title\": \"Print document history and attributes\",\n    \"section_id\": 1,\n    \"template_id\": 1,\n    \"type_id\": 2,\n    \"priority_id\": 2,\n    \"milestone_id\": null,\n    \"refs\": null,\n    \"created_by\": 1,\n    \"created_on\": 1646317844,\n    \"updated_by\": 1,\n    \"updated_on\": 1646317844,\n    \"estimate\": null,\n    \"estimate_forecast\": \"8m 40s\",\n    \"suite_id\": 1,\n    \"display_order\": 1,\n    \"is_deleted\": 0,\n    \"custom_automation_type\": 0,\n    \"custom_preconds\": null,\n    \"custom_steps\": null,\n    \"custom_expected\": null,\n    \"custom_steps_separated\": null,\n    \"custom_mission\": null,\n    \"custom_goals\": null,\n    \"labels\": [\n     {\n      \"id\": 1,\n      \"title\": \"label1\",\n      \"created_by:\"2\",\n      \"created_on: \"timestamp\",\n      },\n     {\n      \"id\": 2,\n      \"title\": \"label2\",\n      \"created_by\":\"2\",\n      \"created_on\": \"timestamp\",\n      }\n    ]\n}</code></pre><p>The following system fields are always included in the response:</p><figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"height: 352px;\"><table class=\"table--hover\">\n<thead><tr style=\"height: 22px;\">\n<th style=\"height: 22px; width: 160.026px;\">Name</th>\n<th style=\"height: 22px; width: 138.958px;\">Type</th>\n<th style=\"height: 22px; width: 391.107px;\">Description</th>\n</tr></thead>\n<tbody>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">created_by</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the user who created the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">created_on</td>\n<td style=\"height: 22px; width: 130.938px;\">timestamp</td>\n<td style=\"height: 22px; width: 383.086px;\">The date/time when the test case was created (as UNIX timestamp)</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">estimate</td>\n<td style=\"height: 22px; width: 130.938px;\">timespan</td>\n<td style=\"height: 22px; width: 383.086px;\">The estimate, e.g. \"30s\" or \"1m 45s\"</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">estimate_forecast</td>\n<td style=\"height: 22px; width: 130.938px;\">timespan</td>\n<td style=\"height: 22px; width: 383.086px;\">The estimate forecast, e.g. \"30s\" or \"1m 45s\"</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The unique ID of the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">is_ai_automated</td>\n<td style=\"height: 22px; width: 130.938px;\">boolean</td>\n<td style=\"height: 22px; width: 383.086px;\">Indicates whether the test case has been flagged for AI automation. <strong>TestRail Cloud only </strong>— always <code class=\"inline-code\">false</code> or absent on Server instances. <strong>Requires TestRail 10.9 or later.</strong>\n</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">is_ai_generated</td>\n<td style=\"height: 22px; width: 130.938px;\">boolean</td>\n<td style=\"height: 22px; width: 383.086px;\">Indicates whether the test case was generated by AI. <strong>TestRail Cloud only </strong>— always <code class=\"inline-code\">false</code> or absent on Server instances. <strong>Requires TestRail 10.9 or later.</strong>\n</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">milestone_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the milestone that is linked to the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">priority_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the priority that is linked to the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">refs</td>\n<td style=\"height: 22px; width: 130.938px;\">string</td>\n<td style=\"height: 22px; width: 383.086px;\">A comma-separated list of references/requirements that are linked to the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">section_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the section the test case belongs to</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">suite_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the suite the test case belongs to</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">template_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the template (field layout) the test case uses—<strong>requires TestRail 5.2 or later</strong>\n</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">title</td>\n<td style=\"height: 22px; width: 130.938px;\">string</td>\n<td style=\"height: 22px; width: 383.086px;\">The title of the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">type_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the test case type that is linked to the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">updated_by</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the user who last updated the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">updated_on</td>\n<td style=\"height: 22px; width: 130.938px;\">timestamp</td>\n<td style=\"height: 22px; width: 383.086px;\">The date/time when the test case was last updated (as UNIX timestamp)</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">version</td>\n<td style=\"height: 22px; width: 130.938px;\">string</td>\n<td style=\"height: 22px; width: 383.086px;\">The version of the test case — <strong>requires TestRail 10.9 or later</strong>\n</td>\n</tr>\n</tbody>\n</table></figure><p>Custom fields are also included in the response and use their system name prefixed with 'custom_' as their field identifier. Please see <a href=\"#addcase\" target=\"_self\" rel=\"undefined\">add_case</a> for a full list of available custom field types.</p><h3 id=\"h_01JZ36HDH2V2G9XVHBY7BR1SDS\">Response codes</h3><figure class=\"wysiwyg-table wysiwyg-table-align-left\"><table class=\"table--hover\">\n<thead><tr>\n<th>Status Code</th>\n<th>Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td>200</td>\n<td>Success (the test case is returned as part of the response)</td>\n</tr>\n<tr>\n<td>400</td>\n<td>Invalid or unknown test case</td>\n</tr>\n<tr>\n<td>403</td>\n<td>No access to the project</td>\n</tr>\n<tr>\n<td>429</td>\n<td>\n<strong>TestRail Cloud only</strong>—Too many requests (see <a href=\"https://support.testrail.com/hc/en-us/articles/7077083596436#APIRateLimit\" target=\"_blank\" rel=\"noopener noreferrer\">API rate limit</a>)</td>\n</tr>\n</tbody>\n</table></figure><h2 id=\"getcases\">get_cases</h2><p>Returns a list of test cases for a project or specific test suite (if the project has multiple suites enabled).</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">GET index.php?/api/v2/get_cases/{project_id}&amp;suite_id={suite_id}</code></pre><h3 id=\"h_01JZ36HDH2JRXY9MFCXTX2P48D\">Parameters</h3><figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"width: 100%;\"><table class=\"table--hover\" style=\"border-collapse: collapse;\">\n<thead><tr>\n<th style=\"width: 19.4286%;\">Name</th>\n<th style=\"width: 15%;\">Type</th>\n<th style=\"width: 16.2858%;\">Required</th>\n<th style=\"width: 49.1428%;\">Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td style=\"width: 19.4286%;\">project_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">true</td>\n<td style=\"width: 49.1428%;\">The ID of the project</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">suite_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">See Description</td>\n<td style=\"width: 49.1428%;\">The ID of the test suite (optional if the project is operating in single suite mode)</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">created_after</td>\n<td style=\"width: 15%;\">timestamp</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">Only return test cases created after this date (as UNIX timestamp)</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">created_before</td>\n<td style=\"width: 15%;\">timestamp</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">Only return test cases created before this date (as UNIX timestamp)</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">created_by</td>\n<td style=\"width: 15%;\">integer (list)</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">A comma-separated list of creators (user IDs) to filter by</td>\n</tr>\n<tr>\n<td>fields</td>\n<td>string</td>\n<td>false</td>\n<td>A comma-separated list of field names to include in the response (e.g. id,title,status_id,updated_on). When omitted, all fields are returned. — <strong>requires TestRail 10.8 or later</strong>\n</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">filter</td>\n<td style=\"width: 15%;\">string</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">Only return cases with matching filter string in the case title</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">limit</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The number of test cases the response should return (The response size is 250 by default) —<strong>requires TestRail 6.7 or later</strong>\n</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">milestone_id</td>\n<td style=\"width: 15%;\">integer (list)</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">A comma-separated list of milestone IDs to filter by <em>(not available if the milestone field is disabled for the project)</em>\n</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">offset</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">Where to start counting the tests cases from (the offset)—<strong>requires TestRail 6.7 or later</strong>\n</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">priority_id</td>\n<td style=\"width: 15%;\">integer (list)</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">A comma-separated list of priority IDs to filter by</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">refs</td>\n<td style=\"width: 15%;\">string</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">A single Reference ID (e.g. TR-1, 4291, etc.) —<strong>requires TestRail 6.5.2 or later</strong>\n</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">section_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of a test case section</td>\n</tr>\n<tr>\n<td>status_id     </td>\n<td>integer (list)</td>\n<td>false</td>\n<td>A comma-separated list of status IDs to filter by — <strong>requires TestRail 10.8 or later</strong>\n</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">template_id</td>\n<td style=\"width: 15%;\">integer (list)</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">A comma-separated list of template IDs to filter by —<strong>requires TestRail 5.2 or later</strong>\n</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">type_id</td>\n<td style=\"width: 15%;\">integer (list)</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">A comma-separated list of case type IDs to filter by</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">updated_after</td>\n<td style=\"width: 15%;\">timestamp</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">Only return test cases updated after this date (as UNIX timestamp)</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">updated_before</td>\n<td style=\"width: 15%;\">timestamp</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">Only return test cases updated before this date (as UNIX timestamp)</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">updated_by</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">A comma-separated list of user IDs who updated test cases to filter by</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">label_id</td>\n<td style=\"width: 15%;\">integer (list)</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">A comma-separated list of label IDs to filter by</td>\n</tr>\n<tr>\n<td>assignedto_id </td>\n<td>integer (list)</td>\n<td>false</td>\n<td>A comma-separated list of user IDs to filter by assignee — <strong>requires TestRail 10.8 or later</strong>\n</td>\n</tr>\n</tbody>\n</table></figure><p>Example requests:</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\"># Get all the test cases that are in project 34 (project ID of 34), suite with ID of 2 and priority 3 or 4\nGET index.php?/api/v2/get_cases/34&amp;suite_id=2&amp;priority_id=3,4\n\n# Get 10 test cases from project 34\nGET index.php?/api/v2/get_cases/34&amp;limit=10\n\n# Only returning test cases from project 34 starting the offset number\nGET index.php?/api/v2/get_cases/34&amp;offset=5\n\n# Filter cases in project 34 with a filter string of \"login\"\nGET index.php?/api/v2/get_cases/34&amp;filter=login\n\n# Combined usage\nGET index.php?/api/v2/get_cases/34&amp;offset=:5&amp;limit=:10&amp;filter=:login\n</code></pre><h3 id=\"h_01JZ36HDH2WC5K922EEMY0AK73\">Response content</h3><p>The response includes an array of test cases. Each test case in the array of \"cases\" objects follows the same format as the response to <a class=\"wikilink1\" href=\"#getcase\" target=\"_self\" title=\"testrail-api2:reference-cases ↵\" rel=\"undefined\">get_case</a>.</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">{\n    \"offset\": 0,\n    \"limit\": 250,\n    \"size\": 250,\n    \"_links\": {\n        \"next\": \"/api/v2/get_cases/1&amp;limit=250&amp;offset=250\",\n        \"prev\": null\n    },\n    \"cases\": [\n        {\n            \"id\": 1,\n            \"title\": \"..\",\n        },\n        {\n            \"id\": 2,\n            \"title\": \"..\",\n        }\n    ]\n}</code></pre><h3 id=\"h_01JZ36HDH2EJ86S95RDFH97MEY\">Response codes</h3><figure class=\"wysiwyg-table wysiwyg-table-align-left\"><table class=\"table--hover\">\n<thead><tr>\n<th>Status Code</th>\n<th>Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td>200</td>\n<td>Success (the test cases are returned as part of the response)</td>\n</tr>\n<tr>\n<td>400</td>\n<td>Invalid or unknown test case</td>\n</tr>\n<tr>\n<td>403</td>\n<td>No access to the project</td>\n</tr>\n<tr>\n<td>429</td>\n<td>\n<strong>TestRail Cloud only</strong>—Too many requests (see <a href=\"https://support.testrail.com/hc/en-us/articles/7077083596436#APIRateLimit\" target=\"_blank\" rel=\"noopener noreferrer\">API rate limit</a>)</td>\n</tr>\n</tbody>\n</table></figure><h2 id=\"getcasescount\">get_cases_count</h2><!-- START version callout --><div class=\"callout\"><p>This endpoint requires TestRail 10.9 or later.</p></div><!-- END version callout --><p>Returns the total count of test cases for a project, along with pagination metadata indicating how many paginated requests would be required to retrieve all matching cases using <a href=\"#getcases\" target=\"_self\" rel=\"undefined\">get_cases</a>.</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">GET index.php?/api/v2/get_cases_count/{project_id}</code></pre><h3 id=\"h_01M49JM50SRJT8SN3T9E5GC7GD\">Parameters</h3><p>Accepts the same filter parameters as <a href=\"#getcases\" target=\"_self\" rel=\"undefined\">get_cases</a> (e.g. <code class=\"inline-code\">suite_id</code>, <code class=\"inline-code\">section_id</code>, <code class=\"inline-code\">type_id</code>, <code class=\"inline-code\">priority_id</code>, <code class=\"inline-code\">created_after</code>, <code class=\"inline-code\">updated_after</code>, etc.).</p><h3 id=\"h_01M49JM50SSKZN4E8TJH8ATXKN\">Response content</h3><p>Example response:</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">{\n    \"count\": 1250,\n    \"pages\": 5,\n    \"requests\": 5\n}</code></pre><figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"width: 100%;\"><table class=\"table--hover wysiwyg-table-resized\">\n<colgroup>\n<col style=\"width: 12.6%;\">\n<col style=\"width: 14.6%;\">\n<col style=\"width: 72.8%;\">\n</colgroup>\n<thead><tr>\n<th>Name</th>\n<th>Type</th>\n<th>Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td>count</td>\n<td>integer</td>\n<td>The total number of test cases matching the applied filters</td>\n</tr>\n<tr>\n<td>pages</td>\n<td>integer</td>\n<td>The number of pages required to retrieve all matching cases at the default page size (250)</td>\n</tr>\n<tr>\n<td>requests</td>\n<td>integer</td>\n<td>The number of API requests required to retrieve all matching cases at the default page size (250)</td>\n</tr>\n</tbody>\n</table></figure><h3 id=\"h_01M49JM50S8XT9JFG3K77AGRAA\">Response codes</h3><figure class=\"wysiwyg-table wysiwyg-table-align-left\"><table class=\"table--hover\">\n<thead><tr>\n<th>Status Code</th>\n<th>Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td>200</td>\n<td>Success (the count is returned as part of the response)</td>\n</tr>\n<tr>\n<td>400</td>\n<td>Invalid or unknown project</td>\n</tr>\n<tr>\n<td>403</td>\n<td>No access to the project</td>\n</tr>\n<tr>\n<td>429</td>\n<td>\n<strong>TestRail Cloud only</strong>—Too many requests (see <a href=\"https://support.testrail.com/hc/en-us/articles/7077083596436#APIRateLimit\" target=\"_blank\" rel=\"noopener noreferrer\">API rate limit</a>)</td>\n</tr>\n</tbody>\n</table></figure><h2 id=\"gethistoryforcase\">get_history_for_case</h2><!-- START version callout --><div class=\"callout\"><p>This endpoint requires TestRail 6.5.4 or later.</p></div><!-- END version callout --><p>Returns the edit history for a test <code class=\"inline-code\">case_id</code>.</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">GET index.php?/api/v2/get_history_for_case/{case_id}</code></pre><h3 id=\"h_01JZ36HDH2H630THC6VPV6FKDH\">Parameters</h3><figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"width: 100%;\"><table class=\"table--hover\" style=\"border-collapse: collapse;\">\n<thead><tr>\n<th style=\"width: 19.4286%;\">Name</th>\n<th style=\"width: 15%;\">Type</th>\n<th style=\"width: 16.2858%;\">Required</th>\n<th style=\"width: 49.1428%;\">Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td style=\"width: 19.4286%;\">case_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">true</td>\n<td style=\"width: 49.1428%;\">The ID of the test case</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">limit</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The number of test case changes the response should return (The response size is 250 by default) <strong>— requires TestRail 6.7 or later</strong>\n</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">offset</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">Where to start counting the tests case changes from (the offset) — <strong>requires TestRail 6.7 or later</strong>\n</td>\n</tr>\n</tbody>\n</table></figure><p>The following system fields are always included in the response:</p><figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"height: 286px;\"><table class=\"table--hover\">\n<thead><tr style=\"height: 22px;\">\n<th style=\"height: 22px; width: 160.026px;\">Name</th>\n<th style=\"height: 22px; width: 138.958px;\">Type</th>\n<th style=\"height: 22px; width: 391.107px;\">Description</th>\n</tr></thead>\n<tbody>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the test case change</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">created_on</td>\n<td style=\"height: 22px; width: 130.938px;\">timestamp</td>\n<td style=\"height: 22px; width: 383.086px;\">The UNIX timestamp the change was made</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">type_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The change type. This value is typically 6, indicating an 'update'. <em>(The type_id values in the 'changes' array are described below)</em>\n</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">user_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the user who made the change</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">changes</td>\n<td style=\"height: 22px; width: 130.938px;\">array</td>\n<td style=\"height: 22px; width: 383.086px;\">An array of details for the changes made to the test cases</td>\n</tr>\n</tbody>\n</table></figure><p>The following fields can be included in the <code class=\"inline-code\">changes</code> array:</p><figure class=\"wysiwyg-table wysiwyg-table-align-left\"><table class=\"table--hover\">\n<thead><tr style=\"height: 22px;\">\n<th style=\"height: 22px; width: 160.026px;\">Name</th>\n<th style=\"height: 22px; width: 138.958px;\">Type</th>\n<th style=\"height: 22px; width: 391.107px;\">Description</th>\n</tr></thead>\n<tbody>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">type_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The type of the updated field<br><em>1 = string</em><br><em>2 = integer</em><br><em>3 = boolean</em><br><em>4 = date</em><br><em>5 = timespan</em><br><em>6 = text</em><br><em>7 = URL</em><br><em>8 = steps</em>\n</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">old_text</td>\n<td style=\"height: 22px; width: 130.938px;\">text</td>\n<td style=\"height: 22px; width: 383.086px;\">The previous text value of the updated field <em>(Used for text fields)</em>\n</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">new_text</td>\n<td style=\"height: 22px; width: 130.938px;\">text</td>\n<td style=\"height: 22px; width: 383.086px;\">The new text value of the updated field <em>(Used for text fields)</em>\n</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">label</td>\n<td style=\"height: 22px; width: 130.938px;\">string</td>\n<td style=\"height: 22px; width: 383.086px;\">The field label as seen in the user interface</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">options</td>\n<td style=\"height: 22px; width: 130.938px;\">array</td>\n<td style=\"height: 22px; width: 383.086px;\">An array of options configured in the field, such as required, default value, etc.</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">field</td>\n<td style=\"height: 22px; width: 130.938px;\">string</td>\n<td style=\"height: 22px; width: 383.086px;\">The system name of the updated field</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">old_value</td>\n<td style=\"height: 22px; width: 130.938px;\">varies</td>\n<td style=\"height: 22px; width: 383.086px;\">The previous value of the updated field. This is used for any non-text field, including the separated steps field. The value can be text or an integer, depending on the field type</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">new_value</td>\n<td style=\"height: 22px; width: 130.938px;\">varies</td>\n<td style=\"height: 22px; width: 383.086px;\">The new value of the updated field. This is used for any non-text field, including the separated steps field. The value can be text or an integer, depending on the field type</td>\n</tr>\n</tbody>\n</table></figure><h3 id=\"h_01JZ36HDH2A6F709DRZ7A7B410\">Response content</h3><p>The response includes an array of test case changes. Each entry in the array is a change record:</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">[\n    {\n        \"offset\": 0,\n        \"limit\": 250,\n        \"size\": 1,\n        \"_links\": {\n            \"next\": null,\n            \"prev\": null\n        },\n        \"history\": [\n            {\n                \"id\": 3382,\n                \"type_id\": 6,\n                \"created_on\": 1597927176,\n                \"user_id\": 1,\n                \"changes\": [\n                    {\n                        \"type_id\": 1,\n                        \"old_text\": \"Original Section\",\n                        \"new_text\": \"Updated Section\",\n                        \"field\": \"section_id\",\n                        \"old_value\": 3573,\n                        \"new_value\": 3574\n                    },\n                ]\n            },\n            {\n                \"id\": 3389,\n                \"type_id\": 6,\n                \"created_on\": 1597932715,\n                \"user_id\": 1,\n                \"changes\": [\n                    {\n                        \"type_id\": 1,\n                        \"field\": \"refs\",\n                        \"old_value\": null,\n                        \"new_value\": \"1\"\n                    },\n                ]\n            },\n        ]\n    }\n]</code></pre><h3 id=\"h_01JZ36HDH2VJC3FCDZ8T3PRQPZ\">Response codes</h3><figure class=\"wysiwyg-table wysiwyg-table-align-left\"><table class=\"table--hover\">\n<thead><tr>\n<th>Status Code</th>\n<th>Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td>200</td>\n<td>Success (the test case is returned as part of the response)</td>\n</tr>\n<tr>\n<td>400</td>\n<td>Invalid or unknown test case</td>\n</tr>\n<tr>\n<td>403</td>\n<td>No access to the project</td>\n</tr>\n<tr>\n<td>429</td>\n<td>\n<strong>TestRail Cloud only</strong>—Too many requests (see <a href=\"https://support.testrail.com/hc/en-us/articles/7077083596436#APIRateLimit\" target=\"_blank\" rel=\"noopener noreferrer\">API rate limit</a>)</td>\n</tr>\n</tbody>\n</table></figure><h2 id=\"addcase\">add_case</h2><p>Creates a new test case.</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">POST index.php?/api/v2/add_case/{section_id}</code></pre><h3 id=\"h_01JZ36HDH3FQK5RAFJ5Q1KR6PF\">Parameters</h3><p>The following POST fields are supported (system fields):</p><figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"width: 100%;\"><table class=\"table--hover\" style=\"border-collapse: collapse;\">\n<thead><tr>\n<th style=\"width: 19.4286%;\">Name</th>\n<th style=\"width: 15%;\">Type</th>\n<th style=\"width: 16.2858%;\">Required</th>\n<th style=\"width: 49.1428%;\">Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td style=\"width: 19.4286%;\">section_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">true</td>\n<td style=\"width: 49.1428%;\">The ID of the section the test case should be added to</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">title</td>\n<td style=\"width: 15%;\">string</td>\n<td style=\"width: 16.2858%;\">true</td>\n<td style=\"width: 49.1428%;\">The title of the test case</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">template_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of the template (field layout)—<strong>requires TestRail 5.2 or later</strong>\n</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">type_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of the case type</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">priority_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of the case priority</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">estimate</td>\n<td style=\"width: 15%;\">timespan</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The estimate, e.g. \"30s\" or \"1m 45s\"</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">milestone_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of the milestone to link to the test case</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">refs</td>\n<td style=\"width: 15%;\">string</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">A comma-separated list of references/requirements</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">version</td>\n<td style=\"width: 15%;\">string</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The version of the test case — <strong>requires TestRail 10.9 or later</strong>\n</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">labels </td>\n<td style=\"width: 15%;\">Array of mixed values (integer or string)</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of a label, the title of a label or both, in array form.</td>\n</tr>\n<tr>\n<td>is_legacy</td>\n<td>boolean</td>\n<td>false</td>\n<td>\n<p>When set to \"true\", indicates the content in supported text fields are Markdown and will be later converted to HTML for use with the Rich Text Editor in the TestRail UI.</p>\n<p><em>Note: this setting applies to all supported text fields in the test case, including custom fields.</em></p>\n</td>\n</tr>\n</tbody>\n</table></figure><p>Custom field parameters are supported as well and must be submitted with their system name, prefixed with 'custom_', e.g.:</p><pre class=\"wysiwyg-code-block\"><code class=\"language-auto\">{\n    \"custom_preconds\": \"These are the preconditions for a test case\"\n}\n</code></pre><p>The following custom field types are supported:</p><figure class=\"wysiwyg-table wysiwyg-table-align-left\"><table class=\"table--hover\">\n<thead><tr style=\"height: 22px;\">\n<th style=\"height: 22px; width: 160.026px;\">Name</th>\n<th style=\"height: 22px; width: 138.958px;\">Type</th>\n<th style=\"height: 22px; width: 391.107px;\">Description</th>\n</tr></thead>\n<tbody>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">Checkbox</td>\n<td style=\"height: 22px; width: 130.938px;\">boolean</td>\n<td style=\"height: 22px; width: 383.086px;\">True for checked and false otherwise</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">Date</td>\n<td style=\"height: 22px; width: 130.938px;\">string</td>\n<td style=\"height: 22px; width: 383.086px;\">A date in the same format as configured for TestRail and API user (e.g. \"07/08/2013\")</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">Dropdown</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of a dropdown value as configured in the field configuration</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">Integer</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">A valid integer</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">Milestone</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of a milestone for the custom field</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">Multi-select</td>\n<td style=\"height: 22px; width: 130.938px;\">array</td>\n<td style=\"height: 22px; width: 383.086px;\">An array of IDs as configured in the field configuration</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">Steps</td>\n<td style=\"height: 22px; width: 130.938px;\">array</td>\n<td style=\"height: 22px; width: 383.086px;\">An array of objects specifying the steps. Also see the example below</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">String</td>\n<td style=\"height: 22px; width: 130.938px;\">string</td>\n<td style=\"height: 22px; width: 383.086px;\">A valid string with a maximum length of 250 characters</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">Text</td>\n<td style=\"height: 22px; width: 130.938px;\">string</td>\n<td style=\"height: 22px; width: 383.086px;\">A string without a maximum length</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">URL</td>\n<td style=\"height: 22px; width: 130.938px;\">string</td>\n<td style=\"height: 22px; width: 383.086px;\">A string with matches the syntax of a URL</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">User</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of a user for the custom field</td>\n</tr>\n</tbody>\n</table></figure><h3 id=\"h_01JZ36HDH3VS2TFBNHCZTVK8HT\">Request example</h3><p>Also, see the following example which shows how to submit steps with the <a class=\"wikilink1\" href=\"https://support.testrail.com/hc/en-us/articles/7101746388500\" target=\"_blank\" rel=\"noopener noreferrer\">structured steps custom field</a> and a shared test step:</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">{\n    \"title\": \"This is a test case\",\n    \"type_id\": 1,\n    \"priority_id\": 3,\n    \"estimate\": \"3m\",\n    \"refs\": \"RF-1, RF-2\",\n    \"custom_steps_separated\": [\n        {\n            \"content\": \"Step 1\",\n            \"expected\": \"Expected Result 1\"\n        },\n        {\n            \"content\": \"Step 2\",\n            \"expected\": \"Expected Result 2\"\n        },\n        {\n            \"shared_step_id\": 3\n        },\n    \"is_legacy\": false,\n    \"labels\": [\n     'label1, 'label5',7,9,10,'label8'\n       ]\n    ]\n}</code></pre><h3 id=\"h_01JZ36HDH3KHJX15MPPRQSYMRA\">Response content</h3><p>If successful, this method returns the new test case using the same response format as <a href=\"#getcase\" target=\"_self\" rel=\"undefined\">get_case</a>. Example response:</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">{\n    \"id\": 1,\n    \"title\": \"Print document history and attributes\",\n    \"section_id\": 1,\n    \"template_id\": 1,\n    \"type_id\": 2,\n    \"priority_id\": 2,\n    \"milestone_id\": null,\n    \"refs\": null,\n    \"created_by\": 1,\n    \"created_on\": 1646317844,\n}\n</code></pre><p>The following system fields are always included in the response:</p><figure class=\"wysiwyg-table wysiwyg-table-align-left\"><table class=\"table--hover\">\n<thead><tr style=\"height: 22px;\">\n<th style=\"height: 22px; width: 160.026px;\">Name</th>\n<th style=\"height: 22px; width: 138.958px;\">Type</th>\n<th style=\"height: 22px; width: 391.107px;\">Description</th>\n</tr></thead>\n<tbody>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">created_by</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the user who created the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">created_on</td>\n<td style=\"height: 22px; width: 130.938px;\">timestamp</td>\n<td style=\"height: 22px; width: 383.086px;\">The date/time when the test case was created (as UNIX timestamp)</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">estimate</td>\n<td style=\"height: 22px; width: 130.938px;\">timespan</td>\n<td style=\"height: 22px; width: 383.086px;\">The estimate, e.g. \"30s\" or \"1m 45s\"</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">estimate_forecast</td>\n<td style=\"height: 22px; width: 130.938px;\">timespan</td>\n<td style=\"height: 22px; width: 383.086px;\">The estimate forecast, e.g. \"30s\" or \"1m 45s\"</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The unique ID of the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">milestone_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the milestone that is linked to the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">priority_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the priority that is linked to the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">refs</td>\n<td style=\"height: 22px; width: 130.938px;\">string</td>\n<td style=\"height: 22px; width: 383.086px;\">A comma-separated list of references/requirements that are linked to the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">section_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the section the test case belongs to</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">suite_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the suite the test case belongs to</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">template_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the template (field layout) the test case uses—<strong>requires TestRail 5.2 or later</strong>\n</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">title</td>\n<td style=\"height: 22px; width: 130.938px;\">string</td>\n<td style=\"height: 22px; width: 383.086px;\">The title of the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">type_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the test case type that is linked to the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">updated_by</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the user who last updated the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">updated_on</td>\n<td style=\"height: 22px; width: 130.938px;\">timestamp</td>\n<td style=\"height: 22px; width: 383.086px;\">The date/time when the test case was last updated (as UNIX timestamp)</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">version</td>\n<td style=\"height: 22px; width: 130.938px;\">string</td>\n<td style=\"height: 22px; width: 383.086px;\">The version of the test case — <strong>requires TestRail 10.9 or later</strong>\n</td>\n</tr>\n</tbody>\n</table></figure><p>Custom fields are also included in the response and use their system name prefixed with 'custom_' as their field identifier. Please see <a href=\"#addcase\" target=\"_self\" rel=\"undefined\">add_case</a> for a full list of available custom field types.</p><h3 id=\"h_01JZ36HDH3CDGFEH9W71WQNYKZ\">Response codes</h3><figure class=\"wysiwyg-table wysiwyg-table-align-left\"><table class=\"table--hover\">\n<thead><tr>\n<th>Status Code</th>\n<th>Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td>200</td>\n<td>Success (the test case is created as part of the response)</td>\n</tr>\n<tr>\n<td>400</td>\n<td>Invalid or unknown test case</td>\n</tr>\n<tr>\n<td>403</td>\n<td>No access to the project</td>\n</tr>\n<tr>\n<td>429</td>\n<td>\n<strong>TestRail Cloud only</strong>—Too many requests (see <a href=\"https://support.testrail.com/hc/en-us/articles/7077083596436#APIRateLimit\" target=\"_blank\" rel=\"noopener noreferrer\">API rate limit</a>)</td>\n</tr>\n</tbody>\n</table></figure><h2 id=\"addcases\">add_cases</h2><p>Creates multiple test cases.</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">POST index.php?/api/v2/add_cases/{section_id}</code></pre><p><strong>Requires TestRail 10.4 or later.</strong></p><h3 id=\"h_01M3VEQ73NW7EVTVBDVV4J3PC1\">Parameters</h3><p>The following POST fields are supported:</p><figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"width: 100%;\"><table class=\"table--hover\" style=\"border-collapse: collapse;\">\n<thead><tr>\n<th style=\"width: 19.4286%;\">Name</th>\n<th style=\"width: 15%;\">Type</th>\n<th style=\"width: 16.2858%;\">Required</th>\n<th style=\"width: 49.1428%;\">Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td style=\"width: 19.4286%;\">section_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">true</td>\n<td style=\"width: 49.1428%;\">The ID of the section the test cases should be added to</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">cases</td>\n<td style=\"width: 15%;\">array</td>\n<td style=\"width: 16.2858%;\">true</td>\n<td style=\"width: 49.1428%;\">An array of test case objects to create. Maximum 500 cases per request.</td>\n</tr>\n</tbody>\n</table></figure><p>Each object in the <code>cases</code> array supports the following system fields:</p><figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"width: 100%;\"><table class=\"table--hover\" style=\"border-collapse: collapse;\">\n<thead><tr>\n<th style=\"width: 19.4286%;\">Name</th>\n<th style=\"width: 15%;\">Type</th>\n<th style=\"width: 16.2858%;\">Required</th>\n<th style=\"width: 49.1428%;\">Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td style=\"width: 19.4286%;\">title</td>\n<td style=\"width: 15%;\">string</td>\n<td style=\"width: 16.2858%;\">true</td>\n<td style=\"width: 49.1428%;\">The title of the test case</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">template_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of the template (field layout)—<strong>requires TestRail 5.2 or later</strong>\n</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">type_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of the case type</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">priority_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of the case priority</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">estimate</td>\n<td style=\"width: 15%;\">timespan</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The estimate, e.g. \"30s\" or \"1m 45s\"</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">milestone_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of the milestone to link to the test case</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">refs</td>\n<td style=\"width: 15%;\">string</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">A comma-separated list of references/requirements</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">labels </td>\n<td style=\"width: 15%;\">Array of mixed values (integer or string)</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of a label, the title of a label or both, in array form.</td>\n</tr>\n<tr>\n<td>is_legacy</td>\n<td>boolean</td>\n<td>false</td>\n<td>\n<p>When set to \"true\", indicates the content in supported text fields are Markdown and will be later converted to HTML for use with the Rich Text Editor in the TestRail UI.</p>\n<p><em>Note: this setting applies to all supported text fields in the test case, including custom fields.</em></p>\n</td>\n</tr>\n</tbody>\n</table></figure><p>Custom field parameters are supported as well and must be submitted with their system name, e.g.:</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">{\n    \"custom_preconds\": \"These are the preconditions for a test case\"\n}</code></pre><p>Add_cases endpoint support all custom field types that are supported in the add_case endpoint. Please see <a href=\"#addcase\" target=\"_self\" rel=\"undefined\">add_case</a> for a full list of available custom field types.</p><h3 id=\"h_01M3VEQ73PSHHRGC0PHRYJ0V60\">Request example</h3><p>Also, see the following example which shows how to submit steps with the <a href=\"https://support.testrail.com/hc/en-us/articles/7101746388500\" target=\"_blank\" rel=\"noopener noreferrer\">structured steps custom field</a> and a shared test step:</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">{\n    \"cases\": [\n        {\n            \"title\": \"This is a test case\",\n            \"type_id\": 1,\n            \"priority_id\": 3,\n            \"estimate\": \"3m\",\n            \"refs\": \"RF-1, RF-2\",\n            \"custom_steps_separated\": [\n                {\n                    \"content\": \"Step 1\",\n                    \"expected\": \"Expected Result 1\"\n                },\n                {\n                    \"content\": \"Step 2\",\n                    \"expected\": \"Expected Result 2\"\n                },\n                {\n                    \"shared_step_id\": 3\n                }\n            ],\n            \"is_legacy\": false,\n            \"labels\": [\"label1\", \"label5\", 7, 9, 10, \"label8\"]\n        }\n    ]\n}</code></pre><h3 id=\"h_01M3VEQ73P46SQDFDHHDX4EFV1\">Response content</h3><p>If successful, this method returns an array of the new test cases using the same response format as <a href=\"#getcase\" target=\"_self\" rel=\"undefined\">get_case</a>. Example response:</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">[\n    {\n        \"id\": 1,\n        \"title\": \"This is a test case\",\n        \"section_id\": 1,\n        \"template_id\": 1,\n        \"type_id\": 1,\n        \"priority_id\": 2,\n        \"milestone_id\": null,\n        \"refs\": \"RF-1, RF-2\",\n        \"created_by\": 1,\n        \"created_on\": 1646317844\n    }\n]\n</code></pre><p>The following system fields are always included in the response:</p><figure class=\"wysiwyg-table wysiwyg-table-align-left\"><table class=\"table--hover\">\n<thead><tr style=\"height: 22px;\">\n<th style=\"height: 22px; width: 160.026px;\">Name</th>\n<th style=\"height: 22px; width: 138.958px;\">Type</th>\n<th style=\"height: 22px; width: 391.107px;\">Description</th>\n</tr></thead>\n<tbody>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">created_by</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the user who created the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">created_on</td>\n<td style=\"height: 22px; width: 130.938px;\">timestamp</td>\n<td style=\"height: 22px; width: 383.086px;\">The date/time when the test case was created (as UNIX timestamp)</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">estimate</td>\n<td style=\"height: 22px; width: 130.938px;\">timespan</td>\n<td style=\"height: 22px; width: 383.086px;\">The estimate, e.g. \"30s\" or \"1m 45s\"</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">estimate_forecast</td>\n<td style=\"height: 22px; width: 130.938px;\">timespan</td>\n<td style=\"height: 22px; width: 383.086px;\">The estimate forecast, e.g. \"30s\" or \"1m 45s\"</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The unique ID of the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">milestone_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the milestone that is linked to the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">priority_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the priority that is linked to the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">refs</td>\n<td style=\"height: 22px; width: 130.938px;\">string</td>\n<td style=\"height: 22px; width: 383.086px;\">A comma-separated list of references/requirements that are linked to the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">section_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the section the test case belongs to</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">suite_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the suite the test case belongs to</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">template_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the template (field layout) the test case uses—<strong>requires TestRail 5.2 or later</strong>\n</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">title</td>\n<td style=\"height: 22px; width: 130.938px;\">string</td>\n<td style=\"height: 22px; width: 383.086px;\">The title of the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">type_id</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the test case type that is linked to the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">updated_by</td>\n<td style=\"height: 22px; width: 130.938px;\">integer</td>\n<td style=\"height: 22px; width: 383.086px;\">The ID of the user who last updated the test case</td>\n</tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 152.005px;\">updated_on</td>\n<td style=\"height: 22px; width: 130.938px;\">timestamp</td>\n<td style=\"height: 22px; width: 383.086px;\">The date/time when the test case was last updated (as UNIX timestamp)</td>\n</tr>\n</tbody>\n</table></figure><p>Custom fields are also included in the response and use their system name prefixed with 'custom_' as their field identifier. Please see <a href=\"#addcase\" target=\"_self\" rel=\"undefined\">add_case</a> for a full list of available custom field types.</p><h3 id=\"h_01M3VEQ73PT4T8S7JKVF41CSTG\">Response codes</h3><figure class=\"wysiwyg-table wysiwyg-table-align-left\"><table class=\"table--hover\">\n<thead><tr>\n<th>Status Code</th>\n<th>Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td>200</td>\n<td>Success (the test cases are created and returned as part of the response)</td>\n</tr>\n<tr>\n<td>400</td>\n<td>Invalid or unknown section, or one or more test case objects failed validation</td>\n</tr>\n<tr>\n<td>403</td>\n<td>No access to the project</td>\n</tr>\n<tr>\n<td>429</td>\n<td>\n<strong>TestRail Cloud only</strong>—Too many requests (see <a href=\"https://support.testrail.com/hc/en-us/articles/7077083596436#APIRateLimit\" target=\"_blank\" rel=\"noopener noreferrer\">API rate limit</a>)</td>\n</tr>\n</tbody>\n</table></figure><h2 id=\"copycasestosection\">copy_cases_to_section</h2><p>Copies the list of cases to another suite/section.</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">POST index.php?/api/v2/copy_cases_to_section/{section_id}</code></pre><h3 id=\"h_01JZ36HDH3K0356J1PDS6VZ2KD\">Parameters</h3><p>The following POST fields are supported (system fields):</p><figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"width: 100%;\"><table class=\"table--hover\" style=\"border-collapse: collapse;\">\n<thead><tr>\n<th style=\"width: 19.4286%;\">Name</th>\n<th style=\"width: 15%;\">Type</th>\n<th style=\"width: 16.2858%;\">Required</th>\n<th style=\"width: 49.1428%;\">Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td style=\"width: 19.4286%;\">section_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">true</td>\n<td style=\"width: 49.1428%;\">The ID of the section the test case should be copied to</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">case_ids</td>\n<td style=\"width: 15%;\">array of integers</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">A comma-separated list of case IDs</td>\n</tr>\n</tbody>\n</table></figure><h3 id=\"h_01JZ36HDH3BXEPSSPDN1M5K5DF\">Response codes</h3><figure class=\"wysiwyg-table wysiwyg-table-align-left\"><table class=\"table--hover\">\n<thead><tr>\n<th>Status Code</th>\n<th>Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td>200</td>\n<td>Success (the test cases are copied as part of the response)</td>\n</tr>\n<tr>\n<td>400</td>\n<td>Invalid or unknown test case</td>\n</tr>\n<tr>\n<td>403</td>\n<td>No access to the project</td>\n</tr>\n<tr>\n<td>429</td>\n<td>\n<strong>TestRail Cloud only</strong>—Too many requests (see <a href=\"https://support.testrail.com/hc/en-us/articles/7077083596436#APIRateLimit\" target=\"_blank\" rel=\"noopener noreferrer\">API rate limit</a>)</td>\n</tr>\n</tbody>\n</table></figure><h2 id=\"updatecase\">update_case</h2><p>Updates an existing test case (partial updates are supported, i.e. you can submit and update specific fields only).</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">POST index.php?/api/v2/update_case/{case_id}</code></pre><h3 id=\"h_01JZ36HDH3C89AT85QBZM53DRH\">Parameters</h3><p>The following POST fields are supported (system fields):</p><figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"width: 100%;\"><table class=\"table--hover\" style=\"border-collapse: collapse;\">\n<thead><tr>\n<th style=\"width: 19.4286%;\">Name</th>\n<th style=\"width: 15%;\">Type</th>\n<th style=\"width: 16.2858%;\">Required</th>\n<th style=\"width: 49.1428%;\">Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td style=\"width: 19.4286%;\">case_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">true</td>\n<td style=\"width: 49.1428%;\">The ID of the test case</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">section_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of the section the test case should be updated to</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">title</td>\n<td style=\"width: 15%;\">string</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The title of the test case</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">template_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of the template (field layout)—<strong>requires TestRail 5.2 or later</strong>\n</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">type_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of the case type</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">priority_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of the case priority</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">estimate</td>\n<td style=\"width: 15%;\">timespan</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The estimate, e.g. \"30s\" or \"1m 45s\"</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">milestone_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of the milestone to link to the test case</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">refs</td>\n<td style=\"width: 15%;\">string</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">A comma-separated list of references/requirements</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">labels </td>\n<td style=\"width: 15%;\">Array of mixed values (integer or string)</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of a label, the title of a label or both, in array form.</td>\n</tr>\n<tr>\n<td>is_legacy</td>\n<td>boolean</td>\n<td>false</td>\n<td>\n<p>When set to \"true\", indicates the content in supported text fields are Markdown and will be later converted to HTML for use with the Rich Text Editor in the TestRail UI.</p>\n<p><em>Note: this setting applies to all supported text fields in the test case, including custom fields.</em></p>\n</td>\n</tr>\n</tbody>\n</table></figure><p>This method supports the same POST fields as <a href=\"#addcase\" target=\"_self\" rel=\"undefined\">add_case</a>. Updating a case's section_id <strong>requires TestRail 6.5.2 or later</strong>.</p><h3 id=\"h_01JZ36HDH3T56943VQW6T85RXY\">Request example</h3><p>Also, see the following example which shows how to update the priority and estimate fields for a test case:</p><pre class=\"wysiwyg-code-block\"><code class=\"language-auto\">{\n    \"priority_id\": 1,\n    \"estimate\": \"5m\"\n}</code></pre><h3 id=\"h_01JZ36HDH34V8AV49W1JK7N7WR\">Response content</h3><p>If successful, this method returns the new test case using the same response format as <a href=\"#getcase\" target=\"_self\" rel=\"undefined\">get_case</a>.</p><h3 id=\"h_01JZ36HDH3JHAWFBN43QBEJTB0\">Response codes</h3><figure class=\"wysiwyg-table wysiwyg-table-align-left\"><table class=\"table--hover\">\n<thead><tr>\n<th>Status Code</th>\n<th>Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td>200</td>\n<td>Success (the test case is updated as part of the response)</td>\n</tr>\n<tr>\n<td>400</td>\n<td>Invalid or unknown test case</td>\n</tr>\n<tr>\n<td>403</td>\n<td>No access to the project</td>\n</tr>\n<tr>\n<td>429</td>\n<td>\n<strong>TestRail Cloud only</strong>—Too many requests (see <a href=\"https://support.testrail.com/hc/en-us/articles/7077083596436#APIRateLimit\" target=\"_blank\" rel=\"noopener noreferrer\">API rate limit</a>)</td>\n</tr>\n</tbody>\n</table></figure><h2 id=\"updatecases\">update_cases</h2><p>Updates multiple test cases with the same values, like setting a set of test cases to \"High\" priority. This does not support updating multiple test cases with different values per test case.</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">POST index.php?/api/v2/update_cases/{suite_id}</code></pre><h3 id=\"h_01JZ36HDH3ETGJWNQFC45YAHST\">Parameters</h3><p>The following POST fields are supported (system fields):</p><figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"width: 100%;\"><table class=\"table--hover\" style=\"border-collapse: collapse;\">\n<thead><tr>\n<th style=\"width: 19.4286%;\">Name</th>\n<th style=\"width: 15%;\">Type</th>\n<th style=\"width: 16.2858%;\">Required</th>\n<th style=\"width: 49.1428%;\">Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td style=\"width: 19.4286%;\">case_ids</td>\n<td style=\"width: 15%;\">array of integers</td>\n<td style=\"width: 16.2858%;\">true</td>\n<td style=\"width: 49.1428%;\">The ID of the cases that need to be updated</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">suite_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">See description</td>\n<td style=\"width: 49.1428%;\">The ID of the test suite (optional if the project is operating in single suite mode)</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">section_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of the section the test case should be updated to</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">title</td>\n<td style=\"width: 15%;\">string</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The title of the test case</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">template_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of the template (field layout)—<strong>requires TestRail 5.2 or later</strong>\n</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">type_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of the case type</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">priority_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of the case priority</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">estimate</td>\n<td style=\"width: 15%;\">timespan</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The estimate, e.g. \"30s\" or \"1m 45s\"</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">milestone_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of the milestone to link to the test case</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">refs</td>\n<td style=\"width: 15%;\">string</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">A comma-separated list of references/requirements</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">labels </td>\n<td style=\"width: 15%;\">Array of mixed values (integer or string)</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">The ID of a label, the title of a label or both, in array form.</td>\n</tr>\n</tbody>\n</table></figure><p>This method supports the same POST fields as <a href=\"#addcase\" target=\"_self\" rel=\"undefined\">add_case</a>. Updating a case's section_id <strong>requires TestRail 6.5.2 or later</strong>.</p><h3 id=\"h_01JZ36HDH3KV1HFNGBWMQK8YYV\">Request example</h3><p>Also, see the following example which shows how to update the priority and estimate fields for a test case. The <code class=\"inline-code\">case_ids</code> field is a required field and indicates the test cases which should be updated:</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">{\n    \"case_ids\": [1, 2, 3],\n    \"priority_id\": 1,\n    \"estimate\": \"5m\"\n}</code></pre><h3 id=\"h_01JZ36HDH3XTSMK007PGFY38SX\">Response content</h3><p>If successful, this method returns the new test case using the same response format as <a href=\"#getcase\" target=\"_self\" rel=\"undefined\">get_case</a>.</p><h3 id=\"h_01JZ36HDH3EY29KPMGEPFSEH17\">Response codes</h3><figure class=\"wysiwyg-table wysiwyg-table-align-left\"><table class=\"table--hover\">\n<thead><tr>\n<th>Status Code</th>\n<th>Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td>200</td>\n<td>Success (the test case is returned as part of the response)</td>\n</tr>\n<tr>\n<td>400</td>\n<td>Invalid or unknown test case</td>\n</tr>\n<tr>\n<td>403</td>\n<td>No access to the project</td>\n</tr>\n<tr>\n<td>429</td>\n<td>\n<strong>TestRail Cloud only</strong>—Too many requests (see <a href=\"https://support.testrail.com/hc/en-us/articles/7077083596436#APIRateLimit\" target=\"_blank\" rel=\"noopener noreferrer\">API rate limit</a>)</td>\n</tr>\n</tbody>\n</table></figure><h2 id=\"movecasestosection\">move_cases_to_section</h2><p>Moves cases to another suite or section.</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">POST index.php?/api/v2/move_cases_to_section/{section_id}</code></pre><h3 id=\"h_01JZ36HDH308VEN951TJ2V6SXJ\">Parameters</h3><p>The following POST fields are supported (system fields):</p><figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"width: 100%;\"><table class=\"table--hover\" style=\"border-collapse: collapse;\">\n<thead><tr>\n<th style=\"width: 19.4286%;\">Name</th>\n<th style=\"width: 15%;\">Type</th>\n<th style=\"width: 16.2858%;\">Required</th>\n<th style=\"width: 49.1428%;\">Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td style=\"width: 19.4286%;\">section_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">true</td>\n<td style=\"width: 49.1428%;\">The ID of the section the case will be moved to</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">suite_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">true</td>\n<td style=\"width: 49.1428%;\">The ID of the suite the case will be moved to</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">case_ids</td>\n<td style=\"width: 15%;\">array of integers</td>\n<td style=\"width: 16.2858%;\">true</td>\n<td style=\"width: 49.1428%;\">A comma-separated list of case IDs</td>\n</tr>\n</tbody>\n</table></figure><h3 id=\"h_01JZ36HDH4CM3XZG23Y5Z10QNG\">Response codes</h3><figure class=\"wysiwyg-table wysiwyg-table-align-left\"><table class=\"table--hover\">\n<thead><tr>\n<th>Status Code</th>\n<th>Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td>200</td>\n<td>Success (the test cases are updated as part of the response)</td>\n</tr>\n<tr>\n<td>400</td>\n<td>Invalid or unknown test case</td>\n</tr>\n<tr>\n<td>403</td>\n<td>No access to the project</td>\n</tr>\n<tr>\n<td>429</td>\n<td>\n<strong>TestRail Cloud only</strong>—Too many requests (see <a href=\"https://support.testrail.com/hc/en-us/articles/7077083596436#APIRateLimit\" target=\"_blank\" rel=\"noopener noreferrer\">API rate limit</a>)</td>\n</tr>\n</tbody>\n</table></figure><h2 id=\"deletecase\">delete_case</h2><!-- START warning --><div class=\"callout callout--warning\">\n<h4 class=\"callout__title callout__icon\" id=\"h_01JZ36HDH4V2YDY0PFQPRQ7N1M\"><em class=\"fas fa-exclamation-triangle\"> </em></h4>\n<p>Deleting a test case cannot be undone and also permanently deletes all test results in active test runs (i.e. test runs that haven't been closed (archived) yet).</p>\n</div><!-- END warning --><p>Deletes an existing test case.</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">POST index.php?/api/v2/delete_case/{case_id}</code></pre><h3 id=\"h_01JZ36HDH48NTMQ408P9HTVTWF\">Parameters</h3><figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"width: 100%;\"><table class=\"table--hover\" style=\"border-collapse: collapse;\">\n<thead><tr>\n<th style=\"width: 19.4286%;\">Name</th>\n<th style=\"width: 15%;\">Type</th>\n<th style=\"width: 16.2858%;\">Required</th>\n<th style=\"width: 49.1428%;\">Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td style=\"width: 19.4286%;\">case_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">true</td>\n<td style=\"width: 49.1428%;\">The ID of the test case</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">soft</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">soft=1 will return information about the data which will be deleted but will not proceed with the deletion</td>\n</tr>\n</tbody>\n</table></figure><h3 id=\"h_01JZ36HDH4W99N9CYNEJ98Y1GX\">Soft parameter</h3><!-- START note --><div class=\"callout callout--info\">\n<h4 class=\"callout__title callout__icon\" id=\"h_01JZ36HDH492CYRMPAD8A7Z66M\"><em class=\"fas fa-info-circle\"> </em></h4>\n<p>Omitting the soft parameter, or submitting soft=0, will delete the test case.</p>\n</div><!-- END note --><p>If <code class=\"inline-code\">soft=1</code>, this will return data on the number of affected tests.</p><p>Including <code class=\"inline-code\">soft=1</code> will not actually delete the entity.</p><h3 id=\"h_01JZ36HDH4X2JM146BV6BM42G0\">Response codes</h3><figure class=\"wysiwyg-table wysiwyg-table-align-left\"><table class=\"table--hover\">\n<thead><tr>\n<th>Status Code</th>\n<th>Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td>200</td>\n<td>Success (the test case is deleted as part of the response)</td>\n</tr>\n<tr>\n<td>400</td>\n<td>Invalid or unknown test case</td>\n</tr>\n<tr>\n<td>403</td>\n<td>No access to the project</td>\n</tr>\n<tr>\n<td>429</td>\n<td>\n<strong>TestRail Cloud only</strong>—Too many requests (see <a href=\"https://support.testrail.com/hc/en-us/articles/7077083596436#APIRateLimit\" target=\"_blank\" rel=\"noopener noreferrer\">API rate limit</a>)</td>\n</tr>\n</tbody>\n</table></figure><h2 id=\"deletecases\">delete_cases</h2><!-- START warning --><div class=\"callout callout--warning\">\n<h4 class=\"callout__title callout__icon\" id=\"h_01JZ36HDH4JKHGBJ5CTV5YB2HR\"><em class=\"fas fa-exclamation-triangle\"> </em></h4>\n<p>Deleting a test case cannot be undone and also permanently deletes all test results in active test runs (i.e. test runs that haven't been closed (archived) yet).</p>\n</div><!-- END warning --><p>Deletes multiple test cases from a project or test suite.</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">POST index.php?/api/v2/delete_cases/{suite_id}&amp;soft=1</code></pre><h3 id=\"h_01JZ36HDH4V1Z37K8RKKD6VAQ1\">Parameters</h3><figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"width: 100%;\"><table class=\"table--hover\" style=\"border-collapse: collapse;\">\n<thead><tr>\n<th style=\"width: 19.4286%;\">Name</th>\n<th style=\"width: 15%;\">Type</th>\n<th style=\"width: 16.2858%;\">Required</th>\n<th style=\"width: 49.1428%;\">Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td style=\"width: 19.4286%;\">case_ids</td>\n<td style=\"width: 15%;\">array of integers</td>\n<td style=\"width: 16.2858%;\">true</td>\n<td style=\"width: 49.1428%;\">An array of the IDs of the test cases you would like to delete</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">project_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">true</td>\n<td style=\"width: 49.1428%;\">The ID of the project</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">suite_id</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">See description</td>\n<td style=\"width: 49.1428%;\">The ID of the suite (Only required if project is in multi-suite mode)</td>\n</tr>\n<tr>\n<td style=\"width: 19.4286%;\">soft</td>\n<td style=\"width: 15%;\">integer</td>\n<td style=\"width: 16.2858%;\">false</td>\n<td style=\"width: 49.1428%;\">soft=1 will return information about the data which will be deleted but will not proceed with the deletion</td>\n</tr>\n</tbody>\n</table></figure><h3 id=\"h_01JZ36HDH48B1BDA3P33QPMAAW\">Request example</h3><p>Also, see the following example, which shows the case ids from the selected project.</p><pre class=\"wysiwyg-code-block\"><code class=\"language-plaintext\">{\n    \"case_ids\": [1, 2, 3]\n}</code></pre><h3 id=\"h_01JZ36HDH4S5ACHY5DA5YXVPVZ\">Response codes</h3><figure class=\"wysiwyg-table wysiwyg-table-align-left\"><table class=\"table--hover\">\n<thead><tr>\n<th>Status Code</th>\n<th>Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td>200</td>\n<td>Success (the test case are deleted as part of the response)</td>\n</tr>\n<tr>\n<td>400</td>\n<td>Invalid or unknown test case</td>\n</tr>\n<tr>\n<td>403</td>\n<td>No access to the project</td>\n</tr>\n<tr>\n<td>429</td>\n<td>\n<strong>TestRail Cloud only</strong>—Too many requests (see <a href=\"https://support.testrail.com/hc/en-us/articles/7077083596436#APIRateLimit\" target=\"_blank\" rel=\"noopener noreferrer\">API rate limit</a>)</td>\n</tr>\n</tbody>\n</table></figure>","user_segment_ids":[]}}