openapi: 3.2.0 info: version: V3 title: Optimizely CMP Open API Documentation Fields API servers: - url: https://api.cmp.optimizely.com/v3 description: v3 version of Optimizely CMP Open API security: - OAuth2: - openid - profile - offline_access tags: - name: Fields paths: /fields: get: operationId: listFields tags: - Fields summary: GET /fields description: Experimental Get the list of fields of an Organization. parameters: - name: ids in: query schema: type: string description: Unique identifier of the field. Can be appended multiple times, such as `ids=fieldId1&ids=fieldId2` example: 12p5ca474ba9i7cc92y164aa7 - $ref: '#/components/parameters/offset' - $ref: '#/components/parameters/page_size' responses: '200': description: List of fetched fields content: application/json: schema: type: object additionalProperties: false properties: data: description: List of fields type: array items: oneOf: - $ref: '#/components/schemas/BaseSettingsFieldsResponse' - $ref: '#/components/schemas/LabelTypeSettingsFieldResponse' - $ref: '#/components/schemas/DropdownTypeSettingsFieldResponse' - $ref: '#/components/schemas/CheckboxAndRadioTypeSettingsFieldResponse' - $ref: '#/components/schemas/GenericNumberTypeSettingsFieldResponse' - $ref: '#/components/schemas/CurrencyNumberTypeSettingsFieldResponse' discriminator: propertyName: type mapping: checkbox: '#/components/schemas/CheckboxAndRadioTypeSettingsFieldResponse' currency_number: '#/components/schemas/CurrencyNumberTypeSettingsFieldResponse' date: '#/components/schemas/BaseSettingsFieldsResponse' dropdown: '#/components/schemas/DropdownTypeSettingsFieldResponse' image: '#/components/schemas/BaseSettingsFieldsResponse' label: '#/components/schemas/LabelTypeSettingsFieldResponse' percentage_number: '#/components/schemas/GenericNumberTypeSettingsFieldResponse' radio_button: '#/components/schemas/CheckboxAndRadioTypeSettingsFieldResponse' rich_text: '#/components/schemas/BaseSettingsFieldsResponse' simple_number: '#/components/schemas/GenericNumberTypeSettingsFieldResponse' text: '#/components/schemas/BaseSettingsFieldsResponse' text_area: '#/components/schemas/BaseSettingsFieldsResponse' video: '#/components/schemas/BaseSettingsFieldsResponse' pagination: allOf: - $ref: '#/components/schemas/Pagination' - type: object properties: next: type: - string - 'null' example: https://api.cmp.optimizely.com/v3/fields?offset=10&page_size=10 required: - data - pagination '400': $ref: '#/components/responses/ClientError' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' post: operationId: createField tags: - Fields summary: POST /fields description: Experimental Add a new field to an Organization. requestBody: description: Payload to create a new field in an Organization required: true content: application/json: schema: $ref: '#/components/schemas/SettingsFieldCreateRequest' responses: '201': description: Created new field in an Organization content: application/json: schema: type: object additionalProperties: false properties: id: type: string description: Identifier of the field that has been created. example: 6ceee2f4fa3411ecb37802420ac8001b required: - id '400': $ref: '#/components/responses/ClientError' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/UnprocessableEntity' /fields/{id}: patch: operationId: updateField tags: - Fields summary: PATCH /fields/{id} description: Experimental Update a field in an Organization. parameters: - name: id in: path required: true schema: type: string description: Unique identifier of the field example: 8q7f910551b00a722e0418830cee6612 requestBody: description: Payload to update in an Organization. required: true content: application/json: schema: $ref: '#/components/schemas/SettingsFieldUpdateRequest' responses: '204': description: Updated field in an Organization '400': $ref: '#/components/responses/ClientError' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/UnprocessableEntity' /fields/{id}/choices: post: operationId: createFieldChoices tags: - Fields summary: POST /fields/{id}/choices description: Experimental Create choices in a field. parameters: - name: id in: path required: true schema: type: string description: Unique identifier of the field example: 8a7f910551b00a722e0418830cee6612 requestBody: description: Payload to create new choices in the field required: true content: application/json: schema: $ref: '#/components/schemas/SettingsFieldChoiceCreateRequest' responses: '201': description: Field with all the choices including the newly created ones content: application/json: schema: $ref: '#/components/schemas/SettingsFieldChoiceCreateResponse' '400': $ref: '#/components/responses/ClientError' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/UnprocessableEntity' /fields/{field_id}/choices/{choice_id}: patch: operationId: updateFieldChoice tags: - Fields summary: PATCH /fields/{field_id}/choices/{choice_id} description: Experimental Update a choice of a field. parameters: - name: field_id in: path required: true schema: type: string description: Unique identifier of the field example: 8a7f91p551b00i722e04y8830cae6612 - name: choice_id in: path required: true schema: type: string description: Unique identifier of the choice to be updated example: 8a7b91p51b00i722e041y860aee6612 requestBody: description: Payload to update a choice in the field required: true content: application/json: schema: $ref: '#/components/schemas/SettingsFieldChoiceUpdateRequest' responses: '204': description: Successful response '400': $ref: '#/components/responses/ClientError' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/UnprocessableEntity' delete: operationId: deleteFieldChoice tags: - Fields summary: DELETE /fields/{field_id}/choices/{choice_id} description: Experimental Delete a choice from a field. parameters: - name: field_id in: path required: true schema: type: string description: Unique identifier of the field example: 8a7f91p551b00i722e04y8830cae6612 - name: choice_id in: path required: true schema: type: string description: Unique identifier of the choice to be deleted example: 8a7b910551b00a722e0418860cee6612 responses: '204': description: Successful response '400': $ref: '#/components/responses/ClientError' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/UnprocessableEntity' components: schemas: CurrencyNumberTypeSettingsFieldResponse: allOf: - $ref: '#/components/schemas/GenericNumberTypeSettingsFieldResponse' - type: object properties: currency_code: type: string description: Currency code of the numerical field example: USD required: - currency_code CurrencyNumberTypeSettingsFieldUpdatePayload: allOf: - $ref: '#/components/schemas/GenericNumberTypeSettingsFieldUpdatePayload' - type: object properties: currency_code: type: string description: Currency code of the numerical field. This must be a valid currency code. If this field is empty, `USD` is set as the default. default: USD example: USD SettingsFieldChoiceCreateRequest: type: array minItems: 1 description: Choices of the field items: oneOf: - $ref: '#/components/schemas/GenericSettingsFieldChoiceCreatePayload' - $ref: '#/components/schemas/LabelTypeSettingsFieldChoiceCreatePayload' DropdownTypeSettingsFieldCreatePayload: allOf: - $ref: '#/components/schemas/BaseSettingsFieldCreatePayload' - type: object properties: is_multi_select: type: boolean description: Allow users to select multiple values choices: type: array minItems: 1 description: Choices of the field items: type: object properties: name: type: string minLength: 1 description: Name of the choice example: Choice 1 required: - name required: - is_multi_select - choices SettingsFieldUpdateRequest: type: object additionalProperties: false oneOf: - $ref: '#/components/schemas/BaseSettingsFieldUpdatePayload' - $ref: '#/components/schemas/LabelAndDropdownTypeSettingsFieldUpdatePayload' - $ref: '#/components/schemas/GenericNumberTypeSettingsFieldUpdatePayload' - $ref: '#/components/schemas/CurrencyNumberTypeSettingsFieldUpdatePayload' discriminator: propertyName: type mapping: checkbox: '#/components/schemas/BaseSettingsFieldUpdatePayload' currency_number: '#/components/schemas/CurrencyNumberTypeSettingsFieldUpdatePayload' date: '#/components/schemas/BaseSettingsFieldUpdatePayload' dropdown: '#/components/schemas/LabelAndDropdownTypeSettingsFieldUpdatePayload' image: '#/components/schemas/BaseSettingsFieldUpdatePayload' label: '#/components/schemas/LabelAndDropdownTypeSettingsFieldUpdatePayload' percentage_number: '#/components/schemas/GenericNumberTypeSettingsFieldUpdatePayload' radio_button: '#/components/schemas/BaseSettingsFieldUpdatePayload' rich_text: '#/components/schemas/BaseSettingsFieldUpdatePayload' simple_number: '#/components/schemas/GenericNumberTypeSettingsFieldUpdatePayload' text: '#/components/schemas/BaseSettingsFieldUpdatePayload' text_area: '#/components/schemas/BaseSettingsFieldUpdatePayload' video: '#/components/schemas/BaseSettingsFieldUpdatePayload' LabelTypeSettingsFieldChoiceCreatePayload: allOf: - $ref: '#/components/schemas/GenericSettingsFieldChoiceCreatePayload' - type: object description: Choice for field type of `label` properties: color: type: string example: '#FFC700' description: 'Code of choice color. Colors are limited to the following: - Electric Blue (#4ECFD5) - Golden Rod (#FFC700) - Salmon Pink (#FF98A7) - Blue Violet (#702BD5) - Spring Green (#5FEEAD) - Lavender Blue (#D6C4F2) - Sky (#5F9FF6) - Persian blue (#CB5DEB) - Cool Gray (#9694B3) ' required: - color GenericNumberTypeSettingsFieldUpdatePayload: allOf: - $ref: '#/components/schemas/BaseSettingsFieldUpdatePayload' - type: object properties: has_thousand_separator: type: boolean description: Whether the numerical field has a thousand separator example: true default: false decimal_places: type: integer description: Decimal place of the numerical field. This must be greather than 0. If this field is empty, 2 is set as the default. example: 2 default: 2 LabelAndDropdownTypeSettingsFieldUpdatePayload: allOf: - $ref: '#/components/schemas/BaseSettingsFieldUpdatePayload' - type: object properties: is_multi_select: type: boolean description: Allow users to select multiple values Error: type: object additionalProperties: true description: Error payload properties: message: type: string description: Message describing the error example: Not found errors: type: object description: Additional information additionalProperties: true properties: {} required: - message CurrencyNumberTypeSettingsFieldCreatePayload: allOf: - $ref: '#/components/schemas/GenericNumberTypeSettingsFieldCreatePayload' - type: object properties: currency_code: type: string description: Currency code of the numerical field. This must be a valid currency code. If this field is empty, `USD` is set as the default. default: USD example: USD CheckboxAndRadioTypeSettingsFieldResponse: allOf: - $ref: '#/components/schemas/BaseSettingsFieldsResponse' - type: object properties: choices: type: array description: Choices of the field items: type: object properties: id: type: string description: Identifier of the choice example: 6ceee2f4fa3411ecb37802420ac8001b name: type: string description: Name of the choice example: Choice 1 required: - id - name required: - choices Pagination: type: object additionalProperties: false description: Pagination related information properties: next: type: - string - 'null' description: URL to the next page example: https://api.cmp.optimizely.com/?offset=10&page_size=10 previous: type: - string - 'null' description: URL to the previous page example: null required: - next - previous CheckboxAndRadioTypeSettingsFieldCreatePayload: allOf: - $ref: '#/components/schemas/BaseSettingsFieldCreatePayload' - type: object properties: choices: type: array description: Choices of the field minItems: 1 items: type: object properties: name: type: string minLength: 1 description: Name of the choice example: Choice 1 required: - name required: - choices LabelTypeSettingsFieldResponse: allOf: - $ref: '#/components/schemas/BaseSettingsFieldsResponse' - type: object properties: is_multi_select: type: boolean description: Allow users to select multiple values choices: type: array description: Choices of the field items: type: object properties: id: type: string description: Identifier of the choice example: 6ceee2f4fa3411ecb37802420ac8001b name: type: string description: Name of the choice example: Choice 1 color: type: - string - 'null' example: '#4ECFD5' description: 'Code of choice color. Colors are limited to the following: - Electric Blue (#4ECFD5) - Golden Rod (#FFC700) - Salmon Pink (#FF98A7) - Blue Violet (#702BD5) - Spring Green (#5FEEAD) - Lavender Blue (#D6C4F2) - Sky (#5F9FF6) - Persian blue (#CB5DEB) - Cool Gray (#9694B3) ' required: - id - name - color required: - is_multi_select - choices BaseSettingsFieldsResponse: type: object properties: id: type: string description: Identifier of the field example: 6ceee2f4fa3411ecb37802420ac8001b name: type: string description: Name of the field example: Sample Checkbox helper_text: type: string description: Used to help understand functionality of field example: This field is used to check options is_active: type: boolean description: Indicates active status of field. Inactive fields cannot be accessed in tasks, campaigns or workflows. example: true type: type: string description: Type of the field example: checkbox links: type: object additionalProperties: false description: Meta links properties: source: type: string description: URL of the list of fields filtered only with the field example: https://api.cmp.optimizely.com/v3/fields?ids=8p7f910551i00722y0418830aee6612 required: - source required: - id - name - helper_text - is_active - type - links GenericSettingsFieldChoiceCreatePayload: type: object description: Choice for field types other than `label` properties: name: type: string minLength: 1 description: Name of the choice example: Choice 1 required: - name GenericNumberTypeSettingsFieldCreatePayload: allOf: - $ref: '#/components/schemas/BaseSettingsFieldCreatePayload' - type: object properties: has_thousand_separator: type: boolean description: Whether the numerical field has a thousand separator example: true default: false decimal_places: type: integer description: Decimal place of the numerical field. This must be greather than 0. If this field is empty, 2 is set as the default. example: 2 default: 2 BaseSettingsFieldCreatePayload: type: object properties: name: type: string minLength: 1 description: Name of the field example: Sample Checkbox helper_text: type: string maxLength: 120 description: Used to help understand the functionality of the field. example: This field is used to check options is_active: type: boolean description: Indicates active status of field. Inactive fields cannot be accessed in tasks, campaigns or workflows. example: true type: type: string description: Type of the field example: checkbox required: - name - is_active - type GenericSettingsFieldChoiceUpdatePayload: type: object description: Choice for field types other than `label` properties: name: type: string minLength: 1 description: Name of the choice example: Choice 1 required: - name SettingsFieldChoiceCreateResponse: type: array description: Choices of the field minItems: 1 items: type: object properties: id: type: string description: Identifier of the field choice example: 675ca12f4fa3411ecb37802420ac82ab7 name: type: string minLength: 1 description: Name of the choice example: Choice 1 required: - id - name BaseSettingsFieldUpdatePayload: type: object properties: type: type: string description: Type of the field. This field is required but not updateable. Type of a field will always stay the same. Update request body must contain atleast one other updateable field. name: type: string minLength: 1 description: Name of the field example: Sample Field helper_text: type: string maxLength: 120 description: Used to help understand the functionality of the field. example: This is a helper text is_active: type: boolean description: Indicates active status of field. Inactive fields cannot be accessed in tasks, campaigns or workflows. example: true required: - type LabelTypeSettingsFieldCreatePayload: allOf: - $ref: '#/components/schemas/BaseSettingsFieldCreatePayload' - type: object properties: is_multi_select: type: boolean description: Allow users to select multiple values choices: type: array minItems: 1 description: Choices of the field items: type: object properties: name: type: string minLength: 1 description: Name of the choice example: Choice 1 color: type: string example: '#FFC700' description: 'Code of choice color. Colors are limited to the following: - Electric Blue (#4ECFD5) - Golden Rod (#FFC700) - Salmon Pink (#FF98A7) - Blue Violet (#702BD5) - Spring Green (#5FEEAD) - Lavender Blue (#D6C4F2) - Sky (#5F9FF6) - Persian blue (#CB5DEB) - Cool Gray (#9694B3) ' required: - name - color required: - is_multi_select - choices SettingsFieldCreateRequest: type: object additionalProperties: false oneOf: - $ref: '#/components/schemas/BaseSettingsFieldCreatePayload' - $ref: '#/components/schemas/LabelTypeSettingsFieldCreatePayload' - $ref: '#/components/schemas/DropdownTypeSettingsFieldCreatePayload' - $ref: '#/components/schemas/CheckboxAndRadioTypeSettingsFieldCreatePayload' - $ref: '#/components/schemas/GenericNumberTypeSettingsFieldCreatePayload' - $ref: '#/components/schemas/CurrencyNumberTypeSettingsFieldCreatePayload' discriminator: propertyName: type mapping: checkbox: '#/components/schemas/CheckboxAndRadioTypeSettingsFieldCreatePayload' currency_number: '#/components/schemas/CurrencyNumberTypeSettingsFieldCreatePayload' date: '#/components/schemas/BaseSettingsFieldCreatePayload' dropdown: '#/components/schemas/DropdownTypeSettingsFieldCreatePayload' image: '#/components/schemas/BaseSettingsFieldCreatePayload' label: '#/components/schemas/LabelTypeSettingsFieldCreatePayload' percentage_number: '#/components/schemas/GenericNumberTypeSettingsFieldCreatePayload' radio_button: '#/components/schemas/CheckboxAndRadioTypeSettingsFieldCreatePayload' rich_text: '#/components/schemas/BaseSettingsFieldCreatePayload' simple_number: '#/components/schemas/GenericNumberTypeSettingsFieldCreatePayload' text: '#/components/schemas/BaseSettingsFieldCreatePayload' text_area: '#/components/schemas/BaseSettingsFieldCreatePayload' video: '#/components/schemas/BaseSettingsFieldCreatePayload' LabelTypeSettingsFieldChoiceUpdatePayload: type: object description: Choice for field type of `label` properties: name: type: string minLength: 1 description: Name of the choice example: Choice 1 color: type: string example: '#FFC700' description: 'Code of choice color. Colors are limited to the following: - Electric Blue (#4ECFD5) - Golden Rod (#FFC700) - Salmon Pink (#FF98A7) - Blue Violet (#702BD5) - Spring Green (#5FEEAD) - Lavender Blue (#D6C4F2) - Sky (#5F9FF6) - Persian blue (#CB5DEB) - Cool Gray (#9694B3) ' SettingsFieldChoiceUpdateRequest: type: object description: Payload for updating choice additionalProperties: false oneOf: - $ref: '#/components/schemas/GenericSettingsFieldChoiceUpdatePayload' - $ref: '#/components/schemas/LabelTypeSettingsFieldChoiceUpdatePayload' GenericNumberTypeSettingsFieldResponse: allOf: - $ref: '#/components/schemas/BaseSettingsFieldsResponse' - type: object properties: has_thousand_separator: type: boolean description: Whether the numerical field has a thousand separator example: true decimal_places: type: integer description: Decimal place of the numerical field example: 2 required: - has_thousand_separator - decimal_places DropdownTypeSettingsFieldResponse: allOf: - $ref: '#/components/schemas/BaseSettingsFieldsResponse' - type: object properties: is_multi_select: type: boolean description: Allow users to select multiple values choices: type: array description: Choices of the field items: type: object properties: id: type: string description: Identifier of the choice example: 6ceee2f4fa3411ecb37802420ac8001b name: type: string description: Name of the choice example: Choice 1 required: - id - name required: - is_multi_select - choices responses: Forbidden: description: Permission error content: application/json: schema: $ref: '#/components/schemas/Error' example: message: You do not have the permission to perform this operation UnprocessableEntity: description: Unprocessable entity error content: application/json: schema: $ref: '#/components/schemas/Error' example: message: Resource cannot be processed NotFound: description: Not found error content: application/json: schema: $ref: '#/components/schemas/Error' example: message: Resource not found ClientError: description: Client error content: application/json: schema: $ref: '#/components/schemas/Error' example: message: 'Unsupported arguments: a,b,c' Unauthorized: description: Authorization error content: application/json: schema: $ref: '#/components/schemas/Error' example: message: Unauthorized parameters: page_size: name: page_size in: query description: Number of results to return per page schema: type: integer minimum: 1 maximum: 100 default: 10 example: 15 offset: name: offset in: query description: Starting index of results (zero indexed) schema: type: integer minimum: 0 default: 0 example: 5 securitySchemes: OAuth2: type: oauth2 flows: authorizationCode: authorizationUrl: https://accounts.cmp.optimizely.com/o/oauth2/v1/auth tokenUrl: https://accounts.cmp.optimizely.com/o/oauth2/v1/token scopes: openid: Grants the ability to receive a unique identifier for the user. profile: Grants access to user profile information. offline_access: Grants the ability to refresh access_token using the refresh token even when user is not present (not logged in). clientCredentials: tokenUrl: https://accounts.cmp.optimizely.com/o/oauth2/v1/token scopes: {} x-tagGroups: - name: API tags: - Uploader - Library - Labels - Brand Compliance - Tasks - Task Step - Campaigns - Publishing - Templates - Users - Work Requests - Structured Contents - Assets - Milestones - Teams - Settings - Workflows - Fields - Events