> For the complete documentation index, see [llms.txt](https://docs.vomevolunteer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vomevolunteer.com/resources/schedule/reservations/search-reservations.md).

# Search reservations

This endpoint allows for the efficient searching and filtering of reservation records based on specified query parameters such as email, first name, last name and other fields. It is designed to support operations that require accessing detailed reservation information quickly and effectively.

#### Endpoint and Usage:

* **Endpoint**: GET `/api/reservations/search/`
* **Base URL**: `https://api.vomevolunteer.com`

#### Query Parameters:

**Core Filters**

•  **id  (uuid)**: Filters reservations by the ID.&#x20;

•  **arrival\_time**: **(string)**: Filters reservations by  arrival\_time.&#x20;

•  **depature\_time**: **(string)**: Filters reservations by the departure\_time.&#x20;

•  **status**: **(string)**: Filters reservations by the status.&#x20;

•  **created\_at**: **(string)**: Filters reservations by the **created\_at**.&#x20;

* created\_at.gt (string, ISO-8601): Filters by created\_at > value (strictly after).
* created\_at.gte (string, ISO-8601): Filters by created\_at >= value.
* created\_at.lte (string, ISO-8601): Filters by created\_at <= value.
* created\_at.lt (string, ISO-8601): Filters by created\_at < value (strictly before).

**Reservation Statuses**

* `0`: Shift request pending
* `1`: Reserved
* `2`: Shift request declined
* `3`: Attendance confirmed
* `4`: Absent
* `5`: Checked-in
* `6`: Hours logged
* `7`: Hour claim pending

**Sample Requests**

<pre><code><strong># id
</strong>GET /api/reservations/search/?id=a31a7f99-87c2-4f13-af1e-502a724634d7

# arrival_time
GET /api/reservations/search/?arrival_time=2021-02-03T18:00:00Z

# departure_time
GET /api/reservations/search/?user.last_name=2021-02-03T19:00:00Z

# status
GET /api/reservations/search/?status=0

# created_at
GET /api/reservations/search/?created_at=2024-09-06T02:57:15.008656Z

# created_at.gt
GET /api/reservations/search/?created_at.gt=2024-09-06T02:57:15.008656Z

# created_at.gte
GET /api/reservations/search/?created_at.gte=2024-09-06T02:57:15.008656Z

# created_at.lt
GET /api/reservations/search/?created_at.lt=2024-09-06T02:57:15.008656Z

# created_at.lte
GET /api/reservations/search/?created_at.lte=2024-09-06T02:57:15.008656Z

</code></pre>

**User Filters:**

• **user.email (string):** Filters reservations by the email associated with the user who made the reservation.

• **user.first\_name (string):** Filters reservations by the first name of the user.

• **user.last\_name (string)**: Filters reservations by the last name of the user.

**Sample Requests**

```markup
# enail
GET /api/reservations/search/?user.email=astrayuno@domain.com

# first_name
GET /api/reservations/search/?user.first_name=Astra

# last_name
GET /api/reservations/search/?user.last_name=Yuno

```

**Shift Filters:**

•  **shift.id (uuid)**: Filters reservations by the ID of the associated shift.

•  **shift.shift\_title (string)**: Filters reservations by the name of the associated shift.

#### Example Requests:

```http
# id
GET /api/reservations/search/?shift.id=a31a7f99-87c2-4f13-af1e-502a724634d7

# shift_title
GET /api/reservations/search/?shift.shift_title=title

# shift_start_at
GET /api/reservations/search/?shift.shift_start_at=2024-08-15T18:00:00Z

# shift_end_at
GET /api/reservations/search/?shift.shift_end_at=2024-10-15T18:00:00Z

# shift_start_at and shift_end_at
GET /api/reservations/search/?shift.shift_start_at=2024-08-15T18:00:00Z&shift.shift_end_at=2024-10-15T18:00:00Z

```

**Opportunity** **Filters**

**Search by opportunity filters:**

•  **opportunity.id (uuid)**: Filters reservations by the ID of the associated opportunity.

•  **opportunity.title (string)**: Filters reservations by the Title of the associated opportunity.

```http
# id
GET /ap i/reservations/search/?opportunity.id=a31a7f99-87c2-4f13-af1e-502a724634d7

# title
GET /api/reservations/search/?opportunity.title=SampleTitleA

```

#### Authorization:

Requests to this endpoint require an `API-KEY` in the header for authentication.

```python
headers = {
    "API-KEY": "your_unique_api_key_here"
}
response = requests.get("https://api.vomevolunteer.com/api/reservations/search/?email=user_email@domain.com", headers=headers)
```

#### Response Structure:

The response from this endpoint returns a list of reservations that match the query parameters, including detailed information about each reservation's associated shift and enrollment info.

#### Example Response Object:

```json

{
    "count": 284,
    "next": "https://api.vomevolunteer.com/api/reservations/search/?email=sample_volunteer_01%domain.com&page=2",
    "previous": null,
    "results":
[
       {
            "id": "8941d173-6909-45bd-a4d8-c13b11e170af",
            "shift": {
                "id": "c2e41a8a-c6fe-4468-bc86-8ec1af71ad12",
                "created_at": "2020-10-27T10:17:52.450538Z",
                "shift_start_at": "2020-11-05T13:00:00Z",
                "shift_end_at": "2020-11-05T17:00:00Z",
                "spots": 10,
                "shift_title": null,
                "shift_description": null
            },
            "created_at": "2020-11-05T02:55:28.030935Z",
            "status": 0,
            "logged_hours": 2.0,
            "arrival_time": "2020-11-05T13:00:00Z",
            "departure_time": "2020-11-05T14:00:00Z",
            "hours_approved_by": null,
            "user": {
                "id": "874976ad-3bcc-456c-ad52-e54132b88571",
                "first_name": "Daniel",
                "last_name": "Smithkern",
                "email": "sample_volunteer_05@domain.com",
                "gender": 0,
                "address": "3949 Decarie Boulevard, Montreal, QC, Canada",
                "phone_number": "1235474630",
                "date_of_birth": "1975-02-08",
                "timezone": "America/Detroit",
                "address_coordinates": [
                    "45.4772493",
                    "-73.61535169999999"
                ]
            },
            "opportunity": {
                "id": "c3d92fa3-d904-4f9d-bb50-ec342a085931",
                "category": {
                    "id": "b24e49fd-2b04-4b80-bf4f-871a4dc6ad3e",
                    "title": "Winter Food Program",
                    "description": "This program works to help alleviate hunger and the stigma of food insecurity in our students. By providing Weekends and More hampers to participating schools, staff and teachers can support students who are struggling with access to nutritious food on weekends. These hampers contain easy to prepare meals to meet the needs of students who would otherwise go without food when they are away from school meal programs."
                },
                "title": "Server",
                "description": "We need help and looking for someone to serve food to homeless people!"
            }
        },
    ]
}
```

To format the JSON response structure without altering any content, organize it with clear headings and subheadings for each part. Here's a suggested format:

### Example Response Structure

#### Summary Information

* **Count**: 284
* **Next Page URL**: [URL for Page 2](https://api.vomevolunteer.com/api/reservations/search/?email=sample_volunteer_01%40mailinator.com\&page=2)
* **Previous Page URL**: null

For a complete description of each field in this response object, you can visit: [Reservations](/resources/schedule/reservations.md)
