---
title: "[DRAFT] Search Calendars"
method: POST
path: "/calendars/search"
tags: ["calendar"]
---

# \[DRAFT\] Search Calendars

`POST /calendars/search`

## Request

- Base URL: `https://api.acculynx.com/api/v2`
- URL: `https://api.acculynx.com/api/v2/calendars/search`
- Auth: HTTP bearer

[DRAFT] This endpoint retrieves calendars based on a set of search criteria. You can filter results by multiple user calendars and the jobIds associated with them. The startDate and endDate parameters are mandatory and specify the time range for the search.

## Request body

- CalendarSearchPost
  - `eventType` string[]: List of one or more event types available
  - `calendarIds` string[]: List of one or more user unique GUIDs associated to the calendars to search
  - `jobIds` string[]: List of one or more job unique GUIDs associated to the calendars to search
  - `startDate` string, date-time: The start date and time of the event in ISO 8601 UTC format.
  - `endDate` string, date-time: The end date and time of the event in ISO 8601 UTC format.
  - `pageStartIndex` integer: The index of the first element to return
  - `pageSize` integer: How many items to be returned at a time.

## Response `200`

OK

- CalendarSearchEventCollection
  - `count` integer: The total number of items matching the current query.
  - `pageSize` integer: The requested or default page size.
  - `pageStartIndex` integer: The requested or default index of the first element to return.
  - `items` CalendarSearchEvent[]
    - `id` string, uuid: The unique GUID of the calendar event.
    - `eventType` 'All' | 'Personal' | 'InitialAppointment' | 'MaterialDelivery' | 'CrewLabor'
    - `title` string: The name of the calendar event.
    - `attendees` CompanyUserLink[]
      - `id` string, uuid: The unique GUID of the AccuLynx User.
      - `_link` string: The unique URI of the AccuLynx User.
    - `job` JobLink
      - `id` string, uuid: The job's unique ID.
      - `_link` string: The URI of this Job.
    - `allDay` boolean: Whether the event is an all day event.
    - `start` string, date-time: The start date/time of the event.
    - `end` string, date-time: The end date/time of the event.
    - `jobName` string: The name of the job associated with the event, if any.\
    - `location` string: The address where the appointment is to take place.
    - `sharedWithCustomerPortal` boolean: Indicates if the event is shared with the customer portal.
    - `_link` string: The URI of the this calendar event.

## Other responses

- `400`: The request was malformed or contained invalid field values. Check the error response body for details.
- `401`: The API key provided is missing, invalid, or has been deactivated. Verify your API key and try again.
- `404`: The requested resource was not found. Verify the ID in the request path is correct and that the resource exists.
- `416`: Range Not Satisfiable.

---

[API](https://skmtc.dev/acculynx/apis/acculynx-api-v2.md) - [All operations](https://skmtc.dev/acculynx/apis/acculynx-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/acculynx/apis/acculynx-api-v2/revisions/443924b00f43?raw)
