# Create custom field arm

This endpoint creates a custom field arm.

Endpoint: POST /v3/companies/{companyId}/custom-fields/{customFieldId}/arms
Version: v3
Security: Bearer

## Security:

  - `Bearer` (unknown)
    http bearer

## Path parameters:

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

  - `customFieldId` (string, required)
    Identifier for custom field.

## Request fields (application/json):

  - `name` (string, required)
    Name of the arm.
    Example: US Employee

  - `audiences` (array)

  - `audiences.name` (string, required)
    Name of the audience.
    Example: US Employee

  - `audiences.predicates` (array)

  - `audiences.predicates.type` (string, required)
    Enum: "BOOKING_TYPE", "BOOKING_INITIATOR_TYPE", "TRIP_USAGE_TYPE", "TRAVEL_REGION_TYPE", "DESTINATION_COUNTRY", "DESTINATION_CITY", "ORIGIN_CITY", "ORIGIN_COUNTRY", "PREFERRED_VENDOR_TYPE", "SEARCH_COUNTRY", "LEGAL_ENTITY", "DEPARTMENT", "OFFICE", "COST_CENTER", "WORKER_TYPE", "TRAVELER_LEGAL_ENTITY_COUNTRY", "TRAVELER_PERSONA", "TRAVELER_COUNTRY", "POLICY", "CUSTOM_FIELD_RESPONSE", "BOOKING_FLOW_TYPE", "PNR_CREATION_PROCESS_TYPE", "POLICY_ACTION", "SELECTED_FARE", "PERSONAL_UPGRADE", "REPORTING_FOP_TYPE", "INLINE_QC_RULE_PREDICATE", "LLF_FARE"

  - `audiences.predicates.comparator` (string, required)
    The comparator to compare rule values.
    Enum: "IN", "ANY_IN", "NOT_IN_ANY", "NOT_IN", "EQUAL_GREATER", "EQUAL_LESSER", "GREATER", "LESSER", "CONTAINS", "EQ", "NOT_EQ"

  - `audiences.predicates.bookingTypes` (array, required)
    List of booking types to compare.

  - `audiences.predicates.initiatorTypes` (array, required)
    List of initiator types to compare.

  - `audiences.predicates.tripUsageTypes` (array, required)
    List of trip usage types to compare.

  - `audiences.predicates.travelRegionTypes` (array, required)
    List of travel region types to compare.

  - `audiences.predicates.countries` (array, required)
    List of 2-letter country codes to compare.

  - `audiences.predicates.cities` (array, required)
    List of cities to compare.

  - `audiences.predicates.cities.cityName` (string, required)
    The city name.
    Example: Palo Alto

  - `audiences.predicates.cities.administrativeDivCode` (string, required)
    Example: CA

  - `audiences.predicates.cities.countryCode` (string, required)
    Two letter country code.
    Example: US

  - `audiences.predicates.preferredVendorTypes` (array, required)
    List of preferred types to compare.

  - `audiences.predicates.countries` (array, required)
    List of 2 letter country codes to compare.

  - `audiences.predicates.legalEntities` (array, required)
    List of legal entity Ids to compare.

  - `audiences.predicates.departments` (array, required)
    List of department Ids to compare.

  - `audiences.predicates.offices` (array, required)
    List of office Ids to compare.

  - `audiences.predicates.costCenters` (array, required)
    List of cost center Ids to compare.

  - `audiences.predicates.workerTypes` (array, required)
    List of worker types to compare.

  - `audiences.predicates.countryCodes` (array, required)
    List of legal entity country codes to compare.

  - `audiences.predicates.personas` (array, required)
    List of personas to compare

  - `audiences.predicates.countryCodes` (array, required)
    List of traveler country codes to compare.

  - `audiences.predicates.isOutOfPolicy` (boolean, required)
    Indicates whether the policy is out of policy or not.

  - `audiences.predicates.condition` (object, required)
    Policy condition.

  - `audiences.predicates.condition.type` (string, required)
    Enum: "ANY_POLICY", "POLICY_ID"

  - `audiences.predicates.condition.policyIds` (array, required)
    List of policy identifiers to compare.

  - `audiences.predicates.id` (string, required)

  - `audiences.predicates.values` (array, required)

  - `audiences.predicates.bookingFlowTypes` (array, required)
    List of booking flow types to compare.

  - `audiences.predicates.pnrCreationProcessTypes` (array, required)
    List of pnr creation process types to compare.

  - `audiences.predicates.actionTypes` (array, required)
    List of policy action types to compare.

  - `audiences.predicates.value` (object, required)
    Fare value which can either be static or dynamic.

  - `audiences.predicates.value.type` (string, required)
    Enum: "STATIC_FARE", "DYNAMIC_FARE"

  - `audiences.predicates.value.money` (object, required)
    Money object containing just amount and currency code.

  - `audiences.predicates.value.money.amount` (number, required)
    Amount
    Example: 510

  - `audiences.predicates.value.money.currencyCode` (string, required)
    The 3-letter currency code defined in ISO 4217.
    Example: GBP

  - `audiences.predicates.value.fareType` (string, required)
    Fare type.
    Enum: "LLF"

  - `audiences.predicates.isPersonalUpgrade` (boolean, required)
    Indicates whether the booking is personal upgrade or not.

  - `audiences.predicates.reportingFopTypes` (array, required)
    List of reporting fop types to compare.

  - `audiences.predicates.values` (array, required)
    List of values to compare.

  - `audiences.predicates.ruleTypes` (array, required)

  - `action` (object, required)
    An automatic or a user action to select one of the items as a response to the field.

  - `action.type` (string, required)
    Enum: "AUTO", "USER"

  - `action.hidden` (boolean)
    Whether this code will be hidden to the user.
    Example: true

  - `action.description` (string)
    Description of the code.
    Example: Lower fare declined

  - `action.name` (string, required)
    Code which represents the auto selected option for the custom field.
    Example: LD

  - `action.additionalInfos` (array)

  - `action.additionalInfos.type` (string, required)
    Enum: "VARIABLE", "EXPRESSION"

  - `action.additionalInfos.name` (string, required)
    Name of the variable.
    Enum: "PUBLISHED_FARE", "LLF", "ADD_COLLECT_AMOUNT", "SELECTED_FARE", "SPLIT_PAYMENT_FARE"

  - `action.additionalInfos.formatExpression` (string, required)
    The expression must be of format : `<any_text> ${expression} <any_text>`.The expression
