---
title: "This endpoint will update the state of a change request"
method: PUT
path: "/api/admin/projects/{projectId}/change-requests/{id}/state"
tags: ["Change Requests"]
---

# This endpoint will update the state of a change request

`PUT /api/admin/projects/{projectId}/change-requests/{id}/state`

**Enterprise feature**

This endpoint will update the state of a change request if the business rules allow it. The state can be one of the following: Draft, In review, Approved, Cancelled, Applied. In order to be approved, the change request must have at least one change and the number of approvals must be greater than or equal to the number of approvals required for the environment.

Once a change request has been approved, it can be applied. Once a change request has been applied, it cannot be changed. Once a change request has been cancelled, it cannot be changed. Any change to a change request in the state of Approved will result in the state being set to In Review and the number of approvals will be reset.

## Path parameters

- `projectId` string, required
- `id` string, required

## Response `200`

changeRequestSchema

- union — A [change request](https://docs.getunleash.io/concepts/change-requests)
  - object
    - `id` number, required — This change requests's ID.
    - `title` string — A title describing the change request's content.
    - `environment` string, required — The environment in which the changes should be applied.
    - `minApprovals` number, required — The minimum number of approvals required before this change request can be applied.
    - `project` string, required — The project this change request belongs to.
    - `features` ChangeRequestFeatureSchema[], required — The list of features and their changes that relate to this change request.
      - `name` string, required — The name of the feature
      - `conflict` string — A string describing the conflicts related to this change. Only present if there are any conflicts on the feature level.
      - `changes` ChangeRequestChangeSchema[], required — List of changes inside change request. This list may be empty when listing all change requests for a project.
        - `id` number, required — The ID of this change.
        - `action` string, required — The kind of action that the change contains information about.
        - `conflict` string — A description of the conflict caused by this change. Only present if there are any conflicts.
        - `payload` union — The data required to perform this action.
          - string
          - boolean
          - object
          - number
          - object[] — An array of strategies with their new sort order
            - `id` string, required — The ID of the strategy
            - `sortOrder` number, required — The new sort order of the strategy
        - `createdBy` object — The user who created this change.
          - `username` string, nullable — The user's username.
          - `imageUrl` string, uri, nullable — The URL where the user's image can be found.
        - `createdAt` string, date-time — When this change was suggested
        - `scheduleConflicts` object — Information about scheduled change requests that would casue conflicts with this change if applied.
          - `changeRequests` object[], required — The list of scheduled change requests that would cause conflict with this change.
            - `id` number, required — The ID of the change request.
            - `title` string — The title of the change request, if any. Only present if there is a title.
      - `defaultChange` ChangeRequestDefaultChangeSchema — A description of a default change that will be applied with the change request to prevent invalid states. Default changes are changes that are applied in addition to explicit user-specified changes when a change request is applied. Any default changes are applied in the background and are not a real part of the change request.
        - `action` string, required — The kind of action this is.
        - `payload` object, required — The necessary data to perform this change.
    - `segments` ChangeRequestSegmentChangeSchema[], required — The list of segments and their changes that relate to this change request.
      - `id` number, required — The ID of this change.
      - `action` string, required — The kind of action that the change contains information about.
      - `conflict` string — A description of the conflict caused by this change. Only present if there are any conflicts.
      - `payload` union, required — The data required to perform this action.
        - string
        - boolean
        - object
        - number
        - object[] — An array of strategies with their new sort order
          - `id` string, required — The ID of the strategy
          - `sortOrder` number, required — The new sort order of the strategy
      - `createdBy` object — The user who created this change.
        - `username` string, nullable — The user's username.
        - `imageUrl` string, uri, nullable — The URL where the user's image can be found.
      - `createdAt` string, date-time — When this change was suggested
      - `scheduleConflicts` object — Information about scheduled change requests that would casue conflicts with this change if applied.
        - `changeRequests` object[], required — The list of scheduled change requests that would cause conflict with this change.
          - `id` number, required — The ID of the change request.
          - `title` string — The title of the change request, if any. Only present if there is a title.
      - `name` string, required — The current name of the segment
    - `approvals` ChangeRequestApprovalSchema[] — A list of approvals that this change request has received.
      - `createdBy` object, required — Information about the user who gave this approval.
        - `id` number — The ID of the user who gave this approval.
        - `username` string — The approving user's username.
        - `imageUrl` string, uri — The URL where the user's image can be found.
      - `createdAt` string, date-time, required — When the approval was given.
    - `rejections` ChangeRequestApprovalSchema[] — A list of rejections that this change request has received.
      - `createdBy` object, required — Information about the user who gave this approval.
        - `id` number — The ID of the user who gave this approval.
        - `username` string — The approving user's username.
        - `imageUrl` string, uri — The URL where the user's image can be found.
      - `createdAt` string, date-time, required — When the approval was given.
    - `comments` ChangeRequestCommentSchema[] — All comments that have been made on this change request.
      - `id` number — The comment's ID. Unique per change request.
      - `text` string, required — The content of the comment.
      - `createdBy` object, required — Information about the user who posted the comment
        - `username` string, nullable — The user's username.
        - `imageUrl` string, uri, nullable — The URL where the user's image can be found.
      - `createdAt` string, date-time, required — When the comment was made.
    - `createdBy` object, required — The user who created this change request.
      - `username` string, nullable
      - `imageUrl` string, uri, nullable — The URL of the user's profile image.
    - `createdAt` string, date-time, required — When this change request was created.
    - `stateTimestamps` object, required — 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` 'Draft' | 'In review' | 'Approved' | 'Applied' | 'Cancelled' | 'Rejected', required — The current state of the change request.
  - object
    - `id` number, required — This change requests's ID.
    - `title` string — A title describing the change request's content.
    - `environment` string, required — The environment in which the changes should be applied.
    - `minApprovals` number, required — The minimum number of approvals required before this change request can be applied.
    - `project` string, required — The project this change request belongs to.
    - `features` ChangeRequestFeatureSchema[], required — The list of features and their changes that relate to this change request.
      - `name` string, required — The name of the feature
      - `conflict` string — A string describing the conflicts related to this change. Only present if there are any conflicts on the feature level.
      - `changes` ChangeRequestChangeSchema[], required — List of changes inside change request. This list may be empty when listing all change requests for a project.
        - `id` number, required — The ID of this change.
        - `action` string, required — The kind of action that the change contains information about.
        - `conflict` string — A description of the conflict caused by this change. Only present if there are any conflicts.
        - `payload` union — The data required to perform this action.
          - string
          - boolean
          - object
          - number
          - object[] — An array of strategies with their new sort order
            - `id` string, required — The ID of the strategy
            - `sortOrder` number, required — The new sort order of the strategy
        - `createdBy` object — The user who created this change.
          - `username` string, nullable — The user's username.
          - `imageUrl` string, uri, nullable — The URL where the user's image can be found.
        - `createdAt` string, date-time — When this change was suggested
        - `scheduleConflicts` object — Information about scheduled change requests that would casue conflicts with this change if applied.
          - `changeRequests` object[], required — The list of scheduled change requests that would cause conflict with this change.
            - `id` number, required — The ID of the change request.
            - `title` string — The title of the change request, if any. Only present if there is a title.
      - `defaultChange` ChangeRequestDefaultChangeSchema — A description of a default change that will be applied with the change request to prevent invalid states. Default changes are changes that are applied in addition to explicit user-specified changes when a change request is applied. Any default changes are applied in the background and are not a real part of the change request.
        - `action` string, required — The kind of action this is.
        - `payload` object, required — The necessary data to perform this change.
    - `segments` ChangeRequestSegmentChangeSchema[], required — The list of segments and their changes that relate to this change request.
      - `id` number, required — The ID of this change.
      - `action` string, required — The kind of action that the change contains information about.
      - `conflict` string — A description of the conflict caused by this change. Only present if there are any conflicts.
      - `payload` union, required — The data required to perform this action.
        - string
        - boolean
        - object
        - number
        - object[] — An array of strategies with their new sort order
          - `id` string, required — The ID of the strategy
          - `sortOrder` number, required — The new sort order of the strategy
      - `createdBy` object — The user who created this change.
        - `username` string, nullable — The user's username.
        - `imageUrl` string, uri, nullable — The URL where the user's image can be found.
      - `createdAt` string, date-time — When this change was suggested
      - `scheduleConflicts` object — Information about scheduled change requests that would casue conflicts with this change if applied.
        - `changeRequests` object[], required — The list of scheduled change requests that would cause conflict with this change.
          - `id` number, required — The ID of the change request.
          - `title` string — The title of the change request, if any. Only present if there is a title.
      - `name` string, required — The current name of the segment
    - `approvals` ChangeRequestApprovalSchema[] — A list of approvals that this change request has received.
      - `createdBy` object, required — Information about the user who gave this approval.
        - `id` number — The ID of the user who gave this approval.
        - `username` string — The approving user's username.
        - `imageUrl` string, uri — The URL where the user's image can be found.
      - `createdAt` string, date-time, required — When the approval was given.
    - `rejections` ChangeRequestApprovalSchema[] — A list of rejections that this change request has received.
      - `createdBy` object, required — Information about the user who gave this approval.
        - `id` number — The ID of the user who gave this approval.
        - `username` string — The approving user's username.
        - `imageUrl` string, uri — The URL where the user's image can be found.
      - `createdAt` string, date-time, required — When the approval was given.
    - `comments` ChangeRequestCommentSchema[] — All comments that have been made on this change request.
      - `id` number — The comment's ID. Unique per change request.
      - `text` string, required — The content of the comment.
      - `createdBy` object, required — Information about the user who posted the comment
        - `username` string, nullable — The user's username.
        - `imageUrl` string, uri, nullable — The URL where the user's image can be found.
      - `createdAt` string, date-time, required — When the comment was made.
    - `createdBy` object, required — The user who created this change request.
      - `username` string, nullable
      - `imageUrl` string, uri, nullable — The URL of the user's profile image.
    - `createdAt` string, date-time, required — When this change request was created.
    - `stateTimestamps` object, required — 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` 'Scheduled', required — The current state of the change request.
    - `schedule` union, required — A schedule for a change request's application. The schedule can either be pending, failed, or suspended. The schedule will always contain the state of the schedule and the last scheduled time, but other data varies between the different states.
      - object — A pending schedule for a change request.
        - `scheduledAt` string, date-time, required — When this change request will be applied.
        - `status` 'pending', required — The status of the schedule.
      - object — A failed schedule for a change request.
        - `scheduledAt` string, date-time, required — When Unleash last attempted to apply this change request.
        - `status` 'failed', required — The status of the schedule.
        - `reason` string, required — The reason the scheduled failed to apply.
        - `failureReason` string, nullable — The reason the scheduled failed to apply. Deprecated in favor of the `reason` property.
      - object — A suspended schedule for a change request.
        - `scheduledAt` string, date-time, required — When Unleash would have attempted to apply this change request if the schedule was not suspended.
        - `status` 'suspended', required — The status of the schedule.
        - `reason` string, required — Why the schedule was suspended.

---

[API](https://skmtc.net/unleash/apis/unleash-api-3.md) · [All operations](https://skmtc.net/unleash/apis/unleash-api-3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/unleash/unleash-api-3/revisions/b2c3116e633e/schema)
