Policy API (v2)

Download OpenAPI specification:Download

Company Policies

APIs to configure company travel policies.

Create policy

This endpoint creates a policy.

SecurityBearer
Request
path Parameters
companyId
required
string <uuid>

Identifier for company.

Example: 4974a66b-7493-4f41-908c-58ba81093947
Request Body schema: application/json
name
required
string

Name of the policy.

type
required
string (PolicyType)

Policy type.

Enum: "DEFAULT" "GROUP" "INTERNAL"
parentPolicyId
string <uuid>

Policy to inherit the values of linked rules. If empty, consider the company default policy.

required
CurrencyCodeWrapper (object) or IsLinkedWrapper (object) (PolicyCurrency)
object (PolicyApprovalInfo)
Deprecated
object (PolicyApprovalInfo)
Deprecated
Array of objects (PolicyApprovalInfo)
Array of objects (PolicyApprovalInfo)
required
Array of objects (UserGroup)
object (CommonPolicyRules)

Details of policy that is common to all travel type.

object (CarPolicyRules)

Details of rules related to car.

object (HotelPolicyRules)

Details of rules related to hotel.

object (AirPolicyRules)

Details of rules related to air.

isRestrictive
boolean
Deprecated

True if policy is a restrictive policy.

Array of objects (UniversalRule)

A list of general policy rules for all travel types air, hotel, car and rail.

OopReasonCodesPropsWrapper (object) or IsLinkedWrapper (object) (OopReasonCodes)
OopReasonCodesPropsWrapper (object) or IsLinkedWrapper (object) (OopReasonCodes)
OopReasonCodesPropsWrapper (object) or IsLinkedWrapper (object) (OopReasonCodes)
OopReasonCodesPropsWrapper (object) or IsLinkedWrapper (object) (OopReasonCodes)
category
string (PolicyCategory)
Default: "EMPLOYEE"

Category of the policy.

Enum: "EMPLOYEE" "GUEST"
Responses
201

Created

400

Bad request

401

Unauthorized

403

Forbidden

post/v2/companies/{companyId}/policies
Request samples
application/json
{
  • "name": "string",
  • "type": "GROUP",
  • "parentPolicyId": "f7b3b3b3-7b3b-4b3b-8b3b-3b3b3b3b3b3b",
  • "currency": {
    },
  • "inPolicyApprovalInfo": {
    },
  • "outOfPolicyApprovalInfo": {
    },
  • "inPolicyApprovalInfos": [
    ],
  • "outOfPolicyApprovalInfos": [
    ],
  • "userGroups": [
    ],
  • "commonPolicyRules": {
    },
  • "carPolicyRules": {
    },
  • "hotelPolicyRules": {
    },
  • "airPolicyRules": {
    },
  • "isRestrictive": true,
  • "rules": [
    ],
  • "airOopReasonCodes": {
    },
  • "hotelOopReasonCodes": {
    },
  • "carOopReasonCodes": {
    },
  • "railOopReasonCodes": {
    },
  • "category": "EMPLOYEE"
}
Response samples
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

List company policies

This endpoint list company policies.

SecurityBearer
Request
path Parameters
companyId
required
string <uuid>

Identifier for company.

Example: 4974a66b-7493-4f41-908c-58ba81093947
query Parameters
categories
Array of strings (PolicyCategory)

Filter policies by categories. Defaults to EMPLOYEE if not provided.

Items Enum: "EMPLOYEE" "GUEST"
Example: categories=EMPLOYEE
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

get/v2/companies/{companyId}/policies
Request samples
Response samples
application/json
{
  • "length": 0,
  • "elements": [
    ]
}

Get policy

This endpoint gets a policy by ID.

SecurityBearer
Request
path Parameters
companyId
required
string <uuid>

Identifier for company.

Example: 4974a66b-7493-4f41-908c-58ba81093947
policyId
required
string <uuid>

Identifier for policy.

Example: 4974a66b-7493-4f41-908c-58ba81093947
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

get/v2/companies/{companyId}/policies/{policyId}
Request samples
Response samples
application/json
{
  • "id": "4974a66b-7493-4f41-908c-58ba81093947",
  • "version": 0,
  • "updatedAt": {
    },
  • "isMembershipViaHrFeed": true,
  • "hrFeedPolicyDetails": {
    },
  • "name": "string",
  • "type": "GROUP",
  • "parentPolicyId": "f7b3b3b3-7b3b-4b3b-8b3b-3b3b3b3b3b3b",
  • "currency": {
    },
  • "inPolicyApprovalInfo": {
    },
  • "outOfPolicyApprovalInfo": {
    },
  • "inPolicyApprovalInfos": [
    ],
  • "outOfPolicyApprovalInfos": [
    ],
  • "userGroups": [
    ],
  • "commonPolicyRules": {
    },
  • "carPolicyRules": {
    },
  • "hotelPolicyRules": {
    },
  • "airPolicyRules": {
    },
  • "isRestrictive": true,
  • "rules": [
    ],
  • "airOopReasonCodes": {
    },
  • "hotelOopReasonCodes": {
    },
  • "carOopReasonCodes": {
    },
  • "railOopReasonCodes": {
    },
  • "category": "EMPLOYEE"
}