can consist of a combination of variables and mathematical operations.
Variable names must be same as VariableName Enum.
To define mathematical operations, the operation name should follow the format
`math.<math_op>(arg1, arg2)`. Both `arg1` and `arg2` can be variables or constants.
The supported math operations (math_op) include: `add, mul, div, sub, min, and max`. All keywords, such as `<math_op>, math, and var` must be written in lowercase.
    Example: Result:  ${math.mul(LLF,5)}  ${ADD_COLLECT_AMOUNT}

  - `action.additionalInfos.variables` (array)
    Reference names of the variables present in the expression.

  - `action.name` (string)
    Name of the option.
    Example: US employee codes

  - `action.required` (boolean)
    Indicates whether the user can opt not to select any of the options.
    Example: true

  - `action.format` (object, required)
    Option Selection format

  - `action.format.type` (string, required)
    Enum: "OPTION_LIST", "TEXT_INPUT"

  - `action.format.optionListTypeFormat` (object, required)
    Option format for select options.

  - `action.format.optionListTypeFormat.isMultiSelect` (boolean, required)
    Indicates whether the user can select multiple options.
    Example: true

  - `action.format.optionListTypeFormat.isPctType` (boolean)
    Indicates whether the user can select multiple options with percentage.
    Example: true

  - `action.format.customValueFormat` (object, required)
    Option format for custom value.

  - `action.format.customValueFormat.isCustomValueAllowed` (boolean, required)
    Indicates whether the user can enter a custom value.
    Example: true

  - `action.format.customValueFormat.userInputFormat` (object)
    Option format for user input.

  - `action.format.customValueFormat.userInputFormat.type` (string, required)
    Enum: "NON_REGEX", "REGEX"

  - `action.format.customValueFormat.userInputFormat.allowedChars` (string, required)
    The allowed characters for user input.
    Enum: "ALL", "ALPHA_NUMERIC", "NUMERIC"

  - `action.format.customValueFormat.userInputFormat.maxLength` (integer)
    The maximum length of any user entered text input.
    Example: 10

  - `action.format.customValueFormat.userInputFormat.minLength` (integer)
    The minimum length of any user entered text input.
    Example: 1

  - `action.format.customValueFormat.userInputFormat.regex` (string, required)
    Regex to validate the user input.
    Example: ^[a-zA-Z0-9]*$

  - `action.userOptionSource` (object)
    Custom field option source.

  - `action.userOptionSource.type` (string, required)
    Enum: "MANUAL", "PROFILE"

  - `action.userOptionSource.attributeType` (string, required)
    The level at which the field will be stored.
    Enum: "LEGAL_ENTITY", "OFFICE", "COMPANY_DEFINED_USER_ATTRIBUTE", "DEPARTMENT", "COST_CENTER"

  - `action.userOptionSource.attributeName` (string)
    When type is COMPANY_DEFINED_USER_ATTRIBUTE, then the attribute_name
contains the name of the attribute to provide the option values.
    Example: ssAuthId

## Response 200:

  - `200` (unknown)
    Created

## Response 200 fields (application/json):

  - `armId` (string, required)
    Arm id.

  - `optionGroupId` (string)
    Option group id if option source of arm is manual.

## Response 400:

  - `400` (unknown)
    Bad request

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

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

