# Running via API

## Running via API

BugBug can be connected to CI/CD pipelines, deployment tools, and custom systems through Public API, CLI, or incoming webhooks.

Use this page to choose the right option. No need to over-engineer a webhook when a CLI command does the job.

### Public API

Use the Public API when you are building a custom integration and need programmatic control.

The Public API can list and manage tests and suites, start runs, check statuses, retrieve results, stop runs, download reports, export/import data, update settings, and manage visual regression reference screenshots.

Read more: Public API

### Swagger and Redoc

BugBug provides generated API documentation in two formats:

* Swagger: <https://api.bugbug.io/docs/swagger/?version=v2>
* Redoc: <https://api.bugbug.io/docs/redoc/?version=v2>

Authenticate requests with:

```http
Authorization: Token <api-token>
```

You can find your project API token in the **Integrations** page in the BugBug app.

### Command Line Interface

Use CLI when you need to run BugBug tests from CI/CD without writing a custom integration.

Read more: Command Line Interface

### Incoming webhooks

Use incoming webhooks when another tool only needs to trigger a test or suite with a single `POST` request.

Read more: Webhooks


---

# 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/running-tests/running-via-api.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.
