> ## 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

<Steps>
  <Step title="Navigate to Settings">
    Go to **Settings** > **Integrations and API Keys** from the sidebar.
  </Step>

  <Step title="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.
  </Step>

  <Step title="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.
  </Step>

  <Step title="Run Tests">
    Execute your automated tests. Results will automatically appear in your **Test Runs** dashboard alongside manual test runs.
  </Step>
</Steps>

## 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).
</Warning>

## 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](/settings/usage-billing) for details.
</Note>

## What's Next?

<CardGroup cols={2}>
  <Card title="View Test Runs" icon="play-circle" href="/ui/running-tests">
    See your automated test results alongside manual runs
  </Card>

  <Card title="Usage & Billing" icon="coins" href="/settings/usage-billing">
    Monitor API usage and coin consumption
  </Card>
</CardGroup>
