Managing templates
The following API endpoints can be used to create, update, view, and delete templates. Templates can be used to create specialty desk trips and session events.
Note: Only the user profiles with the role of
COMPANY_ADMIN
,COMPANY_TRAVEL_ARRANGER
,TRAVEL_ARRANGER
, orTMC_ADMIN
are allowed to create and manage templates.
Creating a new template
Name | Endpoint | Details |
---|---|---|
Create a new template | /v2/event-templates | Create a new template for a recurring company program. Request body contains: The event name, customFieldResponses , companyId , travelerTypes , and bookingStyle .Response will contain: templateId Other APIs will use: templateId Note: Payment sources cannot be mapped using this endpoint. After creating a new template, use the update template guidelines endpoint to map the payment source to the template. |
In the create a new template endpoint request there are optional fields such as the event description
, location
, allowedBookingTypes
, internalNotes
, etc. Any information provided in the request schema (i.e., both required and optional) of a template can be inherited when creating an SPD trip or a SPD session event from that template. For example, administrators can use the internalNotes
field to provide instructions to the event coordinators when they create a new SPD trip.
Ideally, a template should contain as much reusable information as possible. This allows the event coordinators to prefill most recurring information, making the SPD trip and the SPD event creation process faster and more efficient.
Updating a template
The following endpoints allow you to update an existing template.
Note: Use the get template endpoint to view template information before making any updates.
Name | Endpoint | Details |
---|---|---|
Update a template’s basic information | /v2/event-templates/{templateId}/edit-basic-info | Update a template’s basic information such as the name, description, internal notes, location, traveler types, booking style, and policy details. URL path requires: templateId generated using the create an event template endpoint.Request body requires: The event name , description , internalNotes , location , travelerTypes , bookingStyle , and policyId . Include these optional fields based on which information you’d like to update. |
Update a template’s booking guidelines | /v2/event-templates/{templateId}/edit-booking-guidelines | Update a template’s booking guidelines such as allowed booking types (e.g., air, hotel, etc.), booking guidelines (e.g., allowed airports, departure and arrival windows, etc), and payment mappings. URL path requires: templateId generated using the create an event template endpoint.Request body requires: The event bookingGuidelines , allowedBookingTypes , and paymentMappings . |
Update a template’s custom field responses | /v2/event-templates/{templateId}/custom-field-responses | Update the template’s custom field responses that are presented to a traveler during checkout. URL path requires: templateId generated using the create an event template endpoint.Request body requires: The customFieldId , responseItems , and travelerAccess (e.g., READ_ACCESS ). |