# Retrieve a List of Visits

## Get Visits

<mark style="color:blue;">`GET`</mark> `https://api.w3lcome.com/v1/visits`

This endpoint allows you to get a list of visits

#### Query Parameters

| Name       | Type   | Description                                                                                                                                                           |
| ---------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| limit      | number | <p>The number of visits you want to retrieve<br><strong>Default: 500 - Min: 1 - Max: 1000</strong></p>                                                                |
| offset     | number | <p>The offset from the first visit. Used to paginate.<br><strong>Default: 0 - Min: 0 - Max: ∞</strong></p>                                                            |
| queryKey   | string | <p>Query by any queryable field in the visit object.<br><strong>Default: none</strong></p>                                                                            |
| queryOp    | string | <p>Add the type of the query.<br><strong>Default: none</strong><br>Accepted values: <code><</code> <code><=</code> <code>==</code> <code>></code> <code>>=</code></p> |
| queryValue | string | <p>Insert the value you want to query.<br><strong>Default: none</strong></p>                                                                                          |

#### Headers

| Name           | Type   | Description      |
| -------------- | ------ | ---------------- |
| Content-Type   | string | application/JSON |
| Authentication | string | Basic `token`    |

{% tabs %}
{% tab title="200 Success" %}

```javascript
{
    "visits": [
        {
            "id": "43d2895a-6785-4442-b065-d4c80d7825c8",
            "checkinAt": "2019-07-09T08:02:17-03:00",
            "checkoutAt": "2019-07-09T08:03:12-03:00",
            "isInsideCompany": false,
            "type": "visit",
            "name": "Alisson Enz",
            "company": "W3lcome",
            "host": {
                "id": "b98ff2895de825dec050af67d57a23e1",
                "name": "Gabriel Gratival",
                "email": "gabriel@w3lcome.com",
                "type": "host",
            },
            "pictureUrl": "https://firebasestorage.googleapis.com/v0/b/w3lcome-cbcbb.appspot.com/o/AlissonEnz.jpg?alt=media&token=e2f80260-fc3e-417d-b3ad-572513cf8e18",
            "phone": "(43) 9 9982-0420",
            "email": "alisson@w3lcome.com",
            "customFields": [
                {
                    "id": "aqg-QM4xL",
                    "name": "Do you want to receive promotional emails?",
                    "type": "Dropdown",
                    "value": "Yes"
                }
            ],
            "authorizationStatus": "allowed",
            "notes": "He forgot his id"
        },
        {
            ...
        }
    ],
    "size": 10
}
```

{% endtab %}

{% tab title="404 Error" %}

```javascript
{
    "type": "INVALID_QUERY_OPERATOR"
}
```

{% endtab %}
{% endtabs %}

## Queryable fields

| Field               | Description                                      |
| ------------------- | ------------------------------------------------ |
| checkinAt           | [Unix timestamp](https://www.unixtimestamp.com/) |
| checkoutAt          | [Unix timestamp](https://www.unixtimestamp.com/) |
| isInsideCompany     | Bool                                             |
| name                | String                                           |
| hostId              | String                                           |
| hostName            | String                                           |
| phone               | String                                           |
| cpf                 | String                                           |
| rg                  | String                                           |
| document            | String                                           |
| email               | String                                           |
| address             | String                                           |
| company             | String                                           |
| position            | String                                           |
| sector              | String                                           |
| authorizationStatus | String \[**waiting**\|**allowed**\|**denied**]   |
