# Create company question (deprecated)

Endpoint: POST /v2/companies/{companyId}/questions
Version: v2
Security: Bearer

## Security:

  - `Bearer` (unknown)
    http bearer

## Path parameters:

  - `companyId` (string, required)
    Identifier for company.

## Request fields (application/json):

  - `name` (string, required)
    Question display name that the user will see. For eg, 'Choose the purpose of your trip'.

  - `questionFormat` (string, required)
    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"

  - `optionInfo` (object)
    Options related information for the question.

  - `optionInfo.source` (string, required)
    Option source
    Enum: "MANUAL", "COMPANY_CONFIG"

  - `optionInfo.sourceMetadata` (object)
    Metadata information for the option source.

  - `optionInfo.sourceMetadata.companyConfig` (object)
    For this option source, options would be auto generated based on specified parameter.

  - `optionInfo.sourceMetadata.companyConfig.optionsParam` (string, required)
    Parameter to form options for the custom field.
    Enum: "COST_CENTER", "LEGAL_ENTITY", "OFFICE", "DEPARTMENT"

  - `optionInfo.totalNumOptions` (integer)
    Total number of options

  - `optionInfo.options` (array)
    Available options for the question. This will contain only max 10 options if only 
summary is requested.

  - `optionInfo.options.displayCode` (string, required)
    The code which is sent in answer response.

  - `optionInfo.options.displayValue` (string)
    The text to be displayed to the user beside this option.

  - `isRequired` (boolean, required)
    Whether its compulsory to answer the question or not.
    Example: true

  - `isDisabled` (boolean, required)
    Whether the question is disabled or not. If true, this should not be asked.
    Example: false

  - `includeInItinerary` (boolean)
    Whether to include this question in the itinerary related emails.
    Example: true

  - `customFieldLocations` (array)

  - `matchConditions` (object)
    Conditions to select the custom field for given context.

  - `matchConditions.travelerConditions` (object)
    Matching conditions for traveler.

  - `matchConditions.travelerConditions.workerTypes` (array)
    Worker types. Users belonging to any of these would match.

  - `matchConditions.travelerConditions.countries` (array)
    Countries.

  - `matchConditions.travelerConditions.legalEntities` (array)
    Legal entities

  - `matchConditions.travelerConditions.legalEntities.id` (string, required)
    Example: b93dc51f-12dd-46c7-b7d6-1cb12cd3f5b3

  - `matchConditions.travelerConditions.legalEntities.name` (string)
    Example: Name

  - `matchConditions.travelerConditions.departments` (array)
    Departments

  - `matchConditions.travelerConditions.costCenters` (array)
    Cost centers

  - `matchConditions.travelerConditions.offices` (array)
    Offices

  - `matchConditions.travelTypes` (array)
    Travel types to match.

  - `matchConditions.travelRegionTypes` (array)
    Travel region types to match.

  - `matchConditions.tripUsageTypes` (array)
    Trip usage types to match. If empty, all trip usage types will be matched.

## Response 200:

  - `200` (unknown)
    OK

## Response 200 fields (application/json):

  - `id` (string, required)
    Example: b93dc51f-12dd-46c7-b7d6-1cb12cd3f5b3

## Response 401:

  - `401` (unknown)
    Unauthorized

## 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:

  - `403` (unknown)
    Forbidden

## 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.

## Response 404:

  - `404` (unknown)
    The specified resource was not found.

## Response 404 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.

