# Webhook Events Reference

Webhooks let you subscribe to freispace API events and receive notice when an event occurs. For more information about how to set up a webhook subscription, see [freispace Webhooks Overview](https://docs.freispace.com/docs/webhooks.md).

## Bookings API[​](#bookings-api "Direct link to Bookings API")

### Events[​](#events "Direct link to Events")

| Event             | Description                                                        |
| ----------------- | ------------------------------------------------------------------ |
| `booking.created` | Occurs whenever a new booking is created.                          |
| `booking.updated` | Occurs whenever any booking's information or resources is updated. |
| `booking.deleted` | Occurs whenever a booking is deleted.                              |

### Example Payload[​](#example-payload "Direct link to Example Payload")

We return JSON-formatted content with the following structure.

| Name    | Example content                                                                              | Description                                                |
| ------- | -------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| `id`    | `90fffd9c-6f31-43f5-84ce-264c7ca8be37`                                                       | UUID of the booking                                        |
| `type`  | `booking`                                                                                    | Resource type                                              |
| `event` | `booking.updated`                                                                            | Event that triggered the webhook, lowercase, dot-separated |
| `url`   | `https://app.freispace.com/planning/overview?bookingId=90fffd9c-6f31-43f5-84ce-264c7ca8be37` | URL to the updated booking                                 |
| `data`  | `{}`                                                                                         | The booking's information                                  |

```
{

    "id": "90fffd9c-6f31-43f5-84ce-264c7ca8be37",

    "type": "booking",

    "event": "booking.updated",

    "url": "https://app.freispace.com/planning/overview?bookingId=90fffd9c-6f31-43f5-84ce-264c7ca8be37",

    "data": {

        "id": "90fffd9c-6f31-43f5-84ce-264c7ca8be37",

        "name": "E01 - Fine Cut",

        "start": "2023-08-08T00:00:00",  // (1)!

        "end": "2023-08-18T00:00:00",

        "all_day": true, // (2)!

        "byline": null,

        "description": null, // (3)!

        "color": null,  // (4)!

        "optional": false,

        "status": {

            "id": "afcd1a07-ec58-4393-b808-a452a5a09e6b",

            "name": "Confirmed",

            "description": null,

            "icon": "check-circle",

            "color": "#057a55"

        },

        "project": {

            "id": "9d526060-599b-4e29-b9b6-cc5bcc20dacb",

            "name": "E01",

            "byline": null,

            "number": "P156-1",

        },

        "resources": {

            "suites": [

                {

                    "id": "6478ecaf-1fc5-4266-831e-fcd96a4bc098",

                    "name": "Avid 01",

                    "byline": "Z420",

                    "description": null,

                    "color": "#a200ad",

                    "site": {

                        "id": "0537b566-7bed-4aae-9544-f5ae01547c7b",

                        "name": "Berlin",

                        "description": "<p>HQ</p>"

                    }

                }

            ],

            "resources": [

                {

                    "id": "08e22f05-41e5-41df-8df8-d7d3404f5035",

                    "name": "Notebook 01",

                    "number": null,

                    "cost": 0,

                    "cost_unit": "day", // (5)!

                    "byline": null,

                    "description": null,

                    "color": "#e6de00",

                    "email": null,

                    "photo_url": "https://assets.app.freispace.com/freispace-public/resource_photos/08e22f05-41e5-41df-8df8-d7d3404f5035.svg"

                }

            ],

            "staffs": [

                {

                    "id": "a893354c-ce2c-407d-b893-278bead7aa4c",

                    "name": "Jane Doe",

                    "title": "Editor",

                    "number": null,

                    "cost": 0,

                    "cost_unit": null,

                    "photo_url": "https://assets.app.freispace.com/freispace-public/staff_photos/a893354c-ce2c-407d-b893-278bead7aa4c.svg"

                }

            ]

        }

    }

}
```

1. Datetime strings should be considered user's local time and do not contain a timezone.
2. Boolean, whether this is a full-day booking. A full-day booking on Monday the 3rd would have a start datetime of `2023-01-03T00:00:00` and an end of `2023-01-04T00:00:00`
3. Description may be `null` or contain HTML.
4. If given, colours are a HEX colour value (e.g. `#00ff00`).
5. Cost units may generally be `minute`, `hour`, `day`, `week`, `month` or `usage`.

## Projects API[​](#projects-api "Direct link to Projects API")

### Events[​](#events-1 "Direct link to Events")

| Event                | Description                                          |
| -------------------- | ---------------------------------------------------- |
| `project.created`    | Occurs whenever a new project is created.            |
| `project.updated`    | Occurs whenever a project's information has changed. |
| `project.archived`   | Occurs whenever a project is archived.               |
| `project.unarchived` | Occurs whenever a project is re-activated.           |
| `project.deleted`    | Occurs whenever a project is deleted.                |

### Example Payload[​](#example-payload-1 "Direct link to Example Payload")

We return JSON-formatted content with the following structure.

| Name    | Example content                                                                    | Description                                                |
| ------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| `id`    | `882a3ceb-319a-4cca-a6e7-65ead0760726`                                             | UUID of the trigger resource                               |
| `type`  | `project`                                                                          | Resource type                                              |
| `event` | `project.updated`                                                                  | Event that triggered the webhook, lowercase, dot-separated |
| `url`   | `https://app.freispace.com/planning/projects/882a3ceb-319a-4cca-a6e7-65ead0760726` | URL to the updated resource                                |
| `data`  | `{}`                                                                               | The project's information                                  |

```
{

    "id": "882a3ceb-319a-4cca-a6e7-65ead0760726",

    "type": "project",

    "event": "project.updated",

    "url": "https://app.freispace.com/planning/projects/882a3ceb-319a-4cca-a6e7-65ead0760726",

    "data": {

        "id": "882a3ceb-319a-4cca-a6e7-65ead0760726",

        "name": "Climate",

        "number": "P156",

        "byline": "ZDFinfo, 2x43'",

        "description": null, // (1)!

        "start": "2024-05-30",

        "end": "2024-10-30",

        "color": "#0062ff",

        "clients": [

            {

                "id": "9d4c9eda-c600-4d67-9796-43a16f001eaa",

                "name": "Production Company",

                "byline": null,

                "number": "C001",

            }

        ],

        "status": "active", // (2)!

        "children": [

            {

                "id": "9d526060-599b-4e29-b9b6-cc5bcc20dacb",

                "name": "E01",

                "number": "P156-1",

                "status": "active", // (2)!

            }

        ],

        "parent" : null,

        "custom_fields": [

            {

                "title": "Material",

                "value": "DNxHD"

            }

        ],

        "global_fields": [

            {

                "id": "e62b7570-a3ce-4480-96e5-39447cb77006",

                "title": "Deadline",

                "description": null,

                "value": "2023-01-01",

            }

        ]

    }

}
```

1. Description may be `null` or contain HTML.
2. `active` or `archive`
