> For the complete documentation index, see [llms.txt](https://docs.bugbug.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bugbug.io/public-api-reference/tests.md).

# Tests

Retrieving tests

## Retrieving tests list

> Returns many tests.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Tests","description":"Retrieving tests"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"PaginatedV2TestList":{"type":"object","required":["count","results"],"properties":{"count":{"type":"integer"},"next":{"type":"string","nullable":true,"format":"uri"},"previous":{"type":"string","nullable":true,"format":"uri"},"results":{"type":"array","items":{"$ref":"#/components/schemas/V2Test"}}}},"V2Test":{"type":"object","properties":{"folderId":{"type":["string","null"],"format":"uuid"},"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","maxLength":255},"tags":{"type":"array","items":{"$ref":"#/components/schemas/V2Tag"},"readOnly":true}},"required":["id","tags"]},"V2Tag":{"type":"object","properties":{"color":{"type":"string","readOnly":true},"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","readOnly":true}},"required":["color","id","name"]}}},"paths":{"/api/v2/tests/":{"get":{"operationId":"v2_tests_list","description":"Returns many tests.","summary":"Retrieving tests list","parameters":[{"in":"query","name":"folder","schema":{"type":"string","format":"uuid"}},{"in":"query","name":"folderId","schema":{"type":"string","format":"uuid"}},{"in":"query","name":"latestRun","schema":{"type":"boolean"},"description":"Include the latest run summary for each test."},{"in":"query","name":"noFolder","schema":{"type":"boolean"}},{"in":"query","name":"ordering","schema":{"type":"string","enum":["-created","-name","created","name"]}},{"name":"page","required":false,"in":"query","description":"A page number within the paginated result set.","schema":{"type":"integer"}},{"name":"page_size","required":false,"in":"query","description":"Number of results to return per page.","schema":{"type":"integer"}},{"in":"query","name":"query","schema":{"type":"string"},"description":"Search in names with the following query"},{"in":"query","name":"tags","schema":{"type":"string"},"description":"Comma-separated tag names. Names cannot contain commas. Matching is case-insensitive and uses AND semantics."}],"tags":["Tests"],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedV2TestList"}}},"description":""},"401":{"description":"Authentication credentials were missing or invalid."}}}}}}
```

## Create a new test

> Create test.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Tests","description":"Retrieving tests"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"V2TestCreate":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":255},"screenSizeType":{"enum":["desktop","mobile","custom"],"type":"string","description":"* `desktop` - Desktop\n* `mobile` - Mobile\n* `custom` - Custom"},"notes":{"type":["string","null"],"title":"Test notes"},"folderId":{"type":["string","null"],"format":"uuid"},"tags":{"type":"array","items":{"type":"string","maxLength":64},"writeOnly":true,"maxItems":64},"tagIds":{"type":"array","items":{"type":"string","format":"uuid"},"writeOnly":true,"maxItems":64}}},"V2TestDetails":{"type":"object","properties":{"folderId":{"type":["string","null"],"format":"uuid"},"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","maxLength":255},"tags":{"type":"array","items":{"$ref":"#/components/schemas/V2Tag"},"readOnly":true},"groups":{"type":"string","readOnly":true},"notes":{"type":["string","null"],"readOnly":true,"title":"Test notes"},"screenSizeType":{"enum":["desktop","mobile","custom"],"type":"string","description":"* `desktop` - Desktop\n* `mobile` - Mobile\n* `custom` - Custom","readOnly":true},"webappUrl":{"type":"string","readOnly":true}},"required":["groups","id","notes","screenSizeType","tags","webappUrl"]},"V2Tag":{"type":"object","properties":{"color":{"type":"string","readOnly":true},"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","readOnly":true}},"required":["color","id","name"]}}},"paths":{"/api/v2/tests/":{"post":{"operationId":"v2_tests_create","description":"Create test.","summary":"Create a new test","parameters":[],"tags":["Tests"],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/V2TestCreate"}},"application/json":{"schema":{"$ref":"#/components/schemas/V2TestCreate"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2TestDetails"}}},"description":""},"400":{"description":"Request body failed validation."},"401":{"description":"Authentication credentials were missing or invalid."}}}}}}
```

## Retrieving test by ID

> Returns a single test.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Tests","description":"Retrieving tests"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"V2TestDetails":{"type":"object","properties":{"folderId":{"type":["string","null"],"format":"uuid"},"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","maxLength":255},"tags":{"type":"array","items":{"$ref":"#/components/schemas/V2Tag"},"readOnly":true},"groups":{"type":"string","readOnly":true},"notes":{"type":["string","null"],"readOnly":true,"title":"Test notes"},"screenSizeType":{"enum":["desktop","mobile","custom"],"type":"string","description":"* `desktop` - Desktop\n* `mobile` - Mobile\n* `custom` - Custom","readOnly":true},"webappUrl":{"type":"string","readOnly":true}},"required":["groups","id","notes","screenSizeType","tags","webappUrl"]},"V2Tag":{"type":"object","properties":{"color":{"type":"string","readOnly":true},"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","readOnly":true}},"required":["color","id","name"]}}},"paths":{"/api/v2/tests/{id}/":{"get":{"operationId":"v2_tests_retrieve","description":"Returns a single test.","summary":"Retrieving test by ID","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"description":"A UUID string identifying this test.","required":true}],"tags":["Tests"],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2TestDetails"}}},"description":""},"401":{"description":"Authentication credentials were missing or invalid."},"404":{"description":"Resource not found."}}}}}}
```

## Retrieve a test by its ID and remove it

> Remove a test.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Tests","description":"Retrieving tests"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}}},"paths":{"/api/v2/tests/{id}/":{"delete":{"operationId":"v2_tests_destroy","description":"Remove a test.","summary":"Retrieve a test by its ID and remove it","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"description":"A UUID string identifying this test.","required":true}],"tags":["Tests"],"responses":{"204":{"description":"No response body"},"401":{"description":"Authentication credentials were missing or invalid."},"404":{"description":"Resource not found."}}}}}}
```

## Retrieve a test by its ID and update details

> Updates test details.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Tests","description":"Retrieving tests"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"PatchedV2TestCreate":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":255},"screenSizeType":{"enum":["desktop","mobile","custom"],"type":"string","description":"* `desktop` - Desktop\n* `mobile` - Mobile\n* `custom` - Custom"},"notes":{"type":["string","null"],"title":"Test notes"},"folderId":{"type":["string","null"],"format":"uuid"},"tags":{"type":"array","items":{"type":"string","maxLength":64},"writeOnly":true,"maxItems":64},"tagIds":{"type":"array","items":{"type":"string","format":"uuid"},"writeOnly":true,"maxItems":64}}},"V2TestDetails":{"type":"object","properties":{"folderId":{"type":["string","null"],"format":"uuid"},"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","maxLength":255},"tags":{"type":"array","items":{"$ref":"#/components/schemas/V2Tag"},"readOnly":true},"groups":{"type":"string","readOnly":true},"notes":{"type":["string","null"],"readOnly":true,"title":"Test notes"},"screenSizeType":{"enum":["desktop","mobile","custom"],"type":"string","description":"* `desktop` - Desktop\n* `mobile` - Mobile\n* `custom` - Custom","readOnly":true},"webappUrl":{"type":"string","readOnly":true}},"required":["groups","id","notes","screenSizeType","tags","webappUrl"]},"V2Tag":{"type":"object","properties":{"color":{"type":"string","readOnly":true},"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","readOnly":true}},"required":["color","id","name"]}}},"paths":{"/api/v2/tests/{id}/":{"patch":{"operationId":"v2_tests_partial_update","description":"Updates test details.","summary":"Retrieve a test by its ID and update details","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"description":"A UUID string identifying this test.","required":true}],"tags":["Tests"],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/PatchedV2TestCreate"}},"application/json":{"schema":{"$ref":"#/components/schemas/PatchedV2TestCreate"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2TestDetails"}}},"description":""},"400":{"description":"Request body failed validation."},"401":{"description":"Authentication credentials were missing or invalid."},"404":{"description":"Resource not found."}}}}}}
```

## Detach a component from a test and keep a copy of its steps

> Replaces the component in this test with a plain group holding a copy of its steps. The component and other tests are not changed. To remove the steps instead, use remove-component.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Tests","description":"Retrieving tests"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"V2ComponentInTest":{"type":"object","properties":{"componentId":{"type":"string","format":"uuid","description":"Component instance ID in this test (the group `id`), or the component ID (`originGroupId`)."}},"required":["componentId"]},"V2TestDetails":{"type":"object","properties":{"folderId":{"type":["string","null"],"format":"uuid"},"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","maxLength":255},"tags":{"type":"array","items":{"$ref":"#/components/schemas/V2Tag"},"readOnly":true},"groups":{"type":"string","readOnly":true},"notes":{"type":["string","null"],"readOnly":true,"title":"Test notes"},"screenSizeType":{"enum":["desktop","mobile","custom"],"type":"string","description":"* `desktop` - Desktop\n* `mobile` - Mobile\n* `custom` - Custom","readOnly":true},"webappUrl":{"type":"string","readOnly":true}},"required":["groups","id","notes","screenSizeType","tags","webappUrl"]},"V2Tag":{"type":"object","properties":{"color":{"type":"string","readOnly":true},"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","readOnly":true}},"required":["color","id","name"]}}},"paths":{"/api/v2/tests/{id}/detach-component/":{"post":{"operationId":"v2_tests_detach_component_create","description":"Replaces the component in this test with a plain group holding a copy of its steps. The component and other tests are not changed. To remove the steps instead, use remove-component.","summary":"Detach a component from a test and keep a copy of its steps","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"description":"A UUID string identifying this test.","required":true}],"tags":["Tests"],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/V2ComponentInTest"}},"application/json":{"schema":{"$ref":"#/components/schemas/V2ComponentInTest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2TestDetails"}}},"description":""},"400":{"description":"Request body failed validation."},"401":{"description":"Authentication credentials were missing or invalid."},"404":{"description":"Resource not found."}}}}}}
```

## Insert a component into a test by test ID

> Insert a component into a test. Prefer componentId. The legacy groupId field is still accepted and must contain the component relation ID returned by the components endpoint.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Tests","description":"Retrieving tests"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"V2InsertComponent":{"type":"object","properties":{"groupId":{"type":"string","format":"uuid"},"componentId":{"type":"string","format":"uuid","writeOnly":true},"atIndex":{"type":["integer","null"]}}},"V2TestDetails":{"type":"object","properties":{"folderId":{"type":["string","null"],"format":"uuid"},"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","maxLength":255},"tags":{"type":"array","items":{"$ref":"#/components/schemas/V2Tag"},"readOnly":true},"groups":{"type":"string","readOnly":true},"notes":{"type":["string","null"],"readOnly":true,"title":"Test notes"},"screenSizeType":{"enum":["desktop","mobile","custom"],"type":"string","description":"* `desktop` - Desktop\n* `mobile` - Mobile\n* `custom` - Custom","readOnly":true},"webappUrl":{"type":"string","readOnly":true}},"required":["groups","id","notes","screenSizeType","tags","webappUrl"]},"V2Tag":{"type":"object","properties":{"color":{"type":"string","readOnly":true},"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","readOnly":true}},"required":["color","id","name"]}}},"paths":{"/api/v2/tests/{id}/insert-component/":{"post":{"operationId":"v2_tests_insert_component_create","description":"Insert a component into a test. Prefer componentId. The legacy groupId field is still accepted and must contain the component relation ID returned by the components endpoint.","summary":"Insert a component into a test by test ID","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"description":"A UUID string identifying this test.","required":true}],"tags":["Tests"],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/V2InsertComponent"}},"application/json":{"schema":{"$ref":"#/components/schemas/V2InsertComponent"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2TestDetails"}}},"description":""},"400":{"description":"Request body failed validation."},"401":{"description":"Authentication credentials were missing or invalid."},"404":{"description":"Resource not found."}}}}}}
```

## Remove a component from a test

> Removes the component and its steps from the test. The component and other tests are not changed. To keep the steps in the test, use detach-component.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Tests","description":"Retrieving tests"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"V2ComponentInTest":{"type":"object","properties":{"componentId":{"type":"string","format":"uuid","description":"Component instance ID in this test (the group `id`), or the component ID (`originGroupId`)."}},"required":["componentId"]},"V2TestDetails":{"type":"object","properties":{"folderId":{"type":["string","null"],"format":"uuid"},"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","maxLength":255},"tags":{"type":"array","items":{"$ref":"#/components/schemas/V2Tag"},"readOnly":true},"groups":{"type":"string","readOnly":true},"notes":{"type":["string","null"],"readOnly":true,"title":"Test notes"},"screenSizeType":{"enum":["desktop","mobile","custom"],"type":"string","description":"* `desktop` - Desktop\n* `mobile` - Mobile\n* `custom` - Custom","readOnly":true},"webappUrl":{"type":"string","readOnly":true}},"required":["groups","id","notes","screenSizeType","tags","webappUrl"]},"V2Tag":{"type":"object","properties":{"color":{"type":"string","readOnly":true},"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","readOnly":true}},"required":["color","id","name"]}}},"paths":{"/api/v2/tests/{id}/remove-component/":{"post":{"operationId":"v2_tests_remove_component_create","description":"Removes the component and its steps from the test. The component and other tests are not changed. To keep the steps in the test, use detach-component.","summary":"Remove a component from a test","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"description":"A UUID string identifying this test.","required":true}],"tags":["Tests"],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/V2ComponentInTest"}},"application/json":{"schema":{"$ref":"#/components/schemas/V2ComponentInTest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2TestDetails"}}},"description":""},"400":{"description":"Request body failed validation."},"401":{"description":"Authentication credentials were missing or invalid."},"404":{"description":"Resource not found."}}}}}}
```

## Replace test tags

> Replaces tags assigned to the test. Tag names that do not exist yet are created in the project with a default color.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Tests","description":"Retrieving tests"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"V2TagAssignmentsUpdate":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string","maxLength":64},"maxItems":64},"tagIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":64}}},"V2Tag":{"type":"object","properties":{"color":{"type":"string","readOnly":true},"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","readOnly":true}},"required":["color","id","name"]}}},"paths":{"/api/v2/tests/{id}/tags/":{"put":{"operationId":"v2_tests_tags_update","description":"Replaces tags assigned to the test. Tag names that do not exist yet are created in the project with a default color.","summary":"Replace test tags","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"description":"A UUID string identifying this test.","required":true}],"tags":["Tests"],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/V2TagAssignmentsUpdate"}},"application/json":{"schema":{"$ref":"#/components/schemas/V2TagAssignmentsUpdate"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/V2Tag"}}}},"description":""},"400":{"description":"Request body failed validation."},"401":{"description":"Authentication credentials were missing or invalid."},"404":{"description":"Resource not found."}}}}}}
```

## Remove a component from a test (deprecated)

> Deprecated, use remove-component. Removes the component and its steps from the test. Requires the component instance ID in this test. The component and other tests are not changed.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Tests","description":"Retrieving tests"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"UnlinkComponent":{"type":"object","properties":{"groupId":{"type":"string","format":"uuid"}},"required":["groupId"]},"V2TestDetails":{"type":"object","properties":{"folderId":{"type":["string","null"],"format":"uuid"},"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","maxLength":255},"tags":{"type":"array","items":{"$ref":"#/components/schemas/V2Tag"},"readOnly":true},"groups":{"type":"string","readOnly":true},"notes":{"type":["string","null"],"readOnly":true,"title":"Test notes"},"screenSizeType":{"enum":["desktop","mobile","custom"],"type":"string","description":"* `desktop` - Desktop\n* `mobile` - Mobile\n* `custom` - Custom","readOnly":true},"webappUrl":{"type":"string","readOnly":true}},"required":["groups","id","notes","screenSizeType","tags","webappUrl"]},"V2Tag":{"type":"object","properties":{"color":{"type":"string","readOnly":true},"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","readOnly":true}},"required":["color","id","name"]}}},"paths":{"/api/v2/tests/{id}/unlink-component/":{"post":{"operationId":"v2_tests_unlink_component_create","description":"Deprecated, use remove-component. Removes the component and its steps from the test. Requires the component instance ID in this test. The component and other tests are not changed.","summary":"Remove a component from a test (deprecated)","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"description":"A UUID string identifying this test.","required":true}],"tags":["Tests"],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/UnlinkComponent"}},"application/json":{"schema":{"$ref":"#/components/schemas/UnlinkComponent"}}},"required":true},"deprecated":true,"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2TestDetails"}}},"description":""},"400":{"description":"Request body failed validation."},"401":{"description":"Authentication credentials were missing or invalid."},"404":{"description":"Resource not found."}}}}}}
```

## Move a group to a different position

> Move a group or component to a new zero-based position within a test. \`groupId\` is the test-group relation ID returned in the test's \`groups\[].id\`. An \`atIndex\` past the end moves the group to the last position.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Tests","description":"Retrieving tests"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"V2UpdateGroupPosition":{"type":"object","properties":{"groupId":{"type":"string","format":"uuid"},"atIndex":{"type":"integer","minimum":0}},"required":["atIndex","groupId"]}}},"paths":{"/api/v2/tests/{id}/update-group-position/":{"post":{"operationId":"v2_tests_update_group_position_create","description":"Move a group or component to a new zero-based position within a test. `groupId` is the test-group relation ID returned in the test's `groups[].id`. An `atIndex` past the end moves the group to the last position.","summary":"Move a group to a different position","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"description":"A UUID string identifying this test.","required":true}],"tags":["Tests"],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/V2UpdateGroupPosition"}},"application/json":{"schema":{"$ref":"#/components/schemas/V2UpdateGroupPosition"}}},"required":true},"responses":{"200":{"description":"No response body"},"400":{"description":"Request body failed validation."},"401":{"description":"Authentication credentials were missing or invalid."},"404":{"description":"Resource not found."}}}}}}
```

## Move a step to a different position or group

> Update the position of a step within a test.

```json
{"openapi":"3.1.0","info":{"title":"BugBug.io Public API","version":"v2"},"tags":[{"name":"Tests","description":"Retrieving tests"}],"security":[{"tokenAuth":[]},{"Bearer":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"V2UpdateStepPosition":{"type":"object","properties":{"stepId":{"type":"string","format":"uuid"},"groupId":{"type":"string","format":"uuid"},"atIndex":{"type":"integer"},"blockId":{"type":["string","null"],"format":"uuid"}},"required":["stepId"]}}},"paths":{"/api/v2/tests/{id}/update-step-position/":{"post":{"operationId":"v2_tests_update_step_position_create","description":"Update the position of a step within a test.","summary":"Move a step to a different position or group","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"description":"A UUID string identifying this test.","required":true}],"tags":["Tests"],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/V2UpdateStepPosition"}},"application/json":{"schema":{"$ref":"#/components/schemas/V2UpdateStepPosition"}}},"required":true},"responses":{"200":{"description":"No response body"},"400":{"description":"Request body failed validation."},"401":{"description":"Authentication credentials were missing or invalid."},"404":{"description":"Resource not found."}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.bugbug.io/public-api-reference/tests.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
