# POST /v3/search/subscriptions/{id}/test

Preview a search subscription: the payloads the subscription would have produced for filings accepted in the last 7 days (at most 5, newest first), as webhook envelopes with test: true; nothing is delivered or recorded. 503 callbacks_unavailable while this server has no callback key file or its database lacks the callback tables. 503 search_unavailable without full-text search.

**API key:** required. See [Authentication](https://www.secblast.com/docs/authentication).

**Group:** [Webhooks (API: callbacks)](https://www.secblast.com/docs/reference#webhooks-api-callbacks)

## Parameters

| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
| `id` | path | string | yes |   | The subscription's id (sub_ and 24 hex digits). |

## Request body

A [SearchSubscriptionTestRequest](https://www.secblast.com/docs/reference/schemas#schema-searchsubscriptiontestrequest) object, as JSON.

## Responses

| Status | Body | Description |
|---|---|---|
| `200` | [SearchSubscriptionTest](https://www.secblast.com/docs/reference/schemas#schema-searchsubscriptiontest) (`application/json`) | OK |
| `400` | [Problem](https://www.secblast.com/docs/reference/schemas#schema-problem) (`application/problem+json`) | Invalid or unknown parameter, or a body that is not one JSON document (code invalid_body). |
| `401` | [Problem](https://www.secblast.com/docs/reference/schemas#schema-problem) (`application/problem+json`) | Missing, invalid or inactive API key (code unauthorized), or a refused access token (code invalid_token: malformed, unknown key, bad signature, expired, wrong issuer or audience, revoked grant). WWW-Authenticate names the protected-resource metadata (RFC 9728). |
| `403` | [Problem](https://www.secblast.com/docs/reference/schemas#schema-problem) (`application/problem+json`) | The credential's scope does not cover this route (code forbidden). |
| `404` | [Problem](https://www.secblast.com/docs/reference/schemas#schema-problem) (`application/problem+json`) | Not found. |
| `415` | [Problem](https://www.secblast.com/docs/reference/schemas#schema-problem) (`application/problem+json`) | The body is not sent as Content-Type: application/json (code unsupported_media_type). |
| `503` | [Problem](https://www.secblast.com/docs/reference/schemas#schema-problem) (`application/problem+json`) | Full-text search cannot answer now: search_unavailable (sb_search unreachable or not configured), search_busy (its queue is full), search_timeout (the query hit its time budget), ticker_resolution_unavailable; or the database is unavailable. Retry after the Retry-After delay when one is given. |
| `default` | [Problem](https://www.secblast.com/docs/reference/schemas#schema-problem) (`application/problem+json`) | Any other error (405, 500, 504). |

## Response body

A `200` carries a [SearchSubscriptionTest](https://www.secblast.com/docs/reference/schemas#schema-searchsubscriptiontest) object.

| Field | Type | Required | Description |
|---|---|---|---|
| `data` | array of object | yes | The payloads the subscription would have produced for filings accepted in the last 7 days, newest first, each the webhook envelope with test: true: filing.new (filing, firehose; id new:\<subscription\>:\<accession\>) or search.match (search; id match:\<subscription\>:\<accession\>). Nothing is delivered. |

## Example request

```bash
curl -sS -X POST -H "Authorization: Bearer $SECBLAST_API_KEY" \
  -H "Content-Type: application/json" -d @body.json \
  'https://api.secblast.com/v3/search/subscriptions/sub_0123456789abcdef01234567/test'
```

## More in Webhooks (API: callbacks)

Previous: [`DELETE /v3/search/subscriptions/{id}`](https://www.secblast.com/docs/reference/delete-search-subscriptions-id)
