Skip to content

Create a Booking Event Template

POST
/businesses/{businessId}/notifications/booking-event-templates
curl --request POST \
--url https://api.upvio.com/v1/businesses/example/notifications/booking-event-templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "event": "APPOINTMENT_CREATED", "type": "EMAIL", "recipient": "BUSINESS_OWNER", "serviceIds": [ "example" ], "messageTemplate": { "type": "email", "subject": "example", "content": "example" } }'

Create a new booking event notification template.

businessId
required

The ID of the Business.

string
Media typeapplication/json
Booking Event Template Create Input
object
event
required

The booking event that triggers this notification.

string
Allowed values: APPOINTMENT_CREATED APPOINTMENT_UPDATED APPOINTMENT_DELETED RECURRING_APPOINTMENT_CREATED RECURRING_APPOINTMENT_UPDATED RECURRING_APPOINTMENT_DELETED
type
required

The type of notification (EMAIL or SMS).

string
Allowed values: EMAIL SMS
recipient
required

The recipient of the notification.

string
Allowed values: BUSINESS_OWNER GUESTS PATIENT STAFF
serviceIds

The IDs of the services this template applies to. Defaults to an empty array (all services).

Array<string>
messageTemplate

Custom message template override.

object
type
required

The message template type.

string
Allowed values: email sms
subject
required

The email subject line.

string
content
required

The message content with template variables.

string

The created Booking Event Template.

Media typeapplication/json
object
data
object
id

Unique identifier across the platform.

string format: uuid
createdAt

Time when the resource was created (ISO 8601 format).

string format: date-time
updatedAt

Time when the resource was last updated (ISO 8601 format).

string format: date-time
businessId

The ID of the business this template belongs to.

string format: uuid
serviceIds

The IDs of the services this template applies to. An empty array means all services.

Array<string>
event

The booking event that triggers this notification.

string
type

The type of notification (EMAIL or SMS).

string
Allowed values: EMAIL SMS
recipient

The recipient of the notification.

string
enabled

Whether this template is enabled.

boolean
messageTemplate

Custom message template override. Null if using the default.

object
id

The unique identifier for the message template.

string
type

The message template type.

string
Allowed values: email sms
subject

The email subject line.

string
content

The message content with template variables.

string
defaultTemplate

The default message template for this event, type, and recipient combination.

object
id

The unique identifier for the message template.

string
type

The message template type.

string
Allowed values: email sms
subject

The email subject line.

string
content

The message content with template variables.

string

Example

{
"data": {
"type": "EMAIL",
"messageTemplate": {
"type": "email"
},
"defaultTemplate": {
"type": "email"
}
}
}

The template data is invalid. The title lists each validation issue, prefixed with the field it applies to.

Media typeapplication/json
object
error
object
code
number
type

The specific error that occurred.

string
Allowed values: BadRequestError
title

Human-readable description of the error.

string

Example

{
"error": {
"code": 400,
"type": "BadRequestError",
"title": "event: Invalid option: expected one of \"APPOINTMENT_CREATED\"|\"APPOINTMENT_DELETED\"|\"APPOINTMENT_UPDATED\"|\"RECURRING_APPOINTMENT_CREATED\"|\"RECURRING_APPOINTMENT_DELETED\"|\"RECURRING_APPOINTMENT_UPDATED\""
}
}

The API key is missing or invalid, or the Business cannot be accessed with it.

Media typeapplication/json
object
error
object
code
number
type

The specific error that occurred.

string
Allowed values: UnauthorizedError BusinessArchivedError BusinessDisabledError
title

Human-readable description of the error.

string

Example

{
"error": {
"code": 403,
"type": "UnauthorizedError",
"title": "Invalid API token"
}
}

The Business does not exist.

Media typeapplication/json
object
error
object
code
number
type

The specific error that occurred.

string
Allowed values: NotFoundError BusinessNotFoundError
title

Human-readable description of the error.

string

Example

{
"error": {
"code": 404,
"type": "BusinessNotFoundError",
"title": "Business not found"
}
}