# Create policy This endpoint creates a policy. Endpoint: POST /v2/companies/{companyId}/policies Version: v2 Security: Bearer ## Path parameters: - `companyId` (string, required) Identifier for company. Example: "4974a66b-7493-4f41-908c-58ba81093947" ## Request fields (application/json): - `name` (string, required) Name of the policy. - `type` (string, required) Policy type. Enum: "DEFAULT", "GROUP", "INTERNAL" - `parentPolicyId` (string) Policy to inherit the values of linked rules. If empty, consider the company default policy. Example: "f7b3b3b3-7b3b-4b3b-8b3b-3b3b3b3b3b3b" - `currency` (any, required) - `inPolicyApprovalInfos` (array) - `inPolicyApprovalInfos.approvalProcessType` (string, required) Enum: "NONE", "SOFT_APPROVAL", "HARD_APPROVAL", "PASSIVE_APPROVAL", "PREVENT_BOOKING" - `inPolicyApprovalInfos.designatedApprovers` (array) List of designated approvers. - `inPolicyApprovalInfos.designatedApprovers.id` (string, required) - `inPolicyApprovalInfos.isManagerApprover` (boolean) - `inPolicyApprovalInfos.isEmployeeLevelDesignatedApprover` (boolean) Indicate whether the policy is approved by employee level designated approver or not. - `inPolicyApprovalInfos.shouldNotifyManager` (boolean) Indicate whether approval emails should be cc'ed to manager or not. - `inPolicyApprovalInfos.travelTypes` (array) List of travel types for which this ApprovalInfo is applicable. Enum: "AIR", "HOTEL", "RAIL", "CAR" - `inPolicyApprovalInfos.approvalConditions` (array) List of approval conditions. OR operator is applied between the approval conditions. - `inPolicyApprovalInfos.approvalConditions.rules` (array) - `inPolicyApprovalInfos.defaultApprovers` (array) List of designated default approvers. - `outOfPolicyApprovalInfos` (array) - `outOfPolicyAgentApprovalInfos` (array) - `enableAgentActionOverride` (boolean) True if agent can override the PREVENT_BOOKING action. If enabled, outOfPolicyAgentApprovalInfos for all travel types should be provided. - `userGroups` (array, required) - `userGroups.userIds` (array) - `userGroups.legalEntityIds` (array) - `userGroups.officeIds` (array) - `userGroups.departments` (array) List of department ids. - `userGroups.costCenters` (array) List of cost center ids. - `userGroups.grades` (array) List of grade ids. - `userGroups.positionTitles` (array) - `userGroups.personas` (array) Enum: "UNKNOWN_PERSONA", "EMPLOYEE", "GUEST", "PERSONAL", "RELATIVE", "ADHOC" - `userGroups.countryCodes` (array) Example: ["GB"] - `userGroups.workerTypes` (array) Enum: "EMPLOYEE", "CONTINGENT", "SEASONAL", "INTERN", "GUEST" - `userGroups.accountingCodes` (array) - `userGroups.customFieldIds` (array) - `userGroups.customFieldIds.type` (string, required) The type of custom field. Enum: "QUESTION", "MEETING", "BUDGET", "BREX_TOKEN" - `userGroups.customFieldIds.externalId` (string, required) Meeting id or budget id based on custom field type. - `commonPolicyRules` (object) Details of policy that is common to all travel type. - `commonPolicyRules.restrictedContinents` (any) - `commonPolicyRules.restrictedCountries` (any) - `carPolicyRules` (object) Details of rules related to car. - `carPolicyRules.maxCarPricePerNumberOfDays` (any) - `carPolicyRules.allowedCarTypes` (any) - `hotelPolicyRules` (object) Details of rules related to hotel. - `hotelPolicyRules.restrictedHotels` (any) - `hotelPolicyRules.maxHotelPriceByLocation` (any) - `hotelPolicyRules.hotelAdvanceBookingWindow` (any) - `hotelPolicyRules.hotelCancellation` (any) - `hotelPolicyRules.hotelChainCodes` (any) - `hotelPolicyRules.hotelStarRating` (any) - `hotelPolicyRules.hotelMedianRateNightly` (any) - `airPolicyRules` (object) Details of rules related to air. - `airPolicyRules.restrictedAirlines` (any) - `airPolicyRules.restrictedAirCrafts` (any) - `airPolicyRules.maxFlightBookingPriceByDuration` (any) - `airPolicyRules.flightCabinUpgrade` (any) - `airPolicyRules.flightAdvanceBookingWindow` (any) - `airPolicyRules.flightTicketsRefundable` (any) - `airPolicyRules.flightTicketsChangeable` (any) - `airPolicyRules.highestFlightCabinByDurationDomestic` (any) - `airPolicyRules.highestFlightCabinByDurationInternational` (any) - `airPolicyRules.highestFlightCabinOvernight` (any) - `airPolicyRules.differenceBetweenFlightFareAndMedianFare` (any) - `airPolicyRules.co2EmissionPerPassengerPerKm` (any) - `airPolicyRules.maxFlightBookingPriceInternational` (any) - `airPolicyRules.maxFlightBookingPriceDomestic` (any) - `airPolicyRules.lowestLogicalFare` (any) - `rules` (array) A list of general policy rules for all travel types air, hotel, car and rail. - `rules.ruleType` (string, required) Policy Rule type. Enum: "BASIC_ECONOMY_FARES_DOMESTIC", "BASIC_ECONOMY_FARES_INTERNATIONAL", "CABIN_CLASS_NOT_ALLOWED_DOMESTIC", "CABIN_CLASS_NOT_ALLOWED_INTERNATIONAL", "HOTEL_RATE_CONDITIONS_NOT_ALLOWED", "CAR_TYPES_NOT_ALLOWED", "RAIL_ADVANCE_BOOKING_WINDOW", "MAX_RAIL_BOOKING_PRICE_BY_DURATION", "HIGHEST_RAIL_TRAVEL_CLASS_BY_DURATION", "RAIL_TICKETS_REFUNDABLE", "HOTEL_RESTRICTED_KEYWORDS", "FLIGHT_ADVANCE_BOOKING_WINDOW_DOMESTIC", "FLIGHT_ADVANCE_BOOKING_WINDOW_INTERNATIONAL", "ALLOWED_AIR_ADDONS", "MAX_HOTEL_BOOKING_PRICE", "CAR_ENGINE_TYPES_NOT_ALLOWED", "LOWEST_FARE_PER_HOTEL_PROPERTY", "AIR_RESTRICTED_FARES", "RESTRICT_AIRPORT_TRANSFERS" - `rules.action` (any) - `rules.policyValue` (any) - `airOopReasonCodes` (any) - `hotelOopReasonCodes` (any) - `carOopReasonCodes` (any) - `railOopReasonCodes` (any) - `category` (string) Category of the policy. Enum: "EMPLOYEE", "GUEST" - `inPolicyApprovalInfo` (object) - `outOfPolicyApprovalInfo` (object) - `isRestrictive` (boolean) True if policy is a restrictive policy. Example: true ## Response 201 fields (application/json): - `id` (string, required) Example: "b93dc51f-12dd-46c7-b7d6-1cb12cd3f5b3" ## Response 400 fields (application/json): - `debugIdentifier` (string) Link to debug the error internally. - `errorMessages` (array) - `errorMessages.errorCode` (string) Error code to identify the specific errors. - `errorMessages.message` (string) Message containing details of error. - `errorMessages.errorParameters` (array) Error message parameters. - `errorMessages.errorParameters.name` (string) Parameter name - `errorMessages.errorParameters.value` (string) Parameter value - `errorMessages.errorDetail` (string) More details about the error. ## Response 401 fields (application/json): - `debugIdentifier` (string) Link to debug the error internally. - `errorMessages` (array) - `errorMessages.errorCode` (string) Error code to identify the specific errors. - `errorMessages.message` (string) Message containing details of error. - `errorMessages.errorParameters` (array) Error message parameters. - `errorMessages.errorParameters.name` (string) Parameter name - `errorMessages.errorParameters.value` (string) Parameter value - `errorMessages.errorDetail` (string) More details about the error. ## Response 403 fields (application/json): - `debugIdentifier` (string) Link to debug the error internally. - `errorMessages` (array) - `errorMessages.errorCode` (string) Error code to identify the specific errors. - `errorMessages.message` (string) Message containing details of error. - `errorMessages.errorParameters` (array) Error message parameters. - `errorMessages.errorParameters.name` (string) Parameter name - `errorMessages.errorParameters.value` (string) Parameter value - `errorMessages.errorDetail` (string) More details about the error.