# Create or add change to request POST https://app.unleash-instance.example.com/api/admin/projects/{projectId}/environments/{environment}/change-requests Content-Type: application/json **Enterprise feature** Given a change request exists, this endpoint will attempt to add a change to an existing change request for the user. If a change request does not exist, it will attempt to create one. Reference: https://docs.getunleash.io/api/change-request ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Create/Add change to a change request version: endpoint_changeRequests.changeRequest paths: /api/admin/projects/{projectId}/environments/{environment}/change-requests: post: operationId: change-request summary: Create/Add change to a change request description: >- **Enterprise feature** Given a change request exists, this endpoint will attempt to add a change to an existing change request for the user. If a change request does not exist, it will attempt to create one. tags: - - subpackage_changeRequests parameters: - name: projectId in: path required: true schema: type: string - name: environment in: path required: true schema: type: string - name: Authorization in: header description: Header authentication of the form `undefined ` required: true schema: type: string responses: '200': description: changeRequestSchema content: application/json: schema: $ref: '#/components/schemas/changeRequestSchema' '400': description: The request data does not match what we expect. content: {} requestBody: description: changeRequestOneOrManyCreateSchema content: application/json: schema: $ref: '#/components/schemas/changeRequestOneOrManyCreateSchema' components: schemas: ChangeRequestOneOrManyCreateSchemaOneOf0Action: type: string enum: - value: updateSegment ConstraintSchemaOperator: type: string enum: - value: NOT_IN - value: IN - value: STR_ENDS_WITH - value: STR_STARTS_WITH - value: STR_CONTAINS - value: NUM_EQ - value: NUM_GT - value: NUM_GTE - value: NUM_LT - value: NUM_LTE - value: DATE_AFTER - value: DATE_BEFORE - value: SEMVER_EQ - value: SEMVER_GT - value: SEMVER_LT - value: REGEX constraintSchema: type: object properties: contextName: type: string description: The name of the context field that this constraint should apply to. operator: $ref: '#/components/schemas/ConstraintSchemaOperator' description: >- The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/concepts/activation-strategies#constraint-operators). caseInsensitive: type: boolean default: false description: >- Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive). inverted: type: boolean default: false description: >- Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa. values: type: array items: type: string description: >- The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values. value: type: string description: >- The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values. required: - contextName - operator upsertSegmentSchema: type: object properties: name: type: string description: The name of the segment description: type: - string - 'null' description: A description of what the segment is for project: type: - string - 'null' description: The project the segment belongs to if any. constraints: type: array items: $ref: '#/components/schemas/constraintSchema' description: The list of constraints that make up this segment required: - name - constraints ChangeRequestOneOrManyCreateSchema0: type: object properties: action: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf0Action' description: The name of this action. payload: $ref: '#/components/schemas/upsertSegmentSchema' required: - action - payload ChangeRequestOneOrManyCreateSchemaOneOf1Action: type: string enum: - value: deleteSegment ChangeRequestOneOrManyCreateSchemaOneOf1Payload: type: object properties: id: type: integer description: The ID of the segment to delete. required: - id ChangeRequestOneOrManyCreateSchema1: type: object properties: action: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf1Action' description: The name of this action. payload: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf1Payload' description: Required data to delete a segment. required: - action - payload ChangeRequestOneOrManyCreateSchemaOneOf2Action: type: string enum: - value: updateEnabled ChangeRequestOneOrManyCreateSchemaOneOf2Payload: type: object properties: enabled: type: boolean description: The new state of the feature. shouldActivateDisabledStrategies: type: boolean description: >- Only relevant when ALL the strategies are disabled. If `true`, all the disabled strategies will be enabled. If `false`, the default strategy will be added required: - enabled ChangeRequestOneOrManyCreateSchema2: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf2Action' description: The name of this action. payload: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf2Payload' required: - feature - action - payload ChangeRequestOneOrManyCreateSchemaOneOf3Action: type: string enum: - value: addStrategy CreateStrategyVariantSchemaWeightType: type: string enum: - value: variable - value: fix CreateStrategyVariantSchemaPayloadType: type: string enum: - value: json - value: csv - value: string - value: number CreateStrategyVariantSchemaPayload: type: object properties: type: $ref: '#/components/schemas/CreateStrategyVariantSchemaPayloadType' description: >- The type of the value. Commonly used types are string, number, json and csv. value: type: string description: The actual value of payload required: - type - value createStrategyVariantSchema: type: object properties: name: type: string description: The variant name. Must be unique for this feature flag weight: type: integer description: >- The weight is the likelihood of any one user getting this variant. It is an integer between 0 and 1000. See the section on [variant weights](https://docs.getunleash.io/concepts/feature-flag-variants#variant-weight) for more information weightType: $ref: '#/components/schemas/CreateStrategyVariantSchemaWeightType' description: >- Set to `fix` if this variant must have exactly the weight allocated to it. If the type is `variable`, the weight will adjust so that the total weight of all variants adds up to 1000. Refer to the [variant weight documentation](https://docs.getunleash.io/concepts/feature-flag-variants#variant-weight). stickiness: type: string description: >- The [stickiness](https://docs.getunleash.io/concepts/feature-flag-variants#variant-stickiness) to use for distribution of this variant. Stickiness is how Unleash guarantees that the same user gets the same variant every time payload: $ref: '#/components/schemas/CreateStrategyVariantSchemaPayload' description: Extra data configured for this variant required: - name - weight - weightType - stickiness parametersSchema: type: object additionalProperties: type: string createFeatureStrategySchema: type: object properties: name: type: string description: The name of the strategy type title: type: - string - 'null' description: A descriptive title for the strategy disabled: type: - boolean - 'null' description: >- A toggle to disable the strategy. defaults to false. Disabled strategies are not evaluated or returned to the SDKs sortOrder: type: number format: double description: The order of the strategy in the list constraints: type: array items: $ref: '#/components/schemas/constraintSchema' description: >- A list of the constraints attached to the strategy. See https://docs.getunleash.io/concepts/activation-strategies#constraints variants: type: array items: $ref: '#/components/schemas/createStrategyVariantSchema' description: Strategy level variants parameters: $ref: '#/components/schemas/parametersSchema' description: An object containing the parameters for the strategy segments: type: array items: type: number format: double description: Ids of segments to use for this strategy required: - name ChangeRequestOneOrManyCreateSchema3: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf3Action' description: The name of this action. payload: $ref: '#/components/schemas/createFeatureStrategySchema' required: - feature - action - payload ChangeRequestOneOrManyCreateSchemaOneOf4Action: type: string enum: - value: updateStrategy StrategyVariantSchemaWeightType: type: string enum: - value: variable - value: fix StrategyVariantSchemaPayloadType: type: string enum: - value: json - value: csv - value: string - value: number StrategyVariantSchemaPayload: type: object properties: type: $ref: '#/components/schemas/StrategyVariantSchemaPayloadType' description: >- The type of the value. Commonly used types are string, number, json and csv. value: type: string description: The actual value of payload required: - type - value strategyVariantSchema: type: object properties: name: type: string description: The variant name. Must be unique for this feature flag weight: type: integer description: >- The weight is the likelihood of any one user getting this variant. It is an integer between 0 and 1000. See the section on [variant weights](https://docs.getunleash.io/concepts/feature-flag-variants#variant-weight) for more information weightType: $ref: '#/components/schemas/StrategyVariantSchemaWeightType' description: >- Set to `fix` if this variant must have exactly the weight allocated to it. If the type is `variable`, the weight will adjust so that the total weight of all variants adds up to 1000. Refer to the [variant weight documentation](https://docs.getunleash.io/concepts/feature-flag-variants#variant-weight). stickiness: type: string description: >- The [stickiness](https://docs.getunleash.io/concepts/feature-flag-variants#variant-stickiness) to use for distribution of this variant. Stickiness is how Unleash guarantees that the same user gets the same variant every time payload: $ref: '#/components/schemas/StrategyVariantSchemaPayload' description: Extra data configured for this variant required: - name - weight - weightType - stickiness updateFeatureStrategySchema: type: object properties: name: type: string description: >- The name of the strategy type. This property is deprecated and the ability to change a strategy's type will be removed in a future release. sortOrder: type: number format: double description: >- The order of the strategy in the list in feature environment configuration constraints: type: array items: $ref: '#/components/schemas/constraintSchema' description: >- A list of the constraints attached to the strategy. See https://docs.getunleash.io/concepts/activation-strategies#constraints title: type: - string - 'null' description: A descriptive title for the strategy disabled: type: - boolean - 'null' description: >- A toggle to disable the strategy. defaults to true. Disabled strategies are not evaluated or returned to the SDKs variants: type: array items: $ref: '#/components/schemas/strategyVariantSchema' description: Strategy level variants segments: type: array items: type: number format: double description: A list of segment ids attached to the strategy parameters: $ref: '#/components/schemas/parametersSchema' ChangeRequestOneOrManyCreateSchema4: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf4Action' description: The name of this action. payload: $ref: '#/components/schemas/updateFeatureStrategySchema' required: - feature - action - payload ChangeRequestOneOrManyCreateSchemaOneOf5Action: type: string enum: - value: deleteStrategy ChangeRequestOneOrManyCreateSchemaOneOf5Payload: type: object properties: id: type: string description: The ID of the strategy to update. required: - id ChangeRequestOneOrManyCreateSchema5: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf5Action' description: The name of this action. payload: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf5Payload' required: - feature - action - payload ChangeRequestOneOrManyCreateSchemaOneOf6Action: type: string enum: - value: archiveFeature ChangeRequestOneOrManyCreateSchema6: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf6Action' description: The name of this action. required: - feature - action ChangeRequestOneOrManyCreateSchemaOneOf7Action: type: string enum: - value: patchVariant VariantSchemaWeightType: type: string enum: - value: variable - value: fix VariantSchemaPayloadType: type: string enum: - value: json - value: csv - value: string - value: number VariantSchemaPayload: type: object properties: type: $ref: '#/components/schemas/VariantSchemaPayloadType' description: >- The type of the value. Commonly used types are string, number, json and csv. value: type: string description: The actual value of payload required: - type - value overrideSchema: type: object properties: contextName: type: string description: The name of the context field used to determine overrides values: type: array items: type: string description: Which values that should be overriden required: - contextName - values variantSchema: type: object properties: name: type: string description: The variants name. Is unique for this feature flag weight: type: number format: double description: >- The weight is the likelihood of any one user getting this variant. It is a number between 0 and 1000. See the section on [variant weights](https://docs.getunleash.io/concepts/feature-flag-variants#variant-weight) for more information weightType: $ref: '#/components/schemas/VariantSchemaWeightType' description: >- Set to fix if this variant must have exactly the weight allocated to it. If the type is variable, the weight will adjust so that the total weight of all variants adds up to 1000 stickiness: type: string description: >- [Stickiness](https://docs.getunleash.io/concepts/feature-flag-variants#variant-stickiness) is how Unleash guarantees that the same user gets the same variant every time payload: $ref: '#/components/schemas/VariantSchemaPayload' description: Extra data configured for this variant overrides: type: array items: $ref: '#/components/schemas/overrideSchema' description: >- Overrides assigning specific variants to specific users. The weighting system automatically assigns users to specific groups for you, but any overrides in this list will take precedence. required: - name - weight ChangeRequestOneOrManyCreateSchemaOneOf7Payload: type: object properties: variants: type: array items: $ref: '#/components/schemas/variantSchema' required: - variants ChangeRequestOneOrManyCreateSchema7: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf7Action' description: The name of this action. payload: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf7Payload' required: - feature - action - payload ChangeRequestOneOrManyCreateSchemaOneOf8Action: type: string enum: - value: reorderStrategy SetStrategySortOrderSchemaItems: type: object properties: id: type: string description: The ID of the strategy sortOrder: type: number format: double description: The new sort order of the strategy required: - id - sortOrder setStrategySortOrderSchema: type: array items: $ref: '#/components/schemas/SetStrategySortOrderSchemaItems' ChangeRequestOneOrManyCreateSchema8: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf8Action' description: The name of this action. payload: $ref: '#/components/schemas/setStrategySortOrderSchema' required: - feature - action - payload ChangeRequestOneOrManyCreateSchemaOneOf9Action: type: string enum: - value: addDependency createDependentFeatureSchema: type: object properties: feature: type: string description: The name of the feature we depend on. enabled: type: boolean description: >- Whether the parent feature should be enabled. When `false` variants are ignored. `true` by default. variants: type: array items: type: string description: >- The list of variants the parent feature should resolve to. Leave empty when you only want to check the `enabled` status. required: - feature ChangeRequestOneOrManyCreateSchema9: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf9Action' description: The name of this action. payload: $ref: '#/components/schemas/createDependentFeatureSchema' required: - feature - action - payload ChangeRequestOneOrManyCreateSchemaOneOf10Action: type: string enum: - value: deleteDependency ChangeRequestOneOrManyCreateSchema10: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf10Action' description: The name of this action. required: - feature - action ChangeRequestOneOrManyCreateSchemaOneOf11Action: type: string enum: - value: addReleasePlan releasePlanTemplateIdSchema: type: object properties: templateId: type: string description: The release plan template's ID. Release template IDs are ulids. required: - templateId ChangeRequestOneOrManyCreateSchema11: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf11Action' description: The name of this action. payload: $ref: '#/components/schemas/releasePlanTemplateIdSchema' required: - feature - action - payload ChangeRequestOneOrManyCreateSchemaOneOf12Action: type: string enum: - value: startMilestone ChangeRequestOneOrManyCreateSchemaOneOf12Payload: type: object properties: milestoneId: type: string description: The ID of the milestone to start. This ID is an ulid planId: type: string description: The ID of the release plan. This ID is an ulid required: - milestoneId - planId ChangeRequestOneOrManyCreateSchema12: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf12Action' description: The name of this action. payload: $ref: >- #/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf12Payload description: The ID of the release plan and which of its milestones to start. required: - feature - action - payload ChangeRequestOneOrManyCreateSchemaOneOf13Action: type: string enum: - value: deleteReleasePlan ChangeRequestOneOrManyCreateSchemaOneOf13Payload: type: object properties: planId: type: string description: The Id of the release plan. This id is an ulid required: - planId ChangeRequestOneOrManyCreateSchema13: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf13Action' description: The name of this action. payload: $ref: >- #/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf13Payload description: The Id of the release plan to remove. required: - feature - action - payload ChangeRequestOneOrManyCreateSchemaOneOf14Action: type: string enum: - value: changeMilestoneProgression transitionConditionSchema: type: object properties: intervalMinutes: type: integer description: The interval in minutes before transitioning required: - intervalMinutes ChangeRequestOneOrManyCreateSchemaOneOf14Payload: type: object properties: sourceMilestone: type: string description: The ID of the source milestone targetMilestone: type: string description: The ID of the target milestone transitionCondition: $ref: '#/components/schemas/transitionConditionSchema' description: The condition configuration for the transition required: - sourceMilestone - targetMilestone - transitionCondition ChangeRequestOneOrManyCreateSchema14: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf14Action' description: The name of this action. payload: $ref: >- #/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf14Payload required: - feature - action - payload ChangeRequestOneOrManyCreateSchemaOneOf15Action: type: string enum: - value: deleteMilestoneProgression ChangeRequestOneOrManyCreateSchemaOneOf15Payload: type: object properties: sourceMilestone: type: string description: The ID of the source milestone with progression to delete. required: - sourceMilestone ChangeRequestOneOrManyCreateSchema15: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf15Action' description: The name of this action. payload: $ref: >- #/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf15Payload required: - feature - action - payload ChangeRequestOneOrManyCreateSchemaOneOf16Action: type: string enum: - value: resumeMilestoneProgression ChangeRequestOneOrManyCreateSchemaOneOf16Payload: type: object properties: planId: type: string description: The release plan's unique identifier (ULID format) required: - planId ChangeRequestOneOrManyCreateSchema16: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf16Action' description: The name of this action. payload: $ref: >- #/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf16Payload required: - feature - action - payload ChangeRequestOneOrManyCreateSchemaOneOf17Action: type: string enum: - value: changeSafeguard CreateSafeguardSchemaImpactMetricTimeRange: type: string enum: - value: hour - value: day - value: week - value: month CreateSafeguardSchemaImpactMetricAggregationMode: type: string enum: - value: rps - value: count - value: avg - value: sum - value: p95 - value: p99 - value: p50 CreateSafeguardSchemaImpactMetric: type: object properties: metricName: type: string description: >- The Prometheus metric series to query. It includes both unleash prefix and metric type and display name timeRange: $ref: '#/components/schemas/CreateSafeguardSchemaImpactMetricTimeRange' description: The time range for the metric data. aggregationMode: $ref: >- #/components/schemas/CreateSafeguardSchemaImpactMetricAggregationMode description: The aggregation mode for the metric data. labelSelectors: type: object additionalProperties: type: array items: type: string description: The selected labels and their values for filtering the metric data. required: - metricName - timeRange - aggregationMode - labelSelectors SafeguardTriggerConditionSchemaOperator: type: string enum: - value: '>' - value: < safeguardTriggerConditionSchema: type: object properties: operator: $ref: '#/components/schemas/SafeguardTriggerConditionSchemaOperator' description: The comparison operator for the threshold check. threshold: type: number format: double description: The threshold value to compare against. required: - operator - threshold createSafeguardSchema: type: object properties: impactMetric: $ref: '#/components/schemas/CreateSafeguardSchemaImpactMetric' description: Metric configuration that should be evaluated for the safeguard. triggerCondition: $ref: '#/components/schemas/safeguardTriggerConditionSchema' description: The condition that triggers the safeguard. required: - impactMetric - triggerCondition ChangeRequestOneOrManyCreateSchemaOneOf17Payload: type: object properties: planId: type: string description: The ID of the release plan. This ID is an ulid safeguard: $ref: '#/components/schemas/createSafeguardSchema' required: - planId - safeguard ChangeRequestOneOrManyCreateSchema17: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf17Action' description: The name of this action. payload: $ref: >- #/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf17Payload required: - feature - action - payload ChangeRequestOneOrManyCreateSchemaOneOf18Action: type: string enum: - value: deleteSafeguard ChangeRequestOneOrManyCreateSchemaOneOf18Payload: type: object properties: planId: type: string description: The ID of the release plan. This ID is an ulid safeguardId: type: string description: The ID of the safeguard to delete. required: - planId - safeguardId ChangeRequestOneOrManyCreateSchema18: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf18Action' description: The name of this action. payload: $ref: >- #/components/schemas/ChangeRequestOneOrManyCreateSchemaOneOf18Payload required: - feature - action - payload ChangeRequestCreateSchemaOneOf0Action: type: string enum: - value: updateSegment ChangeRequestCreateSchema0: type: object properties: action: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf0Action' description: The name of this action. payload: $ref: '#/components/schemas/upsertSegmentSchema' required: - action - payload ChangeRequestCreateSchemaOneOf1Action: type: string enum: - value: deleteSegment ChangeRequestCreateSchemaOneOf1Payload: type: object properties: id: type: integer description: The ID of the segment to delete. required: - id ChangeRequestCreateSchema1: type: object properties: action: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf1Action' description: The name of this action. payload: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf1Payload' description: Required data to delete a segment. required: - action - payload ChangeRequestCreateSchemaOneOf2Action: type: string enum: - value: updateEnabled ChangeRequestCreateSchemaOneOf2Payload: type: object properties: enabled: type: boolean description: The new state of the feature. shouldActivateDisabledStrategies: type: boolean description: >- Only relevant when ALL the strategies are disabled. If `true`, all the disabled strategies will be enabled. If `false`, the default strategy will be added required: - enabled ChangeRequestCreateSchema2: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf2Action' description: The name of this action. payload: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf2Payload' required: - feature - action - payload ChangeRequestCreateSchemaOneOf3Action: type: string enum: - value: addStrategy ChangeRequestCreateSchema3: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf3Action' description: The name of this action. payload: $ref: '#/components/schemas/createFeatureStrategySchema' required: - feature - action - payload ChangeRequestCreateSchemaOneOf4Action: type: string enum: - value: updateStrategy ChangeRequestCreateSchema4: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf4Action' description: The name of this action. payload: $ref: '#/components/schemas/updateFeatureStrategySchema' required: - feature - action - payload ChangeRequestCreateSchemaOneOf5Action: type: string enum: - value: deleteStrategy ChangeRequestCreateSchemaOneOf5Payload: type: object properties: id: type: string description: The ID of the strategy to update. required: - id ChangeRequestCreateSchema5: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf5Action' description: The name of this action. payload: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf5Payload' required: - feature - action - payload ChangeRequestCreateSchemaOneOf6Action: type: string enum: - value: archiveFeature ChangeRequestCreateSchema6: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf6Action' description: The name of this action. required: - feature - action ChangeRequestCreateSchemaOneOf7Action: type: string enum: - value: patchVariant ChangeRequestCreateSchemaOneOf7Payload: type: object properties: variants: type: array items: $ref: '#/components/schemas/variantSchema' required: - variants ChangeRequestCreateSchema7: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf7Action' description: The name of this action. payload: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf7Payload' required: - feature - action - payload ChangeRequestCreateSchemaOneOf8Action: type: string enum: - value: reorderStrategy ChangeRequestCreateSchema8: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf8Action' description: The name of this action. payload: $ref: '#/components/schemas/setStrategySortOrderSchema' required: - feature - action - payload ChangeRequestCreateSchemaOneOf9Action: type: string enum: - value: addDependency ChangeRequestCreateSchema9: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf9Action' description: The name of this action. payload: $ref: '#/components/schemas/createDependentFeatureSchema' required: - feature - action - payload ChangeRequestCreateSchemaOneOf10Action: type: string enum: - value: deleteDependency ChangeRequestCreateSchema10: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf10Action' description: The name of this action. required: - feature - action ChangeRequestCreateSchemaOneOf11Action: type: string enum: - value: addReleasePlan ChangeRequestCreateSchema11: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf11Action' description: The name of this action. payload: $ref: '#/components/schemas/releasePlanTemplateIdSchema' required: - feature - action - payload ChangeRequestCreateSchemaOneOf12Action: type: string enum: - value: startMilestone ChangeRequestCreateSchemaOneOf12Payload: type: object properties: milestoneId: type: string description: The ID of the milestone to start. This ID is an ulid planId: type: string description: The ID of the release plan. This ID is an ulid required: - milestoneId - planId ChangeRequestCreateSchema12: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf12Action' description: The name of this action. payload: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf12Payload' description: The ID of the release plan and which of its milestones to start. required: - feature - action - payload ChangeRequestCreateSchemaOneOf13Action: type: string enum: - value: deleteReleasePlan ChangeRequestCreateSchemaOneOf13Payload: type: object properties: planId: type: string description: The Id of the release plan. This id is an ulid required: - planId ChangeRequestCreateSchema13: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf13Action' description: The name of this action. payload: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf13Payload' description: The Id of the release plan to remove. required: - feature - action - payload ChangeRequestCreateSchemaOneOf14Action: type: string enum: - value: changeMilestoneProgression ChangeRequestCreateSchemaOneOf14Payload: type: object properties: sourceMilestone: type: string description: The ID of the source milestone targetMilestone: type: string description: The ID of the target milestone transitionCondition: $ref: '#/components/schemas/transitionConditionSchema' description: The condition configuration for the transition required: - sourceMilestone - targetMilestone - transitionCondition ChangeRequestCreateSchema14: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf14Action' description: The name of this action. payload: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf14Payload' required: - feature - action - payload ChangeRequestCreateSchemaOneOf15Action: type: string enum: - value: deleteMilestoneProgression ChangeRequestCreateSchemaOneOf15Payload: type: object properties: sourceMilestone: type: string description: The ID of the source milestone with progression to delete. required: - sourceMilestone ChangeRequestCreateSchema15: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf15Action' description: The name of this action. payload: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf15Payload' required: - feature - action - payload ChangeRequestCreateSchemaOneOf16Action: type: string enum: - value: resumeMilestoneProgression ChangeRequestCreateSchemaOneOf16Payload: type: object properties: planId: type: string description: The release plan's unique identifier (ULID format) required: - planId ChangeRequestCreateSchema16: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf16Action' description: The name of this action. payload: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf16Payload' required: - feature - action - payload ChangeRequestCreateSchemaOneOf17Action: type: string enum: - value: changeSafeguard ChangeRequestCreateSchemaOneOf17Payload: type: object properties: planId: type: string description: The ID of the release plan. This ID is an ulid safeguard: $ref: '#/components/schemas/createSafeguardSchema' required: - planId - safeguard ChangeRequestCreateSchema17: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf17Action' description: The name of this action. payload: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf17Payload' required: - feature - action - payload ChangeRequestCreateSchemaOneOf18Action: type: string enum: - value: deleteSafeguard ChangeRequestCreateSchemaOneOf18Payload: type: object properties: planId: type: string description: The ID of the release plan. This ID is an ulid safeguardId: type: string description: The ID of the safeguard to delete. required: - planId - safeguardId ChangeRequestCreateSchema18: type: object properties: feature: type: string description: The name of the feature that this change applies to. action: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf18Action' description: The name of this action. payload: $ref: '#/components/schemas/ChangeRequestCreateSchemaOneOf18Payload' required: - feature - action - payload changeRequestCreateSchema: oneOf: - $ref: '#/components/schemas/ChangeRequestCreateSchema0' - $ref: '#/components/schemas/ChangeRequestCreateSchema1' - $ref: '#/components/schemas/ChangeRequestCreateSchema2' - $ref: '#/components/schemas/ChangeRequestCreateSchema3' - $ref: '#/components/schemas/ChangeRequestCreateSchema4' - $ref: '#/components/schemas/ChangeRequestCreateSchema5' - $ref: '#/components/schemas/ChangeRequestCreateSchema6' - $ref: '#/components/schemas/ChangeRequestCreateSchema7' - $ref: '#/components/schemas/ChangeRequestCreateSchema8' - $ref: '#/components/schemas/ChangeRequestCreateSchema9' - $ref: '#/components/schemas/ChangeRequestCreateSchema10' - $ref: '#/components/schemas/ChangeRequestCreateSchema11' - $ref: '#/components/schemas/ChangeRequestCreateSchema12' - $ref: '#/components/schemas/ChangeRequestCreateSchema13' - $ref: '#/components/schemas/ChangeRequestCreateSchema14' - $ref: '#/components/schemas/ChangeRequestCreateSchema15' - $ref: '#/components/schemas/ChangeRequestCreateSchema16' - $ref: '#/components/schemas/ChangeRequestCreateSchema17' - $ref: '#/components/schemas/ChangeRequestCreateSchema18' ChangeRequestOneOrManyCreateSchema19: type: array items: $ref: '#/components/schemas/changeRequestCreateSchema' changeRequestOneOrManyCreateSchema: oneOf: - $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchema0' - $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchema1' - $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchema2' - $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchema3' - $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchema4' - $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchema5' - $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchema6' - $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchema7' - $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchema8' - $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchema9' - $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchema10' - $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchema11' - $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchema12' - $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchema13' - $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchema14' - $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchema15' - $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchema16' - $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchema17' - $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchema18' - $ref: '#/components/schemas/ChangeRequestOneOrManyCreateSchema19' ChangeRequestChangeSchemaPayload: oneOf: - type: string - type: boolean - type: object additionalProperties: description: Any type - type: number format: double - $ref: '#/components/schemas/setStrategySortOrderSchema' ChangeRequestChangeSchemaCreatedBy: type: object properties: username: type: - string - 'null' description: The user's username. imageUrl: type: - string - 'null' format: uri description: The URL where the user's image can be found. ChangeRequestChangeSchemaScheduleConflictsChangeRequestsItems: type: object properties: id: type: number format: double description: The ID of the change request. title: type: string description: >- The title of the change request, if any. Only present if there is a title. required: - id ChangeRequestChangeSchemaScheduleConflicts: type: object properties: changeRequests: type: array items: $ref: >- #/components/schemas/ChangeRequestChangeSchemaScheduleConflictsChangeRequestsItems description: >- The list of scheduled change requests that would cause conflict with this change. required: - changeRequests changeRequestChangeSchema: type: object properties: id: type: number format: double description: The ID of this change. action: type: string description: The kind of action that the change contains information about. conflict: type: string description: >- A description of the conflict caused by this change. Only present if there are any conflicts. payload: $ref: '#/components/schemas/ChangeRequestChangeSchemaPayload' description: The data required to perform this action. createdBy: $ref: '#/components/schemas/ChangeRequestChangeSchemaCreatedBy' description: The user who created this change. createdAt: type: string format: date-time description: When this change was suggested scheduleConflicts: $ref: '#/components/schemas/ChangeRequestChangeSchemaScheduleConflicts' description: >- Information about scheduled change requests that would casue conflicts with this change if applied. required: - id - action ChangeRequestDefaultChangeSchemaPayload: type: object properties: {} changeRequestDefaultChangeSchema: type: object properties: action: type: string description: The kind of action this is. payload: $ref: '#/components/schemas/ChangeRequestDefaultChangeSchemaPayload' description: The necessary data to perform this change. required: - action - payload changeRequestFeatureSchema: type: object properties: name: type: string description: The name of the feature conflict: type: string description: >- A string describing the conflicts related to this change. Only present if there are any concflicts on the feature level. changes: type: array items: $ref: '#/components/schemas/changeRequestChangeSchema' description: >- List of changes inside change request. This list may be empty when listing all change requests for a project. defaultChange: $ref: '#/components/schemas/changeRequestDefaultChangeSchema' required: - name - changes ChangeRequestSegmentChangeSchemaPayload: oneOf: - type: string - type: boolean - type: object additionalProperties: description: Any type - type: number format: double - $ref: '#/components/schemas/setStrategySortOrderSchema' ChangeRequestSegmentChangeSchemaCreatedBy: type: object properties: username: type: - string - 'null' description: The user's username. imageUrl: type: - string - 'null' format: uri description: The URL where the user's image can be found. ChangeRequestSegmentChangeSchemaScheduleConflictsChangeRequestsItems: type: object properties: id: type: number format: double description: The ID of the change request. title: type: string description: >- The title of the change request, if any. Only present if there is a title. required: - id ChangeRequestSegmentChangeSchemaScheduleConflicts: type: object properties: changeRequests: type: array items: $ref: >- #/components/schemas/ChangeRequestSegmentChangeSchemaScheduleConflictsChangeRequestsItems description: >- The list of scheduled change requests that would cause conflict with this change. required: - changeRequests changeRequestSegmentChangeSchema: type: object properties: id: type: number format: double description: The ID of this change. action: type: string description: The kind of action that the change contains information about. conflict: type: string description: >- A description of the conflict caused by this change. Only present if there are any conflicts. payload: $ref: '#/components/schemas/ChangeRequestSegmentChangeSchemaPayload' description: The data required to perform this action. createdBy: $ref: '#/components/schemas/ChangeRequestSegmentChangeSchemaCreatedBy' description: The user who created this change. createdAt: type: string format: date-time description: When this change was suggested scheduleConflicts: $ref: >- #/components/schemas/ChangeRequestSegmentChangeSchemaScheduleConflicts description: >- Information about scheduled change requests that would casue conflicts with this change if applied. name: type: string description: The current name of the segment required: - id - action - payload - name ChangeRequestApprovalSchemaCreatedBy: type: object properties: id: type: number format: double description: The ID of the user who gave this approval. username: type: string description: The approving user's username. imageUrl: type: string format: uri description: The URL where the user's image can be found. changeRequestApprovalSchema: type: object properties: createdBy: $ref: '#/components/schemas/ChangeRequestApprovalSchemaCreatedBy' description: Information about the user who gave this approval. createdAt: type: string format: date-time description: When the approval was given. required: - createdBy - createdAt ChangeRequestCommentSchemaCreatedBy: type: object properties: username: type: - string - 'null' description: The user's username. imageUrl: type: - string - 'null' format: uri description: The URL where the user's image can be found. changeRequestCommentSchema: type: object properties: id: type: number format: double description: The comment's ID. Unique per change request. text: type: string description: The content of the comment. createdBy: $ref: '#/components/schemas/ChangeRequestCommentSchemaCreatedBy' description: Information about the user who posted the comment createdAt: type: string format: date-time description: When the comment was made. required: - text - createdBy - createdAt ChangeRequestSchemaOneOf0CreatedBy: type: object properties: username: type: - string - 'null' imageUrl: type: - string - 'null' format: uri description: The URL of the user's profile image. ChangeRequestSchemaOneOf0State: type: string enum: - value: Draft - value: In review - value: Approved - value: Applied - value: Cancelled - value: Rejected ChangeRequestSchema0: type: object properties: id: type: number format: double description: This change requests's ID. title: type: string description: A title describing the change request's content. environment: type: string description: The environment in which the changes should be applied. minApprovals: type: number format: double description: >- The minimum number of approvals required before this change request can be applied. project: type: string description: The project this change request belongs to. features: type: array items: $ref: '#/components/schemas/changeRequestFeatureSchema' description: >- The list of features and their changes that relate to this change request. segments: type: array items: $ref: '#/components/schemas/changeRequestSegmentChangeSchema' description: >- The list of segments and their changes that relate to this change request. approvals: type: array items: $ref: '#/components/schemas/changeRequestApprovalSchema' description: A list of approvals that this change request has received. rejections: type: array items: $ref: '#/components/schemas/changeRequestApprovalSchema' description: 'A list of rejections that this change request has received. ' comments: type: array items: $ref: '#/components/schemas/changeRequestCommentSchema' description: All comments that have been made on this change request. createdBy: $ref: '#/components/schemas/ChangeRequestSchemaOneOf0CreatedBy' description: The user who created this change request. createdAt: type: string format: date-time description: When this change request was created. stateTimestamps: type: object additionalProperties: type: string format: date-time description: >- A mapping of each state this change request has entered to the most recent time when it entered that state. If a change request has entered the same state multiple times, only the most recent timestamp will be included. state: $ref: '#/components/schemas/ChangeRequestSchemaOneOf0State' description: The current state of the change request. required: - id - environment - minApprovals - project - features - segments - createdBy - createdAt - stateTimestamps - state ChangeRequestSchemaOneOf1CreatedBy: type: object properties: username: type: - string - 'null' imageUrl: type: - string - 'null' format: uri description: The URL of the user's profile image. ChangeRequestSchemaOneOf1State: type: string enum: - value: Scheduled ChangeRequestScheduleSchemaOneOf0Status: type: string enum: - value: pending ChangeRequestScheduleSchema0: type: object properties: scheduledAt: type: string format: date-time description: When this change request will be applied. status: $ref: '#/components/schemas/ChangeRequestScheduleSchemaOneOf0Status' description: The status of the schedule. required: - scheduledAt - status ChangeRequestScheduleSchemaOneOf1Status: type: string enum: - value: failed ChangeRequestScheduleSchema1: type: object properties: scheduledAt: type: string format: date-time description: When Unleash last attempted to apply this change request. status: $ref: '#/components/schemas/ChangeRequestScheduleSchemaOneOf1Status' description: The status of the schedule. reason: type: string description: The reason the scheduled failed to apply. failureReason: type: - string - 'null' description: >- The reason the scheduled failed to apply. Deprecated in favor of the `reason` property. required: - scheduledAt - status - reason ChangeRequestScheduleSchemaOneOf2Status: type: string enum: - value: suspended ChangeRequestScheduleSchema2: type: object properties: scheduledAt: type: string format: date-time description: >- When Unleash would have attempted to apply this change request if the schedule was not suspended. status: $ref: '#/components/schemas/ChangeRequestScheduleSchemaOneOf2Status' description: The status of the schedule. reason: type: string description: Why the schedule was suspended. required: - scheduledAt - status - reason changeRequestScheduleSchema: oneOf: - $ref: '#/components/schemas/ChangeRequestScheduleSchema0' - $ref: '#/components/schemas/ChangeRequestScheduleSchema1' - $ref: '#/components/schemas/ChangeRequestScheduleSchema2' ChangeRequestSchema1: type: object properties: id: type: number format: double description: This change requests's ID. title: type: string description: A title describing the change request's content. environment: type: string description: The environment in which the changes should be applied. minApprovals: type: number format: double description: >- The minimum number of approvals required before this change request can be applied. project: type: string description: The project this change request belongs to. features: type: array items: $ref: '#/components/schemas/changeRequestFeatureSchema' description: >- The list of features and their changes that relate to this change request. segments: type: array items: $ref: '#/components/schemas/changeRequestSegmentChangeSchema' description: >- The list of segments and their changes that relate to this change request. approvals: type: array items: $ref: '#/components/schemas/changeRequestApprovalSchema' description: A list of approvals that this change request has received. rejections: type: array items: $ref: '#/components/schemas/changeRequestApprovalSchema' description: 'A list of rejections that this change request has received. ' comments: type: array items: $ref: '#/components/schemas/changeRequestCommentSchema' description: All comments that have been made on this change request. createdBy: $ref: '#/components/schemas/ChangeRequestSchemaOneOf1CreatedBy' description: The user who created this change request. createdAt: type: string format: date-time description: When this change request was created. stateTimestamps: type: object additionalProperties: type: string format: date-time description: >- A mapping of each state this change request has entered to the most recent time when it entered that state. If a change request has entered the same state multiple times, only the most recent timestamp will be included. state: $ref: '#/components/schemas/ChangeRequestSchemaOneOf1State' description: The current state of the change request. schedule: $ref: '#/components/schemas/changeRequestScheduleSchema' required: - id - environment - minApprovals - project - features - segments - createdBy - createdAt - stateTimestamps - state - schedule changeRequestSchema: oneOf: - $ref: '#/components/schemas/ChangeRequestSchema0' - $ref: '#/components/schemas/ChangeRequestSchema1' ``` ## SDK Code Examples ```python import requests url = "https://app.unleash-instance.example.com/api/admin/projects/projectId/environments/environment/change-requests" payload = { "action": "updateSegment", "payload": { "name": "beta-users", "constraints": [ { "contextName": "appName", "operator": "IN" } ] } } headers = { "Authorization": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://app.unleash-instance.example.com/api/admin/projects/projectId/environments/environment/change-requests'; const options = { method: 'POST', headers: {Authorization: '', 'Content-Type': 'application/json'}, body: '{"action":"updateSegment","payload":{"name":"beta-users","constraints":[{"contextName":"appName","operator":"IN"}]}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://app.unleash-instance.example.com/api/admin/projects/projectId/environments/environment/change-requests" payload := strings.NewReader("{\n \"action\": \"updateSegment\",\n \"payload\": {\n \"name\": \"beta-users\",\n \"constraints\": [\n {\n \"contextName\": \"appName\",\n \"operator\": \"IN\"\n }\n ]\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://app.unleash-instance.example.com/api/admin/projects/projectId/environments/environment/change-requests") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"action\": \"updateSegment\",\n \"payload\": {\n \"name\": \"beta-users\",\n \"constraints\": [\n {\n \"contextName\": \"appName\",\n \"operator\": \"IN\"\n }\n ]\n }\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://app.unleash-instance.example.com/api/admin/projects/projectId/environments/environment/change-requests") .header("Authorization", "") .header("Content-Type", "application/json") .body("{\n \"action\": \"updateSegment\",\n \"payload\": {\n \"name\": \"beta-users\",\n \"constraints\": [\n {\n \"contextName\": \"appName\",\n \"operator\": \"IN\"\n }\n ]\n }\n}") .asString(); ``` ```php request('POST', 'https://app.unleash-instance.example.com/api/admin/projects/projectId/environments/environment/change-requests', [ 'body' => '{ "action": "updateSegment", "payload": { "name": "beta-users", "constraints": [ { "contextName": "appName", "operator": "IN" } ] } }', 'headers' => [ 'Authorization' => '', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://app.unleash-instance.example.com/api/admin/projects/projectId/environments/environment/change-requests"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"action\": \"updateSegment\",\n \"payload\": {\n \"name\": \"beta-users\",\n \"constraints\": [\n {\n \"contextName\": \"appName\",\n \"operator\": \"IN\"\n }\n ]\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "", "Content-Type": "application/json" ] let parameters = [ "action": "updateSegment", "payload": [ "name": "beta-users", "constraints": [ [ "contextName": "appName", "operator": "IN" ] ] ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://app.unleash-instance.example.com/api/admin/projects/projectId/environments/environment/change-requests")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```