---
title: "Fire a test alert"
method: POST
path: "/alert-sources/{source}/test"
tags: ["Alert sources"]
---

# Fire a test alert

`POST /alert-sources/{source}/test`

## Request

- Base URL: `https://api.spectate.net/v1`
- URL: `https://api.spectate.net/v1/alert-sources/{source}/test`
- Auth: HTTP bearer

Fires an alert on the source that escalates like a real one (it notifies people) and
resolves itself after a few minutes. Returns the event it made.

## Path parameters

- `source` string, uuid, required

## Response `200`

The test event.

- AlertSourceEvent: A request an alert source received, kept for 7 days.
  - `id` string, uuid, required: Event ID
  - `received_at` string, date-time, required: When the request arrived
  - `outcome` 'fired' | 'resolved' | 'updated' | 'test' | 'ignored' | 'rejected', required: What became of a request an alert source received. | | |---| | `fired` <br/> It fired at least one new alert. | | `resolved` <br/> It resolved at least one alert. | | `updated` <br/> It repeated alerts that were already firing. | | `test` <br/> A test request from the tool's own "test" button; no alert. | | `ignored` <br/> Valid, but nothing to do (for example a resolve of an alert that isn't firing). | | `rejected` <br/> Refused: bad signature, unreadable payload or a disabled source; see `error`. |
  - `summary` string, nullable, required: What happened, in words
  - `error` string, nullable, required: Why it was rejected, with `outcome` `rejected`
  - `alerts` AlertSourceEventAlert[], required: What it did per alert
    - `action` 'fired' | 'updated' | 'resolved' | 'ignored', required: What a request did to one alert. | | |---| | `fired` <br/> A new alert fired. | | `updated` <br/> The alert was already firing; it was updated. | | `resolved` <br/> The alert resolved. | | `ignored` <br/> A resolve for an alert that wasn't firing. |
    - `title` string, required: The alert's title
    - `dedupe_key` string, required: The key the tool groups repeats by; requests with the same key update one alert
    - `alert_id` string, uuid, nullable, required: The alert; `null` when none was touched
  - `payload` object, nullable, required: The request body as received: the tool's JSON, or `{body, truncated}` for mail and non-JSON bodies. Its shape is the tool's

## Other responses

- `401`: `UNAUTHENTICATED`: no token was sent. `INVALID_TOKEN`: the token is unknown or revoked. `TOKEN_EXPIRED`: the token has expired.
- `403`: `FORBIDDEN`: the token lacks an ability this endpoint requires (listed in `details.required_abilities`). `TEAM_PENDING_DELETION`: the team is scheduled for deletion. `TEAM_SUSPENDED`: Spectate suspended the team.
- `404`: `RESOURCE_NOT_FOUND`: there is no such resource in this team.
- `429`: `RATE_LIMITED`: too many requests for this token. Wait for the number of seconds in `Retry-After`.

---

[API](https://skmtc.dev/spectate/apis/spectate-api.md) - [All operations](https://skmtc.dev/spectate/apis/spectate-api/llms.txt) - [OpenAPI document](https://skmtc.dev/spectate/apis/spectate-api/revisions/9b1a233997de?raw)
