# Creating and Publishing an event The steps below explain how to create and publish a new event on Spotnana. > **Note:** The steps marked as **Optional** indicate APIs that can be executed during and/or after completing the workflow. | Step | Name | Endpoint | Details | | --- | --- | --- | --- | | 1. | [Create event](/openapi/eventapi#operation/createEvent) | `/v2/events` | Create a draft version of an event.**Response will contain:** `eventId` **Other APIs will use:** `eventId` | | 2. | [Update event booking guidelines](/openapi/eventapi#operation/updateEventBookingGuidelines) | `/v2/events/{eventId}/edit-booking-guidelines` | Update the booking guidelines for a draft or a published event. The event coordinator can update booking guidelines such as maximum number of guests allowed to accompany a traveler, arrival and departure window for the event, payment methods, and allowed travel types.**URL path requires:** `eventId` from step 1. **Request body requires:** `bookingGuidelines`, `allowedBookingTypes`, and `paymentMappings` **Response will contain:** `eventId` | | 3. | [Add travelers to an event](/openapi/eventapi#operation/addTravelersToEvent) | `/v2/events/{eventId}/travelers/add` | Add the list of travelers who are supposed to be attending the event. A draft event must have at least one traveler added before it can be published in step 5. Additional travelers can also be added after the event has been published. **URL path requires:** `eventId` from step 1. **Request body requires:** An array of `userIds`. The user details such as their `userId`, name, and email can be accessed using the [query user](/openapi/usersapi#operation/queryUser) API. **Response will contain:** `addedUserIds` | | 4. | [Remove travelers from an event](/openapi/eventapi#operation/removeTravelersFromEvent) (Optional) | `/v2/events/{eventId}/travelers/remove` | Remove travelers from an event. The event coordinator can remove up to 10 travelers per API call. **URL path requires:** `eventId` from step 1. **Request body requires:** An array of `userIds` (maximum allowed is 10 `userIds` per API call). **Response will contain:** An array of `removedUserIds` | | 5. | [Publish an event](/openapi/eventapi#operation/publishEvent) | `/v2/events/{eventId}/publish` | Publish a draft event. Publishing an event will not trigger any invites. The invites have to be sent using the [send invite](/openapi/eventapi#operation/sendInvite) API in step 6. **URL path requires:** `eventId` from step 1. **Response will contain:** `eventId` | | 6. | [Send invite](/openapi/eventapi#operation/sendInvite) | `/v2/events/{eventId}/invite/send` | Send event invites to the travelers. The invites can be sent to all travelers using a single API call, or you can send invites to specific travelers. **URL path requires:** `eventId` from step 1. **Request body requires:** `userIds` (This is optional if the invites are being sent to all travelers). | | 7. | [Send a test invite](/openapi/eventapi#operation/testInvite) (Optional) | `/v2/events/{eventId}/invite/test` | Send a test event invite to the API caller. As an event coordinator, this endpoint is useful to preview an invite before sending it to the travelers. **URL path requires:** `eventId` from step 1. | | 8. | [Get allowed payment sources](/openapi/eventapi#operation/getAllowedPaymentSources) | `/v2/events/payment-sources` | Retrieve the payment sources that are mapped to the `userId` of the event coordinator. **Request body requires:** `userId` of the event coordinator. **Response will contain:** The list of `paymentSources` that are mapped to the requested `userId`. The event coordinator can choose the payment sources from this response and use the [update event booking guidelines](/openapi/eventapi#operation/updateEventBookingGuidelines) API in step 2 to map it to the event. **Other APIs will use:** `paymentSources` > `id`. The event coordinator can choose the payment source IDs from this response and use the [update event booking guidelines](/openapi/eventapi#operation/updateEventBookingGuidelines) API in step 2 to map it to the event. This will ensure that the travelers are booking using the payment sources mapped to the event. | | 9. | [Get company questions](/openapi/policyapi#operation/getCompanyQuestions) | `/v2/companies/{companyId}/questions` | Retrieve all custom fields. A company administrator may have configured a set of questions when creating a travel policy. This API returns the list of all the questions for a `companyId`. **URL path requires:** `companyId`. The company ID can be accessed using the [get company](/openapi/companyapi#operation/readCompany) API.**Response will contain:** A list of elements which contain question `id` and `name` (e.g., What is the purpose of your trip?). **Other APIs will use:** `id` (Also referred to as `questionId` in step 10 and `customFieldId` in step 11). | | 10. | [Get a company question](/openapi/policyapi#operation/getCompanyQuestion) | `/v2/companies/{companyId}/questions/{questionId}` | Retrieve one specific question and its details. **URL path requires:** `companyId` from the [get company](/openapi/companyapi#operation/readCompany) API and `questionId` from step 9. **Response will contain:** The question `id`, its `name`, and `matchConditions`. The custom fields with `matchConditions` > `tripUsageTypes` field containing the value as `EVENT` (or of it's empty) can be added to the event. | | 11. | [Update custom field responses](/openapi/eventapi#operation/updateCustomFieldResponses) | `/v2/events/{eventId}/custom-field-responses` | Provide a response to a custom field question. The response to a question can be updated either by the traveler or the event coordinator on behalf of the traveler. In both cases, the response text has to be provided in the request `responseItems` > `response` field.**URL path requires:** `eventId` from step 1.**Request body requires:** An array of `eventCustomFieldResponses` which contains the `customFieldId` from step 9 and `responseItems`. |