# List Events

> Source: https://truto.one/docs/api-reference/unified-calendar-api/events/list/

`GET /unified/calendar/events`

Resource: **Events** · API: **Unified Calendar API**

## Supported integrations

Cal.com, Calendly (partial), Google, Google Calendar, Outlook Calendar

## Query parameters

- **`integrated_account_id`** _(string, required)_
  The ID of the integrated account to use for the request.
- **`truto_response_format`** _(string)_
  The format of the response. - `unified` returns the response with unified mappings applied. - `raw` returns the unprocessed, raw response from the remote API. - `normalized` applies the unified mappings and returns the data in a normalized format. - `stream` returns the response as a stream, which is ideal for transmitting large datasets, files, or binary data. Using streaming mode helps to efficiently handle large payloads or real-time data flows without requiring the entire data to be buffered in memory. Defaults to `unified`.
  Allowed: `unified`, `raw`, `normalized`, `stream`
- **`truto_key_by`** _(string)_
  By default the `result` attribute is an array of objects. This parameter allows you to specify a field in each `result` objects to use as key, which transforms the `result` array into an object with the array items keyed by the field. This is useful for when you want to use the result as a lookup table.
- **`truto_ignore_limit`** _(boolean)_
  Ignores the `limit` query parameter.
- **`truto_ignore_remote_data`** _(boolean)_
  Excludes the `remote_data` attribute from the response.
- **`truto_exclude_fields`** _(array<string>)_
  Array of fields to exclude from the response.
