Saltar al contenido principal

Event Templates

The Event Templates API allows you to create, retrieve, update, and delete templates for events. Templates define reusable configurations that can be applied to multiple events, including field definitions and registration forms.

Authentication

All requests to the Event Templates API must be authenticated using the ONLIVE.SITE authentication scheme. Please refer to the Authentication Guide for detailed instructions.

Base URL

https://openapi.onlive.site/api/v1/event-templates

Endpoints


Create Event Template

Creates a new event template with custom fields and registration form association.

HTTP Request

POST /api/v1/event-templates

Request Body

FieldTypeRequiredDescription
namestringYesThe name of the event template (max 255 characters)
registrationFormIdstring (uuid)YesThe registration form identifier associated with this template
fieldsarray of objectsYesThe fields configuration for the event template

Field Object Structure

Each field in the fields array follows the same structure as described in the Event Registration Forms documentation.

Example Request Body

{
"name": "Weekly Tech Talks",
"registrationFormId": "456e7890-e12b-34c5-d678-426614174000",
"fields": [
{
"name": "duration",
"description": "Event Duration",
"fieldType": "number",
"FieldComponent": "input",
"required": true,
"isSortable": true
},
{
"name": "capacity",
"description": "Maximum Capacity",
"fieldType": "number",
"FieldComponent": "input",
"required": true,
"isFilterable": true
},
{
"name": "location",
"description": "Event Location",
"fieldType": "text",
"FieldComponent": "input",
"required": false,
"isSearchable": true
},
{
"name": "isVirtual",
"description": "Virtual Event",
"fieldType": "boolean",
"FieldComponent": "switch",
"required": false,
"isFilterable": true
}
]
}

Response

Returns the created EventTemplate object.

Example Response

{
"id": "123e4567-e89b-12d3-a456-426614174000",
"organizationId": "987e6543-e21a-34b5-c678-426614174000",
"registrationFormId": "456e7890-e12b-34c5-d678-426614174000",
"name": "Weekly Tech Talks",
"slug": "weekly-tech-talks",
"createdAt": "2025-10-12T10:30:00.000Z",
"updatedAt": "2025-10-12T10:30:00.000Z"
}

Get Event Template

Retrieves a specific event template by its ID.

HTTP Request

GET /api/v1/event-templates/{id}

Path Parameters

ParameterTypeRequiredDescription
idstring (uuid)YesThe unique identifier of the event template

Query Parameters

ParameterTypeRequiredDescription
withTrashedbooleanNoInclude trashed event templates

Response

Returns the EventTemplate object.

Example Response

{
"id": "123e4567-e89b-12d3-a456-426614174000",
"organizationId": "987e6543-e21a-34b5-c678-426614174000",
"registrationFormId": "456e7890-e12b-34c5-d678-426614174000",
"name": "Weekly Tech Talks",
"slug": "weekly-tech-talks",
"createdAt": "2025-10-12T10:30:00.000Z",
"updatedAt": "2025-10-12T10:30:00.000Z"
}

Update Event Template

Updates an existing event template.

HTTP Request

PUT /api/v1/event-templates/{id}

Path Parameters

ParameterTypeRequiredDescription
idstring (uuid)YesThe unique identifier of the event template

Request Body

All fields are optional. Only the fields you want to update need to be included.

FieldTypeDescription
namestringThe name of the event template (max 255 characters)
registrationFormIdstring (uuid)The registration form identifier associated with this template
fieldsarray of objectsThe fields configuration for the event template

Example Request Body

{
"name": "Updated Weekly Tech Talks",
"fields": [
{
"name": "capacity",
"description": "Maximum Capacity",
"fieldType": "number",
"FieldComponent": "input",
"required": true,
"isFilterable": true
},
{
"name": "location",
"description": "Event Location",
"fieldType": "text",
"FieldComponent": "input",
"required": true,
"isSearchable": true
},
{
"name": "speakerName",
"description": "Speaker Name",
"fieldType": "text",
"FieldComponent": "input",
"required": false,
"isSearchable": true
}
]
}

Response

Returns the updated EventTemplate object.


Search Event Templates

Retrieves a paginated list of event templates based on query parameters.

HTTP Request

GET /api/v1/event-templates

Query Parameters

ParameterTypeRequiredDescription
limitnumberNoMaximum number of items to return (default: 10, min: 1)
pagenumberNoPage number (starts at 1, default: 1, min: 1)
sortstringNoField name and direction to sort results by. Use "ASC" or "DESC". (default: "createdAt DESC")
withTrashedbooleanNoInclude soft-deleted event templates in the results

Example Request

GET /api/v1/event-templates?search=Tech&page=1&limit=20

Response

Returns a paginated response with an array of EventTemplate objects.

Example Response

{
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"organizationId": "987e6543-e21a-34b5-c678-426614174000",
"registrationFormId": "456e7890-e12b-34c5-d678-426614174000",
"name": "Weekly Tech Talks",
"slug": "weekly-tech-talks",
"createdAt": "2025-10-12T10:30:00.000Z",
"updatedAt": "2025-10-12T10:30:00.000Z"
}
],
"meta": {
"total": 1,
"page": 1,
"limit": 20,
"totalPages": 1
}
}

Delete Event Template

Deletes an event template by its ID.

HTTP Request

DELETE /api/v1/event-templates/{id}

Path Parameters

ParameterTypeRequiredDescription
idstring (uuid)YesThe unique identifier of the event template

Query Parameters

ParameterTypeRequiredDescription
withTrashedbooleanNoInclude trashed event templates

Response

Returns the deleted EventTemplate object.


EventTemplate Object

The EventTemplate object represents a reusable template for creating events.

Properties

PropertyTypeDescription
idstring (uuid)The unique identifier of the event template
organizationIdstring (uuid)The organization identifier that owns this event template
registrationFormIdstring (uuid)The registration form identifier associated with this template
namestringThe name of the event template
slugstringThe slug for the event template (URL-friendly identifier)
organizationobjectThe organization associated with the event template
createdAtstring (ISO 8601)The date and time when the template was created
updatedAtstring (ISO 8601)The date and time when the template was last updated
deletedAtstring (ISO 8601)The deletion date of the event template (if deleted)

Usage

Event templates are used to quickly create new events with predefined configurations. When creating an event, you can specify a templateId to apply the template's field definitions and settings to the new event. This ensures consistency across similar events and reduces the time needed to set up new events.