# Creating a specialty desk trip The steps below explain how to create Specialty Desk (SPD) trips from a template. | Step | Name | Endpoint | Details | | --- | --- | --- | --- | | 1. | [List templates](/openapi/templateapi#operation/listeventtemplates) (Optional) | `/v2/event-templates/list` | List all the templates that have been created for a company. **Request body requires:** `companyId` of the company. Alternatively, you can also use the event name to list all templates that match the name. **Note:** The request body also contains an optional `offset` and `limit` field to retrieve a paginated list of available templates. **Response will contain:** List of templates that match the request criteria, along with the `templateIds` and respective event details. **Other APIs will use:** `templateId` | | 1. | [Get template](/openapi/templateapi#operation/geteventtemplate) | `/v2/event-templates/{templateId}` | Retrieve a template. **URL path requires:** `templateId` from step 1. **Response will contain:** The `templateId` along with the event details that are mapped to the template such as the event name, description, location, payment sources, custom field responses, allowed travel types, and policy details. **Note:** Be sure to inherit details from the template by copying all relevant event details in the response and using them in the next step when creating a SPD trip **Other APIs will use:** `templateId` and the relevant event details in the response. | | 1. | [Create a SPD trip](/openapi/eventapi#operation/createevent) | `/v2/events` | Create a SPD trip (i.e., a draft event) and add a traveler to the event. In the API, an [SPD trip](/spotnana/spd_types#specialty-desk-spd-trip) refers to an event with `type` set to `PROGRAM_TRIP`. **Request body requires:** All the event details copied from step 2, the `parentEventId` (i.e., the `templateId` from step 2), `bookingStyle`, `type`, and the `travelerId`. In this workflow, the `type` must be set to `PROGRAM_TRIP`. When creating events using a template, you can only add 1 traveler per event. To add more travelers, create a new event (from the template) for each traveler. If you wish to override the event details copied from the template, then pass the new values in the request. For example, if you want to override the event location from the value copied from the template, then set the `location` field to the new location. **Response will contain:** `eventId` **Other APIs will use:** `eventId` **Note:** If creating multiple events from a template, store the generated `eventIds` in a persistent data storage location (e.g., local storage, a database) to enable bulk publishing in step 7. | | 1. | [Update event booking guidelines](/openapi/eventapi#operation/updateeventbookingguidelines) | `/v2/events/{eventId}/edit-booking-guidelines` | Update the booking guidelines for the draft event. Use this endpoint to override specific event details such as allowed booking types, payment mappings, and booking guidelines for the travel types (e.g., allowed airports). **URL path requires:** `eventId` from step 3. **Request body requires:** `bookingGuidelines`, `allowedBookingTypes`, and `paymentMappings` | | 1. | [Bulk edit events](/openapi/eventapi#operation/bulkeditevents) (Optional) | `/v2/events/bulk-edit` | Edit events (created from the template) in bulk with a single API call. **Request body requires:** An `eventsToUpdate` array object. This object can hold multiple `eventIds` and their respective event fields to be edited (e.g., event location, date, payment sources, etc.). **Response will contain:** An array of `eventIds` along with their edit status. The `updateEventResponse` > `status` field will contain `SUCCESS` or `FAILED` depending on whether the event edit has been successful or not. | | 1. | [Bulk cancel events](/openapi/eventapi/events/bulkcancelevents) (Optional) | `/v2/events/bulk-cancel` | Bulk cancel published events or bulk delete unpublished events. **Request body requires:** The `eventIds` to be canceled and the `type` must be set to `PROGRAM_TRIP`. **Response will contain:** An array of `eventIds` along with their cancellation status (i.e., `SUCCESS`, `FAILED`, or `PARTIAL_SUCCESS`). If the `cancelAsync` field is set to `true`, then use the [bulk processing job status](/spotnana/spd_bulk_process_status_workflow) workflow to know the cancellation status. **Note:** You can cancel an event only if all the bookings associated with the event are inactive (i.e., PNRs with status `CANCELLED`, `VOIDED`, `CANCELLED_BY_VENDOR`, `INOPERATIVE`, or `UNCONFIRMED`). | | 1. | [Bulk publish events](/openapi/eventapi#operation/bulkpublishevents) | `/v2/events/bulk-publish` | Publish events in bulk via a single API call. **Request body requires:** A `publishEventList` array object. This object can hold multiple draft `eventIds` to be published along with a `sendInvite` boolean flag which if set to `true` will send an event invite to the traveler added to the event. **Response will contain:** `eventIds` along with their publishing status (i.e., `SUCCESS` or `FAILED`). **Note:** Publishing the events will create the respective trips for the travelers. The travelers must login to the OBT to start creating their travel bookings for their trips. | ## Important notes - The `type` field cannot be modified after step 3. - When creating multiple SPD trips from the same template, it's recommended to store the `eventIds` generated in a persistent storage location (e.g., local storage, database) so they can be bulk published in step 7. - SPD trips created from a template can only contain one traveler. Repeat steps 3, 4, and 5 above if you need to add more travelers.