<!-- https://developers.silktide.com/v1/governance/content/get-contents | Governance / Content -->

# List the pages and documents Silktide tested

`GET /v1/results/contents`

Lists every page and document Silktide tested on a website or one of its
sections, a page of rows at a time. See [Content](https://developers.silktide.com/v1/concepts/content.md) for
what counts as each.

The list is more than the pages a visitor would browse to. It includes error
pages (look at `httpCode`), documents linked from the website but hosted on
another domain, and the pages user flows reached, which have a `flowId` above
`0`. The same URL can appear once crawled and once more for each flow step
that visited it.

Leave out `websiteId` to list the content of every website the API key's user
can see, together.

This query takes `page` and `rowsPerPage` (see
[Pagination](https://developers.silktide.com/v1/concepts/pagination.md)) but none of the table arguments:
`columns`, `sort` and `search` are ignored. The rows come in no useful order;
sort by `defaultOrder` to list them the way Silktide does.

A `page` or `rowsPerPage` that is not a whole number of at least `1` is an
`InvalidRequest` error whose `properties.field` names the argument. It comes
with status `200`, like every results error, so check for `error` before
reading `result`.

## Request

### Query parameters

- `websiteId` (integer, optional, at least 1): The website. Left out, every website the API key's user can see.
- `sectionId` (integer, optional): With `websiteId`, a section of the website. Defaults to `0`, the whole website.
- `page` (integer, optional, at least 1): The page of rows to return, from `1`. Defaults to `1`.
- `rowsPerPage` (integer, optional, at least 1): How many rows a page holds. Defaults to `100`. Must be at least `1`.

## Response

Status `200`.

- `result` (object, required): The answer.
  - `contents` (object, required): One page of the website's pages and documents.
    - `page` (integer, required, at least 1): The page returned. A page past the last returns the last, so this is not always the page asked for.
    - `minPage` (integer, required, at least 1): The first page. Always `1`.
    - `maxPage` (integer, required, at least 1): The last page at this `rowsPerPage`. `1` when there are no rows.
    - `numRows` (integer, required): How many rows there are across every page.
    - `rowsPerPage` (integer, required, at least 1): How many rows a page holds.
    - `rows` (list of objects, required): The rows on this page.
      - `acId` (string, required): Its id in the account. It stays the same while the website and URL do.
      - `url` (string, required): Its URL. A document linked from the website can be on another domain.
      - `title` (string, required): Its title: a page's `<title>`, or a document's title or file name. `Untitled` when a document has neither.
      - `contentType` (string, required): What it is: `html` for a page, `pdf` for a PDF document. Silktide tests no other kind today. One of: `html`, `pdf`, `text`, `word`, `excel`, `powerpoint`, `other`.
      - `httpCode` (integer, required, can be null): The HTTP status it answered with when last downloaded. Null when none was recorded.
      - `mimeType` (string, required): Its content type as the server sent it, such as `text/html`.
      - `downloaded` (integer, required): When Silktide last downloaded it.
      - `discovered` (integer, required): When Silktide first downloaded it.
      - `defaultOrder` (string, required): Sort by this, ascending, to list content in the order Silktide does. Its format can change; only compare it.
      - `flowId` (integer, required): The user flow it was reached by, or `0` when it was crawled.
      - `stepNo` (integer, required): In a user flow, its step, from `0`. `0` when it was crawled.
      - `isFailedStep` (boolean, required): True when it is the step at which its user flow failed.
- `selector` (string, required): The query that answered, as its path: `/v1/results/scores`.
- `duration` (number, required): Seconds Silktide took to answer.

## Errors

| Status | Type | When |
| --- | --- | --- |
| 404 | `ModelNotFound` | No website or section with that id exists in the account, or the API key's user cannot see it. |
| 200 | `InvalidRequest` | `page` is not a whole number of at least `1`. The error's own `status` is `400` and `properties.field` is `page`. The body is an error despite the status. |
| 200 | `InvalidRequest` | `rowsPerPage` is not a whole number of at least `1`. The error's own `status` is `400` and `properties.field` is `rowsPerPage`. The body is an error despite the status. |
| 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: any user of the account
- Plan feature: none
- Edition: Silktide 4 and Silktide 5
- Cost: free
- Stability: stable, since 1.0.0

## Example: The first two pages and documents of a website

```bash
curl "https://api.eu.silktide.com/v1/results/contents?websiteId=3&rowsPerPage=2" \
  -H "Authorization: silktide token=$SILKTIDE_API_KEY"
```

Response:

```json
{
  "result": {
    "contents": {
      "page": 1,
      "minPage": 1,
      "maxPage": 28,
      "numRows": 56,
      "rowsPerPage": 2,
      "rows": [
        {
          "acId": "0106ed17299002688a08a0f794aa8eae",
          "url": "https://fakewinebarrel.com/wines-are-confusing/",
          "title": "Wines: easily confused with hamburgers - Wine Barrel",
          "contentType": "html",
          "httpCode": 200,
          "mimeType": "text/html",
          "downloaded": 1791424671,
          "discovered": 1790223215,
          "defaultOrder": "202-047-047",
          "flowId": 0,
          "stepNo": 0,
          "isFailedStep": false
        },
        {
          "acId": "1f3c0a9d5b7e4c2a8d6f0b1e3a5c7d9f",
          "url": "https://example.com/files/wine-list-2026.pdf",
          "title": "Wine list 2026",
          "contentType": "pdf",
          "httpCode": 200,
          "mimeType": "application/pdf",
          "downloaded": 1790222921,
          "discovered": 1790222921,
          "defaultOrder": "207-065-085",
          "flowId": 0,
          "stepNo": 0,
          "isFailedStep": false
        }
      ]
    }
  },
  "selector": "/v1/results/contents",
  "duration": 0.005
}
```
