# 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":{"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","maxLength":255}},"required":["id"]}}},"paths":{"/api/v2/tests/":{"get":{"operationId":"v2_tests_list","description":"Returns many tests.","summary":"Retrieving tests list","parameters":[{"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"}],"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"}}},"V2TestDetails":{"type":"object","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","maxLength":255},"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}},"required":["groups","id","notes","screenSizeType"]}}},"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":{"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","maxLength":255},"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}},"required":["groups","id","notes","screenSizeType"]}}},"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"}}},"V2TestDetails":{"type":"object","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","maxLength":255},"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}},"required":["groups","id","notes","screenSizeType"]}}},"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."}}}}}}
```

## Insert a component into a test by test ID

> Insert a component into 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":{"InsertGroup":{"type":"object","properties":{"groupId":{"type":"string","format":"uuid"},"atIndex":{"type":["integer","null"]}},"required":["groupId"]},"V2TestDetails":{"type":"object","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","maxLength":255},"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}},"required":["groups","id","notes","screenSizeType"]}}},"paths":{"/api/v2/tests/{id}/insert-component/":{"post":{"operationId":"v2_tests_insert_component_create","description":"Insert a component into a test.","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/InsertGroup"}},"application/json":{"schema":{"$ref":"#/components/schemas/InsertGroup"}}},"required":true},"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."}}}}}}
```

## Unlink a component from a test by test ID

> Unlink a component from 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":{"UnlinkComponent":{"type":"object","properties":{"groupId":{"type":"string","format":"uuid"}},"required":["groupId"]},"V2TestDetails":{"type":"object","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","maxLength":255},"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}},"required":["groups","id","notes","screenSizeType"]}}},"paths":{"/api/v2/tests/{id}/unlink-component/":{"post":{"operationId":"v2_tests_unlink_component_create","description":"Unlink a component from a test.","summary":"Unlink a component from 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/UnlinkComponent"}},"application/json":{"schema":{"$ref":"#/components/schemas/UnlinkComponent"}}},"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."}}}}}}
```

## 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: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
