# List the files in a backup

`GET /api/v1/artifacts/{artifact}/entries`

The backup's file index, 50 entries per page ordered by path. 503 while the index cannot be read from storage.

## Path Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| artifact | integer | yes | The ID of the backup. Example: `2291`. |

## Query Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| page | integer | no | The page to return. Pages hold 50 items. Default: `1`. Example: `2`. |

## Response

### 200

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| data | object[] | yes |  |
| data.path | string | yes | The entry's path inside the backup. |
| data.parent_path | string | yes | The folder that holds the entry. Nullable. |
| data.is_directory | boolean | yes |  |
| data.size_bytes | integer | yes | The file's size in bytes. |
| data.mtime | integer | yes | When the file was last modified, as a Unix timestamp in seconds. Nullable. |
| data.change_type | string | yes | What the backup recorded for the entry: `added`, `modified` or `deleted` since the earlier backup, `touched` (same content, new modification time) or `copied` (same content as another path of the earlier backup). Null when the backup does not say. Nullable. One of: `added`, `modified`, `deleted`, `touched`, `copied`, `null`. |
| data.owner | string | yes | The file's owner on the server, when the agent recorded it. Nullable. |
| data.group | string | yes | The file's group on the server, when the agent recorded it. Nullable. |
| data.uid | integer | yes | Nullable. |
| data.gid | integer | yes | Nullable. |
| data.mode | string | yes | The file's permissions as four octal digits. Nullable. |
| links | object | yes |  |
| links.first | string | yes | Nullable. |
| links.last | string | yes | Nullable. |
| links.prev | string | yes | Nullable. |
| links.next | string | yes | Nullable. |
| meta | object | yes |  |
| meta.current_page | integer | yes |  |
| meta.from | integer | yes | Nullable. |
| meta.last_page | integer | yes |  |
| meta.links | object[] | yes | Generated paginator links. |
| meta.links.url | string | yes | Nullable. |
| meta.links.label | string | yes |  |
| meta.links.page | integer | no | The page the link opens; null on a previous or next link with no page to open. Absent on a `...` gap. Nullable. |
| meta.links.active | boolean | yes |  |
| meta.path | string | yes | Base path for paginator generated URLs. Nullable. |
| meta.per_page | integer | yes | Number of items shown per page. |
| meta.to | integer | yes | Number of the last item in the slice. Nullable. |
| meta.total | integer | yes | Total number of items being paginated. |

### 401

The request carries no valid token: the `Authorization: Bearer` header is missing, or its token is unknown, revoked or past its expiry date. Send a current personal access token.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| message | string | yes | Always `Unauthenticated.`. |

### 403

The token may not read this. The `message` says why: `Your role does not permit this action.` (its owner is not an Admin, Operator or Viewer in the client), `This account is disabled.`, `This token is not bound to a client you belong to.`, or `Client suspended`.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| message | string | yes | What went wrong. |

### 404

Not found

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| message | string | yes | What went wrong. |

### 503

The backup's file index cannot be read from storage right now. Try again later.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| message | string | yes | What went wrong. |

## Request example

```bash
curl 'https://app.clokeep.com/api/v1/artifacts/2291/entries' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Accept: application/json'
```

## Response example (200)

```json
{
  "data": [
    {
      "path": "httpdocs/wp-config.php",
      "parent_path": "httpdocs",
      "is_directory": false,
      "size_bytes": 3412,
      "mtime": 1795122930,
      "change_type": "added",
      "owner": "example",
      "group": "example",
      "uid": 10001,
      "gid": 1001,
      "mode": "0644"
    }
  ],
  "links": {
    "first": "https://app.clokeep.com/api/v1/artifacts/2291/entries?page=1",
    "last": "https://app.clokeep.com/api/v1/artifacts/2291/entries?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "links": [
      {
        "url": null,
        "label": "&laquo; Previous",
        "page": null,
        "active": false
      },
      {
        "url": "https://app.clokeep.com/api/v1/artifacts/2291/entries?page=1",
        "label": "1",
        "page": 1,
        "active": true
      },
      {
        "url": null,
        "label": "Next &raquo;",
        "page": null,
        "active": false
      }
    ],
    "path": "https://app.clokeep.com/api/v1/artifacts/2291/entries",
    "per_page": 15,
    "to": 1,
    "total": 1
  }
}
```

## Response example (401)

```json
{
  "message": "Unauthenticated."
}
```

## Response example (403)

```json
{
  "message": "Your role does not permit this action."
}
```

## Response example (404)

```json
{
  "message": "No query results for model [App\\Models\\BackupArtifact] 2291"
}
```

## Response example (503)

```json
{
  "message": "The file list of this backup is unavailable: storage unreachable."
}
```