- **`remote_query`** _(object)_
  Query parameters to pass to the underlying API without any transformations. Refer [this guide](https://truto.one/docs/api-reference/overview/querying#remote-query-parameters) to see how to structure the query parameters.
- **`calendar`** _(object)_
  The calendar associated with the event.
- **`type`** _(string)_
  The type of the event.
  Allowed: `default`, `focus_time`, `out_of_office`, `working_location`
- **`identifier`** _(unknown)_
- **`sort_by`** _(object)_
- **`title`** _(string)_
  The title of the event.
- **`description`** _(string)_
  The description of the event.
- **`location`** _(object)_
  The location of the event.
- **`organized_by`** _(object)_
  The person who created the event.
- **`start_time`** _(string)_
  The date and time when the event starts.
- **`end_time`** _(string)_
  If not specified, fetches events that are within the month of the start_time. If start_time is not specified, fetches events that are till the end of current month.
- **`timezone`** _(string)_
  The timezone of the event.
- **`updated_at`** _(string)_
  The date when the event was updated.
- **`expand_recurring`** _(boolean)_
  If set to true, expands recurring events into instances. Else, returns only single one-off events and instances of recurring events, but not the underlying recurring events themselves.
- **`user`** _(object)_
  The user whose calendars are to be retrieved.
- **`created_at`** _(string)_
  The date when the event was created.

## Response body

- **`result`** _(array<object>)_
  List of Events
  - **`id`** _(string, required)_
    The unique identifier of the event.
  - **`calendar`** _(object)_
    The calendar associated with the event.
    - **`id`** _(string)_
      The unique identifier of the calendar.
    - **`name`** _(string)_
      The name of the calendar.
  - **`title`** _(string, required)_
    The title of the event.
  - **`description`** _(string)_
    The description of the event.
  - **`location`** _(object)_
    The location of the event.
    - **`id`** _(string)_
      The unique identifier of the location.
    - **`name`** _(string)_
      The name of the location.
    - **`address`** _(object)_
      - **`street_1`** _(string)_
        The first line of the street address.
      - **`street_2`** _(string)_
        The second line of the street address.
      - **`city`** _(string)_
        The city of the address.
      - **`state`** _(string)_
        The state of the address.
      - **`country`** _(string)_
        The country of the address.
      - **`postal_code`** _(string)_
        The postal code of the address.
    - **`url`** _(string)_
      The URL of the location.
    - **`coordinates`** _(object)_
      - **`latitude`** _(number)_
        The latitude of the location.
      - **`longitude`** _(number)_
        The longitude of the location.
  - **`timezone`** _(string)_
    The timezone of the event.
  - **`start_time`** _(string, required)_
    The date and time when the event starts.
  - **`end_time`** _(string)_
    The date and time when the event ends.
  - **`status`** _(string)_
    The status of the event.
    Allowed: `confirmed`, `tentative`, `cancelled`, `draft`
  - **`attendees`** _(array<object>)_
    The attendees associated with the event.
    - **`person`** _(object)_
      The person associated with the attendee.
      - **`id`** _(string)_
        The unique identifier of the person.
      - **`name`** _(string)_
        The name of the person.
      - **`emails`** _(array<object>)_
        The emails of the person.
    - **`is_optional`** _(boolean)_
      Indicates if the attendance is optional.
    - **`is_self`** _(boolean)_
      Indicates if the attendee is the authenticated user.
    - **`is_organizer`** _(boolean)_
      Indicates if the attendee is the organizer of the event.
    - **`response`** _(object)_
      The response of the attendee.
      - **`status`** _(string)_
        The status of the response.
        Allowed: `needs_action`, `declined`, `tentative`, `accepted`
      - **`comment`** _(string)_
        The comment of the response.
  - **`created_by`** _(object)_
    The person who created the event.
    - **`id`** _(string)_
      The unique identifier of the person.
    - **`name`** _(string)_
      The name of the person.
    - **`emails`** _(array<object>)_
      The emails of the person.
      - **`email`** _(string)_
        The email of the person.
      - **`type`** _(string)_
        The type of the email.
  - **`organized_by`** _(object)_
    The person who created the event.
    - **`id`** _(string)_
      The unique identifier of the person.
    - **`name`** _(string)_
      The name of the person.
    - **`emails`** _(array<object>)_
      The emails of the person.
      - **`email`** _(string)_
        The email of the person.
      - **`type`** _(string)_
        The type of the email.
  - **`type`** _(string)_
    The type of the event.
    Allowed: `default`, `out_of_office`, `focus_time`, `working_location`
  - **`availability`** _(string)_
    The availability of the user during the time period of the event.
    Allowed: `busy`, `free`
  - **`visibility`** _(string)_
    The visibility of the event.
    Allowed: `calendar_default`, `public`, `private`
  - **`identifiers`** _(object)_
    The identifiers associated with the event.
    - **`ical_uid`** _(string)_
      The iCalendar UID of the event.
    - **`ical_sequence`** _(string)_
      The iCalendar sequence of the event.
  - **`is_locked`** _(boolean)_
    Indicates if the event is locked and cannot be modified.
  - **`urls`** _(object)_
    The URLs associated with the event.
    - **`url`** _(string)_
      The URL of the event.
    - **`type`** _(string)_
      The type of the URL.
  - **`is_recurring`** _(boolean)_
    Indicates if the event is recurring.
  - **`recurrence`** _(array<string>)_
    The recurrence of the event. List of RRULE, EXRULE, RDATE and EXDATE lines for a recurring event, as specified in RFC5545.
  - **`parent_event`** _(object)_
    The parent event of a recurring event.
    - **`id`** _(string)_
      The unique identifier of the parent event.
  - **`has_attachments`** _(boolean)_
    Indicates if the event has attachments.
  - **`attachments`** _(array<object>)_
    The attachments associated with the event.
    - **`id`** _(string)_
      The unique identifier of the attachment.
    - **`name`** _(string)_
      The name of the attachment.
    - **`mime_type`** _(string)_
      The MIME type of the attachment.
    - **`url`** _(string)_
      The URL of the attachment.
    - **`created_at`** _(string)_
      The date when the attachment was created.
    - **`updated_at`** _(string)_
      The date when the attachment was updated.
  - **`guests_can_invite_others`** _(boolean)_
    Indicates if guests can invite others to the event.
  - **`guests_can_modify`** _(boolean)_
    Indicates if guests can modify the event.
  - **`guests_can_see_other_guests`** _(boolean)_
    Indicates if guests can see other guests of the event.
  - **`event_type`** _(object)_
    The event type object associated with the event.
    - **`id`** _(string)_
      The unique identifier of the event type.
  - **`created_at`** _(string)_
    The date when the event was created.
  - **`updated_at`** _(string)_
    The date when the event was updated.
  - **`remote_data`** _(object)_
    Raw data returned from the remote API call.
- **`next_cursor`** _(string)_
  The cursor to use for the next page of results. Pass this value as `next_cursor` in the query parameter in the next request to get the next page of results.

## Code examples

### curl

```bash
curl -X GET 'https://api.truto.one/unified/calendar/events?integrated_account_id=<integrated_account_id>' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json'
```

### JavaScript

```javascript
const integratedAccountId = '<integrated_account_id>';

const response = await fetch(`https://api.truto.one/unified/calendar/events?integrated_account_id=${integratedAccountId}`, {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer <your_api_token>',
    'Content-Type': 'application/json',
  },
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

url = "https://api.truto.one/unified/calendar/events"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
    "integrated_account_id": "<integrated_account_id>"
}

response = requests.get(url, headers=headers, params=params)
print(response.json())
```

### Truto TS SDK

```typescript
import Truto from '@truto/truto-ts-sdk';

const truto = new Truto({
  token: '<your_api_token>',
});

const result = await truto.unifiedApi.list(
  'calendar',
  'events',
  { integrated_account_id: '<integrated_account_id>' }
);

console.log(result);
```

### Truto Python SDK

```python
import asyncio
from truto_python_sdk import TrutoApi

truto_api = TrutoApi(token="<your_api_token>")

async def main():
    async for item in truto_api.unified_api.list(
        "calendar",
        "events",
        {"integrated_account_id": "<integrated_account_id>"}
    ):
        print(item)

asyncio.run(main())
```
