> For the complete documentation index, see [llms.txt](https://docs.venuzle.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.venuzle.com/manager-api/internal-endpoints/partner/events.md).

# Events

Endpoints for working with events.

The old manager had only the concept of courses. In the new one, something more general is used: events. Each event has a type: `course`, `seminar`, etc. Currently, only the type `course` is implemented. The next types will be implemented in the future.

## Get events

<mark style="color:blue;">`GET`</mark> `/api/internal/v1/partners/:partner_id/events`

Get all the events of a partner.

#### Path Parameters

| Name        | Type    | Description            |
| ----------- | ------- | ---------------------- |
| partner\_id | integer | The ID of the partner. |

#### Query Parameters

| Name      | Type   | Description                                                                                                      |
| --------- | ------ | ---------------------------------------------------------------------------------------------------------------- |
| page      | number | The page to display.                                                                                             |
| timeframe | string | Filter events by their timeframe. Allowed values: `all`, `current`, `upcoming`, `past`, `cancelled`, `inactive`. |
| search    | string | Filter events by their name and short name.                                                                      |
| type      | string | The type of the event. Default is `course`.                                                                      |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Get event types

<mark style="color:blue;">`GET`</mark> `/api/internal/v1/partners/:partner_id/events/types`

Get all the available event types.

#### Path Parameters

| Name        | Type    | Description            |
| ----------- | ------- | ---------------------- |
| partner\_id | integer | The ID of the partner. |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Get event timeframes

<mark style="color:blue;">`GET`</mark> `/api/internal/v1/partners/:partner_id/events/timeframes`

Get all the available event timeframes.

#### Path Parameters

| Name        | Type    | Description            |
| ----------- | ------- | ---------------------- |
| partner\_id | integer | The ID of the partner. |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Create new event

<mark style="color:green;">`POST`</mark> `/api/internal/v1/partners/:partner_id/events`

#### Path Parameters

| Name        | Type    | Description            |
| ----------- | ------- | ---------------------- |
| partner\_id | integer | The ID of the partner. |

#### Request Body

| Name                             | Type    | Description                                                                                                                                                                                                      |
| -------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name                             | string  | The name of the event.                                                                                                                                                                                           |
| short\_name                      | string  | The short name of the event.                                                                                                                                                                                     |
| type                             | string  | Currently only `course` is accepted.                                                                                                                                                                             |
| bookability                      | string  | Currently only `public` is accepted.                                                                                                                                                                             |
| bookable\_from                   | string  | The date time since the event can be booked. Format: Y-m-d H:i:s                                                                                                                                                 |
| bookable\_until                  | string  | The date time until the event can be booked. Format: Y-m-d H:i:s                                                                                                                                                 |
| start\_date                      | string  | The date when the event starts. Format: Y-m-d                                                                                                                                                                    |
| end\_date                        | string  | The date when the event is over. Format: Y-m-d                                                                                                                                                                   |
| freebie                          | boolean | Indicates if the event is freebie or not.                                                                                                                                                                        |
| waitlist\_enabled                | boolean |                                                                                                                                                                                                                  |
| waitlist\_max\_places            | number  |                                                                                                                                                                                                                  |
| waitlist\_autofill\_free\_places | boolean |                                                                                                                                                                                                                  |
| birthdate\_mandatory             | boolean |                                                                                                                                                                                                                  |
| max\_participants                | number  |                                                                                                                                                                                                                  |
| online\_max\_participants        | number  |                                                                                                                                                                                                                  |
| disable\_online\_payment         | boolean |                                                                                                                                                                                                                  |
| instructor\_ids                  | array   | The IDs of the event instructors. Use the dedicated endpoint to fetch all the available instructors (pagination is applied, allow the user to filter by name). An event can have none, one, or many instructors. |
| audience\_ids                    | array   | The IDs of the event audiences. Use the dedicated endpoint to fetch all the available audiences.                                                                                                                 |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Get event

<mark style="color:blue;">`GET`</mark> `/api/internal/v1/partners/:partner_id/events/:event_id`

#### Path Parameters

| Name        | Type    | Description            |
| ----------- | ------- | ---------------------- |
| partner\_id | integer | The ID of the partner. |
| event\_id   | integer | The ID of the event.   |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Toggle event freebie

<mark style="color:orange;">`PUT`</mark> `/api/internal/v1/partners/:partner_id/events/:event_id/freebie`

Togggle the freebie of the given event. If the&#x20;

#### Path Parameters

| Name        | Type    | Description            |
| ----------- | ------- | ---------------------- |
| partner\_id | integer | The ID of the partner. |
| event\_id   | integer | The ID of the event.   |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Update event image

<mark style="color:orange;">`PUT`</mark> `/api/internal/v1/partners/:partner_id/events/:event_id/image`

Update the image of the given event.

#### Path Parameters

| Name        | Type    | Description            |
| ----------- | ------- | ---------------------- |
| partner\_id | integer | The ID of the partner. |
| event\_id   | integer | The ID of the event.   |

#### Request Body

| Name  | Type   | Description                 |
| ----- | ------ | --------------------------- |
| image | object | The new image of the event. |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Get event brochures

<mark style="color:blue;">`GET`</mark> `/api/internal/v1/partners/:partner_id/events/:event_id/brochures`

Get the brochures of the given event.

#### Path Parameters

| Name        | Type    | Description            |
| ----------- | ------- | ---------------------- |
| partner\_id | integer | The ID of the partner. |
| event\_id   | integer | The ID of the event.   |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Upload event brochure

<mark style="color:green;">`POST`</mark> `/api/internal/v1/partners/:partner_id/events/:event_id/brochures/:brochure_id`

Upload a new brochure for the given event.

#### Path Parameters

| Name         | Type    | Description             |
| ------------ | ------- | ----------------------- |
| partner\_id  | integer | The ID of the partner.  |
| event\_id    | integer | The ID of the event.    |
| brochure\_id | integer | The ID of the brochure. |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Delete event brochure

<mark style="color:red;">`DELETE`</mark> `/api/internal/v1/partners/:partner_id/events/:event_id/brochures/:brochure_id`

Delete the given brouchure belonging to the given event.

#### Path Parameters

| Name         | Type    | Description             |
| ------------ | ------- | ----------------------- |
| partner\_id  | integer | The ID of the partner.  |
| event\_id    | integer | The ID of the event.    |
| brochure\_id | integer | The ID of the brochure. |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Get event date settings

<mark style="color:blue;">`GET`</mark> `/api/internal/v1/partners/:partner_id/events/:event_id/date-settings`

Get the date settings of the given event.

#### Path Parameters

| Name        | Type    | Description            |
| ----------- | ------- | ---------------------- |
| partner\_id | integer | The ID of the partner. |
| event\_id   | integer | The ID of the event.   |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Update event date settings

<mark style="color:orange;">`PUT`</mark> `/api/internal/v1/partners/:partner_id/events/:event_id/date-settings`

Update the date settings of the given event. New appointments will be generate based on the date settings. Old appointments (if any) will be deleted.

#### Path Parameters

| Name        | Type    | Description            |
| ----------- | ------- | ---------------------- |
| partner\_id | integer | The id of the partner. |
| event\_id   | integer | The ID of the event.   |

#### Request Body

| Name                                         | Type    | Description                                                            |
| -------------------------------------------- | ------- | ---------------------------------------------------------------------- |
| date\_settings                               | array   | Array with all the date settings.                                      |
| date\_settings.\*                            | array   | Array with the date settings of a day.                                 |
| date\_settings.\*.appointments               | array   | Array of appointments.                                                 |
| date\_settings.\*.appointments.\*.starts\_at | string  | The hour when the appointment will start. The allowed format is H:i:s. |
| date\_settings.\*.appointments.\*.ends\_at   | string  | The hour when the appointment will end. The allowed format is H:i:s.   |
| date\_settings.\*.appointments.\*.venue\_id  | integer | The ID of the venue where the appointment will take place.             |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

To easily understand the format of the date\_settings parameter, below is an example of a request done in PHP.

{% hint style="warning" %}
For the moment, the `appointments` array should receive a single entry. In the future will be possible to send multiple entries and schedule more than one appointment per day.
{% endhint %}

![](https://1023014874-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDJ_cmLNYiaRyGLFIsC%2F-MNdXAr1y6H2ZO7foz4d%2F-MNdZV0Hgz-S9Cjt_w-r%2Fimage.png?alt=media\&token=66df92d9-9975-4303-937e-74b1ee439446)

## Get event prices

<mark style="color:blue;">`GET`</mark> `/api/internal/v1/partners/:partner_id/events/:event_id/prices`

Get the secondary prices of the given event.

#### Path Parameters

| Name        | Type    | Description            |
| ----------- | ------- | ---------------------- |
| partner\_id | integer | The ID of the partner. |
| event\_id   | integer | The ID of the event.   |

#### Query Parameters

| Name | Type   | Description      |
| ---- | ------ | ---------------- |
| page | number | The page number. |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Create event price

<mark style="color:green;">`POST`</mark> `/api/internal/v1/partners/:partner_id/events/:event_id/prices`

Create a new event price. If the event has no default price, the price will be created with type `default`. If it already has a default price, the price will be created with the type `secondary`.

#### Path Parameters

| Name        | Type    | Description            |
| ----------- | ------- | ---------------------- |
| partner\_id | integer | The ID of the partner. |
| event\_id   | integer | The ID of the event.   |

#### Request Body

| Name           | Type    | Description                                         |
| -------------- | ------- | --------------------------------------------------- |
| name           | string  | The price name.                                     |
| description    | string  | The price description.                              |
| form           | string  | The price form: `gross` or `net`.                   |
| amount         | number  | The price amount.                                   |
| vat\_id        | integer | The ID of the VAT.                                  |
| usable\_online | boolean | Indicate if the price will be usable online or not. |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Get the default event price

<mark style="color:blue;">`GET`</mark> `/api/internal/v1/partners/:partner_id/events/:event_id/prices/default`

Get the default price of the event.

#### Path Parameters

| Name        | Type    | Description            |
| ----------- | ------- | ---------------------- |
| partner\_id | integer | The ID of the partner. |
| event\_id   | integer | The ID of the event.   |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Update event price

<mark style="color:orange;">`PUT`</mark> `/api/internal/v1/partners/:partner_id/events/:event_id/prices/:price_id`

Update the given price. If a anything related to the amount is changed (amount, vat, form), a new price will be created and the old one will be deleted. Make sure the fetch the update price using the new id if this happens.

#### Path Parameters

| Name        | Type    | Description            |
| ----------- | ------- | ---------------------- |
| partner\_id | integer | The ID of the partner. |
| event\_id   | integer | The ID of the event.   |
| price\_id   | integer | The ID of the price.   |

#### Request Body

| Name           | Type    | Description                                         |
| -------------- | ------- | --------------------------------------------------- |
| name           | string  | The price name.                                     |
| description    | string  | The price description.                              |
| form           | string  | The price form: `net` or `gross`.                   |
| amount         | number  | The price amount.                                   |
| vat\_id        | integer | The ID of the VAT applied to the price.             |
| usable\_online | boolean | Indicate if the price will be usable online or not. |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Delete event price

<mark style="color:red;">`DELETE`</mark> `/api/internal/v1/partners/:partner_id/events/:event_id/prices/:price_id`

Delete the given event price. A default event price cannot be deleted.

#### Path Parameters

| Name        | Type    | Description            |
| ----------- | ------- | ---------------------- |
| partner\_id | integer | The ID of the partner. |
| event\_id   | integer | The ID of the event.   |
| price\_id   | integer | The ID of the price.   |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Get the appointments of an event

<mark style="color:blue;">`GET`</mark> `/api/internal/v1/partners/:partner_id/events/:event_id/appointments`

Get the appointments of an event.

#### Path Parameters

| Name        | Type    | Description            |
| ----------- | ------- | ---------------------- |
| partner\_id | integer | The ID of the partner. |
| event\_id   | integer | The ID of the event.   |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Get an appointment for an event

<mark style="color:blue;">`GET`</mark> `/api/internal/v1/partners/:partner_id/events/:event_id/appointments/:appointment_id`

Get an appointment for an event.

#### Path Parameters

| Name            | Type    | Description                |
| --------------- | ------- | -------------------------- |
| partner\_id     | integer | The ID of the partner.     |
| event\_id       | integer | The ID of the event.       |
| appointment\_id | integer | The ID of the appointment. |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Update an appointment for an event

<mark style="color:orange;">`PUT`</mark> `/api/internal/v1/partners/:partner_id/events/:event_id/appointments/:appointment_id`

Update an appointment for an event.

#### Path Parameters

| Name            | Type    | Description                |
| --------------- | ------- | -------------------------- |
| partner\_id     | integer | The ID of the partner.     |
| event\_id       | integer | The ID of the event.       |
| appointment\_id | integer | The ID of the appointment. |

#### Request Body

| Name            | Type    | Description                                                                                    |
| --------------- | ------- | ---------------------------------------------------------------------------------------------- |
| starts\_at      | string  | When the appointment starts. Format: Y-m-d H:i:s                                               |
| ends\_at        | string  | When the appointment ends. Format: Y-m-d H:i:s                                                 |
| venue\_id       | integer | The ID of the venue where the appointment is taking place.                                     |
| instructor\_ids | array   | Array with the IDs of the instructors assigned to the appointment. An empty array can be sent. |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Delete an appointment for an event

<mark style="color:red;">`DELETE`</mark> `/api/internal/v1/partners/:partner_id/events/:event_id/appointments/:appointment_id`

Delete an appointment for an event.

#### Path Parameters

| Name            | Type    | Description                |
| --------------- | ------- | -------------------------- |
| partner\_id     | integer | The ID of the partner.     |
| event\_id       | integer | The ID of the event.       |
| appointment\_id | integer | The ID of the appointment. |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}
