> ## Documentation Index
> Fetch the complete documentation index at: https://docs.argyle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Reports

> Learn about the /reports endpoint.

Learn about the `/reports` endpoint.

<Accordion title="Possible values:">
  Report objects contains information related to reports generated for a user, including:

  * [Verification of Income and Employment (VOIE) reports](https://res.cloudinary.com/argyle-media/image/upload/v1676576744/docs-2022/References/Employment%20Data/Reports/Landing%20Page/example_VOIE.pdf)
  * [Verification of Employment (VOE) reports](https://res.cloudinary.com/argyle-media/image/upload/v1676576750/docs-2022/References/Employment%20Data/Reports/Landing%20Page/example_VOE.pdf)
</Accordion>

Reports are generated on request and are based on data available from payroll providers.

![High level structure of the reports object.](https://res.cloudinary.com/argyle-media/image/upload/f_auto/v1674859044/docs-2023/API%20Endpoints/Reports)

## The report object

### Attributes

* `id` (string (uuid), optional): Unique ID of the report object.
* `user` (string (uuid), optional): A unique ID assigned to a user.
* `(Deprecated) reference_id` (string, optional): Unique ID of the report referenced on the PDF.
* `generated_at` (string (timestamp), optional): Shows the date and time when the report was generated.
* `type` (note, optional)

```json theme={}

{
"id": "9f82994c-774d-11eb-b1c7-13e87316bacb",
"user": "8a5f613a-673a-4434-aeee-1a38b960b936",
"reference_id": "9f82994c-774d-11eb-b1c7-13e87316bacb",
"generated_at": "2020-11-29T08:33:41.525Z",
"type": "voie",
"status": "generated",
"file_url": "www.company.com/voie_report.pdf",
"metadata": {
"purpose": "Risk Assesment"
}
},
null,
2
  
```

<RefSubLayout.Divider />

## Generate a report

**POST** `/v1/reports`

* Generate a report of the desired type for the specified user.
* This request returns a report object if a valid user was provided.

### Request body

* `user` (string (uuid), required): Unique user ID.
* `metadata` (object, required)

<Tabs>
  <Tab title="curl">
    ```bash theme={}
    curl --request POST \\
    --url https://api.argyle.com/v1/reports \\
    --header 'accept: application/json' \\
    --header 'content-type: application/json' \\
    --data '{
    "user": "8a5f613a-673a-4434-aeee-1a38b960b936",
    "type": "voie",
    "metadata": {
      "purpose": "Risk Assessment"
    }
    }'
    ```
  </Tab>

  <Tab title="python">
    ```python theme={}
    import requests
    url = "https://api.argyle.com/v1/reports"
    payload = {
    "user": "8a5f613a-673a-4434-aeee-1a38b960b936",
    "type": "voie",
    "metadata": {
    "purpose": "Risk Assessment"
    }
    }
    headers = {
    "accept": "application/json",
    "content-type": "application/json"
    }
    response = requests.post(url, json=payload, headers=headers)
    ```
  </Tab>
</Tabs>

```json theme={}

{
  "id": "b1347b20-c667-4250-9a99-2e1f17d28f11",
  "user": "8a5f613a-673a-4434-aeee-1a38b960b936",
  "reference_id": "b1347b20-c667-4250-9a99-2e1f17d28f11",
  "type": "voie",
  "status": "waiting_for_sync",
  "metadata": {
"purpose": "Risk Assessment"
  },
  "file_url": null,
  "created_at": "2022-04-22T16:25:05.289Z",
  "updated_at": "2022-04-22T16:25:05.289Z",
  "generated_at": null
},
null,
2
  
```

<RefSubLayout.Divider />

## Retrieve a report

**GET** `/v1/reports/{id}`

* Retrieve a report object for a supplied ID.
* This request returns a report object if a valid ID was provided.

### Path parameters

* `id` (string (uuid), required): The identifier of the report to be retrieved.

<Tabs>
  <Tab title="curl">
    ```bash theme={}
    curl --request GET \\
    --url https://api.argyle.com/v1/reports/{id} \\
    --header 'accept: application/json' \\
    --header 'content-type: application/json'
      
    ```
  </Tab>

  <Tab title="python">
    ```python theme={}
    import requests
    url = "https://api.argyle.com/v1/reports/{id}"
    headers = {
    "accept": "application/json",
    "content-type": "application/json"
    }
    response = requests.get(url, headers=headers)
    ```
  </Tab>
</Tabs>

```json theme={}

{
  "id": "b1347b20-c667-4250-9a99-2e1f17d28f11",
  "reference_id": "b1347b20-c667-4250-9a99-2e1f17d28f11",
  "generated_at": null,
  "type": "voie",
  "user": "8a5f613a-673a-4434-aeee-1a38b960b936",
  "status": "waiting_for_sync",
  "file_url": null,
  "metadata": {
"purpose": "Risk Assessment"
  }
},
null,
2
  
```

<RefSubLayout.Divider />

## List reports

**GET** `/v1/reports`

* List all reports.
* This request returns a list of all reports generated.

### Query parameters

<Tabs>
  <Tab title="curl">
    ```bash theme={}
    curl --request GET \\
    --url https://api.argyle.com/v1/reports?limit=2 \\
    --header 'accept: application/json' \\
    --header 'content-type: application/json'
      
    ```
  </Tab>

  <Tab title="python">
    ```python theme={}
    import requests
    url = "https://api.argyle.com/v1/reports?limit=2"
    headers = {
    "accept": "application/json",
    "content-type": "application/json"
    }
    response = requests.get(url, headers=headers)
    ```
  </Tab>
</Tabs>

```json theme={}

[
  {
"id": "8ecbc2d2-d2cb-4134-8dcd-739cf36baa75",
"reference_id": "8ecbc2d2-d2cb-4134-8dcd-739cf36baa75",
"generated_at": null,
"type": "voie",
"user": "8a5f613a-673a-4434-aeee-1a38b960b936",
"status": "waiting_for_sync",
"file_url": null,
"metadata": {
  "purpose": ""
}
  },
  {
"id": "b1347b20-c667-4250-9a99-2e1f17d28f11",
"reference_id": "b1347b20-c667-4250-9a99-2e1f17d28f11",
"generated_at": null,
"type": "voie",
"user": "8a5f613a-673a-4434-aeee-1a38b960b936",
"status": "waiting_for_sync",
"file_url": null,
"metadata": {
  "purpose": "Risk Assessment"
}
  }
],
null,
2
  
```