Update policy

This endpoint updates a policy by ID.

SecurityBearer
Request
path Parameters
companyId
required
string <uuid>

Identifier for company.

Example: 4974a66b-7493-4f41-908c-58ba81093947
policyId
required
string <uuid>

Identifier for policy.

Example: 4974a66b-7493-4f41-908c-58ba81093947
Request Body schema: application/json
id
required
string <uuid>
version
integer <int32>
object (DateTimeOffset)

ISO8601 UTC Date Time

isMembershipViaHrFeed
boolean

True if membership is via HR feed. Read-only.

object (HrFeedPolicyDetails)

User group details if membership is via HR feed. Read-only.

name
required
string

Name of the policy.

type
required
string (PolicyType)

Policy type.

Enum: "DEFAULT" "GROUP" "INTERNAL"
parentPolicyId
string <uuid>

Policy to inherit the values of linked rules. If empty, consider the company default policy.

required
CurrencyCodeWrapper (object) or IsLinkedWrapper (object) (PolicyCurrency)
object (PolicyApprovalInfo)
Deprecated
object (PolicyApprovalInfo)
Deprecated
Array of objects (PolicyApprovalInfo)
Array of objects (PolicyApprovalInfo)
required
Array of objects (UserGroup)
object (CommonPolicyRules)

Details of policy that is common to all travel type.

object (CarPolicyRules)

Details of rules related to car.

object (HotelPolicyRules)

Details of rules related to hotel.

object (AirPolicyRules)

Details of rules related to air.

isRestrictive
boolean
Deprecated

True if policy is a restrictive policy.

Array of objects (UniversalRule)

A list of general policy rules for all travel types air, hotel, car and rail.

OopReasonCodesPropsWrapper (object) or IsLinkedWrapper (object) (OopReasonCodes)
OopReasonCodesPropsWrapper (object) or IsLinkedWrapper (object) (OopReasonCodes)
OopReasonCodesPropsWrapper (object) or IsLinkedWrapper (object) (OopReasonCodes)
OopReasonCodesPropsWrapper (object) or IsLinkedWrapper (object) (OopReasonCodes)
category
string (PolicyCategory)
Default: "EMPLOYEE"

Category of the policy.

Enum: "EMPLOYEE" "GUEST"
Responses
204

Updated Successfully

400

Bad request

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

put/v2/companies/{companyId}/policies/{policyId}
Request samples
application/json
{
  • "id": "4974a66b-7493-4f41-908c-58ba81093947",
  • "version": 0,
  • "updatedAt": {
    },
  • "isMembershipViaHrFeed": true,
  • "hrFeedPolicyDetails": {
    },
  • "name": "string",
  • "type": "GROUP",
  • "parentPolicyId": "f7b3b3b3-7b3b-4b3b-8b3b-3b3b3b3b3b3b",
  • "currency": {
    },
  • "inPolicyApprovalInfo": {
    },
  • "outOfPolicyApprovalInfo": {
    },
  • "inPolicyApprovalInfos": [
    ],
  • "outOfPolicyApprovalInfos": [
    ],
  • "userGroups": [
    ],
  • "commonPolicyRules": {
    },
  • "carPolicyRules": {
    },
  • "hotelPolicyRules": {
    },
  • "airPolicyRules": {
    },
  • "isRestrictive": true,
  • "rules": [
    ],
  • "airOopReasonCodes": {
    },
  • "hotelOopReasonCodes": {
    },
  • "carOopReasonCodes": {
    },
  • "railOopReasonCodes": {
    },
  • "category": "EMPLOYEE"
}
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}

Delete policy

This endpoint deletes a policy by ID.

SecurityBearer
Request
path Parameters
companyId
required
string <uuid>

Identifier for company.

Example: 4974a66b-7493-4f41-908c-58ba81093947
policyId
required
string <uuid>

Identifier for policy.

Example: 4974a66b-7493-4f41-908c-58ba81093947
Responses
204

No Content

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

delete/v2/companies/{companyId}/policies/{policyId}
Request samples
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}

Custom Fields

APIs to manage company custom fields.

Get company questions

SecurityBearer
Request
path Parameters
companyId
required
string <uuid>

Identifier for company.

Example: 4974a66b-7493-4f41-908c-58ba81093947
Responses
200

OK

401

Unauthorized

403

Forbidden

get/v2/companies/{companyId}/questions
Request samples
Response samples
application/json
{
  • "length": 0,
  • "elements": [
    ]
}

Create company question

