<!-- https://developers.silktide.com/v1/governance/websites/test-website | Governance / Websites -->

# Test a website now

`POST /v1/websites/{websiteId}/test`

Starts a test. With no body, Silktide retests the whole website, finding new
pages as it goes. With `urls`, it tests only those pages and does not look
for others.

The response is an empty `201` once the test is queued, not when it
finishes.

URLs outside the website's rules are skipped without an error. If none of
them fit, nothing is tested, and the response is still `201`.

A website runs at most three website or section tests at once; tests of
specific URLs do not count towards that. A fourth gets `403 AccessDenied`
until one finishes.

## Request

### Path parameters

- `websiteId` (integer, required, at least 1): The website.

### Body

- `urls` (list of strings, optional): Test only these pages, as full URLs, instead of the whole website. Pages it does not have yet are added if they fit its rules and its balance.

## Response

Status `201`.
 No body.

## Errors

| Status | Type | When |
| --- | --- | --- |
| 404 | `ModelNotFound` | Nothing with that id exists in the account, or the API key's user cannot see it. |
| 403 | `AccessDenied` | The API key's user cannot test this website, the account has no tests left, or the website already has too many tests running. |
| 401 | `NotLoggedIn` | No API key was sent, or it is not a key for this region. |
| 429 | `TooManyRequests` | Too many requests to this path in five seconds. Retry after the number of seconds in the `Retry-After` header, which `properties.retryAfter` repeats. |
| 503 | - | Silktide is busy. Retry after the number of seconds in the `Retry-After` header. |

## Access

- Permission: Can test this website
- Plan feature: none
- Edition: Silktide 4 and Silktide 5
- Cost: uses the account's allowance
- Stability: stable, since 1.0.0

## Example: Retest the whole website

```bash
curl -X POST "https://api.eu.silktide.com/v1/websites/2/test" \
  -H "Authorization: silktide token=$SILKTIDE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Example: Retest two pages

```bash
curl -X POST "https://api.eu.silktide.com/v1/websites/2/test" \
  -H "Authorization: silktide token=$SILKTIDE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "urls": [
    "https://example.com/",
    "https://example.com/blog/some-example-article"
  ]
}'
```
