---
title: "Send a test event"
method: POST
path: "/sites/{site}/test-events"
tags: ["Tracking"]
---

# Send a test event

`POST /sites/{site}/test-events`

## Request

- Base URL: `https://api.onelence.com/v1`
- URL: `https://api.onelence.com/v1/sites/{site}/test-events`
- Auth: one of:
  - OAuth 2 (authorization code, authorization URL `https://api.onelence.com/oauth/authorize`, token URL `https://api.onelence.com/oauth/token`, scopes: `tracking:write`)
  - HTTP bearer

Sends one test event for a site through the same ingest path as its tracking, flagged internal like staff and QA traffic (it can still show in the events list). Then verify tracking with that event name: if it arrives, ingest accepts the site and its key. It does not show that the site's own pages send events. Default event name ol_test_event.

## Path parameters

- `site` string, required

## Query parameters

- `dry_run` boolean

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `event_name` string: Default ol_test_event.

## Response `200`

With dry_run=true: what would change. Nothing is applied.

- Preview
  - `object` 'preview', required
  - `capability` string, required
  - `summary` object, required
    - `title` string, required
    - `details` string[], required

## Other responses

- `201`: Success.
- `400`: Invalid input; `error.param` names the field.
- `401`: Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.
- `402`: subscription_required or upgrade_required; the error carries billing_url.
- `403`: insufficient_scope or admin_required.
- `404`: Unknown endpoint, site, source or record.
- `409`: A request with this Idempotency-Key is still running.
- `422`: This Idempotency-Key was already used for a different request.
- `429`: Rate limited. Retry after Retry-After seconds.
- `500`: OneLence could not complete the request.

---

[API](https://skmtc.dev/onelence/apis/onelence-api.md) · [All operations](https://skmtc.dev/onelence/apis/onelence-api/llms.txt) · [OpenAPI document](https://skmtc.dev/onelence/apis/onelence-api/revisions/971c72fe9a42?raw)
