# List what an import left out

`GET /api/v1/imports/{accountImport}/report` and `QUERY /api/v1/imports/{accountImport}/report`

List the records of the file that did not come over, and why.

Some are known as soon as the file is read, such as a reminder for a date that has passed. The rest are known once the import has ended.

This endpoint answers GET and QUERY alike, and both return the same answer. GET sends the parameters in the address, QUERY in the request body. [How QUERY works](https://friends.ban.is/docs/api/query-method).

## Parameters

- `accountImport` (uuid, required): The id of the import. One belonging to another account answers 404.
- `page` (integer, optional, defaults to 1): Which page to answer with.
- `per_page` (integer, optional, defaults to 25): How many records one page holds, between 1 and 100. A number outside the range is brought back into it rather than refused.

## Returns

A page of the records left out, in the order the file is written. An import of another account answers 404.

- `data` (array): The records left out on this page. An empty list rather than an error when there are none.
- `data[]` (object): One record left out.
- `data[].type` (string): Always account_import_item. It names the kind of record, so a caller holding several kinds can tell them apart without looking at where they came from.
- `data[].id` (string): The id of this record, as a string even when it reads as a number. It is what every endpoint naming this record takes.
- `data[].attributes` (object): Everything the record holds.
- `data[].attributes.kind` (string): The kind of record: contact, file, reminder, life_event, relationship and so on.
- `data[].attributes.source_uuid` (string): The id of the record in the file, or null when the file gives it none.
- `data[].attributes.reason` (string): Why it did not come over, as a sentence in the language of whoever asks.
- `meta` (object): Where you are in the collection.
- `meta.page` (integer): The page this is, counting from 1.
- `meta.per_page` (integer): How many one page holds, which is the size that was asked for once it has been brought into the allowed range.
- `meta.total` (integer): How many records left out there are in all, not how many are on this page.

## Status codes

| Code | When | Body |
| --- | --- | --- |
| `422` Unprocessable Content | With QUERY, a parameter was sent both in the address and in the body. | A message, and an errors object naming each parameter sent twice. |

## Rate limit

Sixty requests per minute, per user, shared by every key and device. Every answer carries the budget left in `X-RateLimit-Remaining`.

## Request

```sh
curl https://friends.ban.is/api/v1/imports/3f8a1c52-7d4e-4b19-9a06-c2e5b8d71f40/report?page=2&per_page=10 \
  -H "Authorization: Bearer $MONICA_TOKEN"
```

```javascript
const response = await fetch('https://friends.ban.is/api/v1/imports/3f8a1c52-7d4e-4b19-9a06-c2e5b8d71f40/report?page=2&per_page=10', {
  headers: { Authorization: `Bearer ${token}` },
})
const data = await response.json()
```

```php
$response = Http::withToken($token)->get('https://friends.ban.is/api/v1/imports/3f8a1c52-7d4e-4b19-9a06-c2e5b8d71f40/report?page=2&per_page=10');
```

## Request with QUERY

```sh
curl https://friends.ban.is/api/v1/imports/3f8a1c52-7d4e-4b19-9a06-c2e5b8d71f40/report \
  -X QUERY \
  -H "Authorization: Bearer $MONICA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
      "page": 2,
      "per_page": 10
  }'
```

```javascript
const response = await fetch('https://friends.ban.is/api/v1/imports/3f8a1c52-7d4e-4b19-9a06-c2e5b8d71f40/report', {
  method: 'QUERY',
  headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    page: 2,
    per_page: 10,
  }),
})
const data = await response.json()
```

```php
$response = Http::withToken($token)->query('https://friends.ban.is/api/v1/imports/3f8a1c52-7d4e-4b19-9a06-c2e5b8d71f40/report', [
    'page' => 2,
    'per_page' => 10,
]);
```

## Response

`200`

```json
{
    "data": [
        {
            "type": "account_import_item",
            "id": "418",
            "attributes": {
                "kind": "reminder",
                "source_uuid": "30000000-0000-4000-8000-000000000001",
                "reason": "A reminder for a single date that has already passed."
            }
        }
    ],
    "meta": {
        "page": 1,
        "per_page": 25,
        "total": 1
    }
}
```
