> ## Documentation Index
> Fetch the complete documentation index at: https://onetest.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrations and API Keys

> Configure API keys for CI/CD pipelines to push automated test results

Integrations and API Keys allow external tools like **ReportPortal agents**, **JUnit reporters**, and **CI/CD pipelines** to push test results directly into OneTest. They're fully compatible with the ReportPortal v2 API.

## Setting Up

**1. Navigate to Settings**

Go to **Settings** > **Integrations and API Keys** from the sidebar.

**2. Create an API Key**

Click **+ Add API Key**, give it a name (e.g., "CI Pipeline" or "Staging"), and save. The key is shown only once — copy it immediately.

**3. Configure Your Pipeline**

Use the generated API key in your CI/CD configuration:

```bash theme={null}
# ReportPortal Agent Configuration
RP_ENDPOINT=https://tms.onetest.ai/api/receiver
RP_PROJECT=<your-product-uuid>
RP_API_KEY=<your-api-key>
```

Your **Product UUID** is displayed on the Integrations and API Keys page and can be copied with one click.

**4. Run Tests**

Execute your automated tests. Results will automatically appear in your **Test Runs** dashboard alongside manual test runs.

## API Endpoints

OneTest provides ReportPortal v2 compatible endpoints:

| Endpoint | Description |
| - | - |
| `POST /api/v2/{product_uuid}/launch` | Start a new test launch |
| `POST /api/v2/{product_uuid}/item` | Report a test item |
| `POST /api/v2/{product_uuid}/log` | Add a log entry |
| `POST /api/v1/products/{product_uuid}/import/junit` | Import JUnit XML results |

## Managing API Keys

Each API key has:

* **Status** — Active or expired
* **Retention period** — How long test results are kept (default: 90 days)
* **Expiration date** — When the key expires
* **Allowed Scopes** — Granular permissions controlling which APIs this key can access
* **Last Active** — When the key was last used

You can **regenerate** or **delete** keys at any time. Deleting a key immediately revokes access for any pipelines using it.

> [!WARNING]
>
> API keys are shown only once when created. Store them securely in your CI/CD secrets (e.g., GitHub Secrets, GitLab CI Variables).

## JUnit XML Import

For frameworks that don't support ReportPortal agents, you can import JUnit XML files directly:

```bash theme={null}
curl -X POST "https://tms.onetest.ai/api/v1/products/{product_uuid}/import/junit" \
  -H "Authorization: Bearer {api_key}" \
  -F "file=@test-results.xml"
```

> [!NOTE]
>
> Each API call costs 1 coin from your weekly budget. Browser UI usage is always free. See [Usage & Billing](https://onetest.ai/settings/usage-billing.md) for details.

## What's Next?

> [card] [View Test Runs](https://onetest.ai/ui/running-tests.md)
>
> See your automated test results alongside manual runs

> [card] [Usage & Billing](https://onetest.ai/settings/usage-billing.md)
>
> Monitor API usage and coin consumption


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.