SecurityBearer
Request
path Parameters
companyId
required
string <uuid>

Identifier for company.

Example: 4974a66b-7493-4f41-908c-58ba81093947
Request Body schema: application/json
name
required
string

Question display name that the user will see. For eg, 'Choose the purpose of your trip'.

questionFormat
required
string (QuestionFormat)

Question types. INPUT_BOX will make user enter a free flowing text. RADIO_BUTTON will have multiple options, user can select only one. CHECKBOX questions contain the possible set of options, from which the user can choose multiple options. CHECKBOX_WITH_PERCENTAGE is similar to checkbox, with the difference being that each option having an additional input field whose values must add up to 100.

Enum: "INPUT_BOX" "RADIO_BUTTON" "CHECKBOX" "CHECKBOX_WITH_PERCENTAGE"
object (OptionInfo)

Options related information for the question.

isRequired
required
boolean
Default: false

Whether its compulsory to answer the question or not.

isDisabled
required
boolean
Default: true

Whether the question is disabled or not. If true, this should not be asked.

includeInItinerary
boolean
Deprecated
Default: false

Whether to include this question in the itinerary related emails.

customFieldLocations
Array of strings (CustomFieldLocation)
Items Enum: "POLICY_APPROVAL_EMAIL" "PNR_EMAIL" "TRIP_EMAIL"
object (CustomFieldMatchConditions)

Conditions to select the custom field for given context.

Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

post/v2/companies/{companyId}/questions
Request samples
application/json
{
  • "name": "string",
  • "questionFormat": "CHECKBOX",
  • "optionInfo": {
    },
  • "isRequired": true,
  • "isDisabled": false,
  • "includeInItinerary": true,
  • "customFieldLocations": [
    ],
  • "matchConditions": {
    }
}
Response samples
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

Get company question

SecurityBearer
Request
path Parameters
companyId
required
string <uuid>

Identifier for company.

Example: 4974a66b-7493-4f41-908c-58ba81093947
questionId
required
string <uuid>

Identifier for question.

Example: 1234a66b-7493-4f41-908c-58ba81093947
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

get/v2/companies/{companyId}/questions/{questionId}
Request samples
Response samples
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "string",
  • "questionFormat": "CHECKBOX",
  • "optionInfo": {
    },
  • "isRequired": true,
  • "isDisabled": true,
  • "includeInItinerary": true,
  • "customFieldLocations": [
    ],
  • "matchConditions": {
    },
  • "questionType": {
    }
}

Update company question

SecurityBearer
Request
path Parameters
companyId
required
string <uuid>

Identifier for company.

Example: 4974a66b-7493-4f41-908c-58ba81093947
questionId
required
string <uuid>

Identifier for question.

Example: 1234a66b-7493-4f41-908c-58ba81093947
Request Body schema: application/json
id
required
string <uuid>
name
required
string

Question display name that the user will see. For eg, 'Choose the purpose of your trip'.

questionFormat
string (QuestionFormat)

Question types. INPUT_BOX will make user enter a free flowing text. RADIO_BUTTON will have multiple options, user can select only one. CHECKBOX questions contain the possible set of options, from which the user can choose multiple options. CHECKBOX_WITH_PERCENTAGE is similar to checkbox, with the difference being that each option having an additional input field whose values must add up to 100.

Enum: "INPUT_BOX" "RADIO_BUTTON" "CHECKBOX" "CHECKBOX_WITH_PERCENTAGE"
object (OptionInfo)

Options related information for the question.

isRequired
required
boolean
Default: false

Whether its compulsory to answer the question or not.

isDisabled
required
boolean
Default: true

Whether the question is disabled or not. If true, this should not be asked.

includeInItinerary
boolean
Deprecated
Default: false

Whether to include this question in the itinerary related emails.

customFieldLocations
Array of strings (CustomFieldLocation)
Items Enum: "POLICY_APPROVAL_EMAIL" "PNR_EMAIL" "TRIP_EMAIL"
object (CustomFieldMatchConditions)

Conditions to select the custom field for given context.

object (QuestionType)

Question type.

Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

put/v2/companies/{companyId}/questions/{questionId}
Request samples
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "string",
  • "questionFormat": "CHECKBOX",
  • "optionInfo": {
    },
  • "isRequired": true,
  • "isDisabled": true,
  • "includeInItinerary": true,
  • "customFieldLocations": [
    ],
  • "matchConditions": {
    },
  • "questionType": {
    }
}
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}

Delete company question

SecurityBearer
Request
path Parameters
companyId
required
string <uuid>

Identifier for company.

Example: 4974a66b-7493-4f41-908c-58ba81093947
questionId
required
string <uuid>

Identifier for question.

Example: 1234a66b-7493-4f41-908c-58ba81093947
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

delete/v2/companies/{companyId}/questions/{questionId}
Request samples
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}
Copyright © 2020-2024 Spotnana Technology, Inc.