# Create a calendar event

`POST https://testing-backend.estactics.com/api/calendarEvents/create`

Adds an event to the calendar of the person who owns the API key.

Authentication: `Authorization: Bearer YOUR_API_KEY`.

## Body parameters

- `eventType` (EVENT | FRONTAL_MEETING | ONLINE_MEETING | VIEWING | FOLLOW_UP, required): Kind of event.
- `title` (string): Event title.
- `notes` (string): Notes.
- `isAllDay` (boolean): True for an all-day event.
- `startsAt` (string): Start date and time.
- `endsAt` (string): End date and time.
- `startsAtDate` (string): Start date, for all-day events.
- `endsAtDate` (string): End date, for all-day events.
- `relatedClientId` (integer): ID of the client this event is about.
- `relatedPropertyId` (integer): ID of the property this event is about.
- `usersInvitesIds` (array of integer): IDs of the invited team members.

## Example request body

```json
{
  "eventType": "VIEWING",
  "title": "Viewing with Alex",
  "startsAt": "2027-01-15 10:00:00",
  "endsAt": "2027-01-15 11:00:00",
  "relatedClientId": 1042
}
```

## Example response

```json
{
  "success": true,
  "data": {
    "id": 201,
    "organizationId": 7,
    "userId": 18,
    "eventType": "VIEWING",
    "relatedClientId": 1042,
    "relatedPropertyId": null
  }
}
```
