# Get all change requests GET https://app.unleash-instance.example.com/api/admin/projects/{projectId}/change-requests **Enterprise feature** This endpoint will retrieve all change requests regardless of status for a given project. There's an upper limit of last 300 change requests ordered by creation date. Reference: https://docs.getunleash.io/api/get-change-requests-for-project ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Retrieves all change requests for a project version: endpoint_changeRequests.getChangeRequestsForProject paths: /api/admin/projects/{projectId}/change-requests: get: operationId: get-change-requests-for-project summary: Retrieves all change requests for a project description: >- **Enterprise feature** This endpoint will retrieve all change requests regardless of status for a given project. There's an upper limit of last 300 change requests ordered by creation date. tags: - - subpackage_changeRequests parameters: - name: projectId 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: changeRequestsSchema content: application/json: schema: $ref: '#/components/schemas/changeRequestsSchema' components: schemas: 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' 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 ChangeRequestsSchemaItemsOneOf0CreatedBy: type: object properties: username: type: - string - 'null' imageUrl: type: - string - 'null' format: uri description: The URL of the user's profile image. ChangeRequestsSchemaItemsOneOf0State: type: string enum: - value: Draft - value: In review - value: Approved - value: Applied - value: Cancelled - value: Rejected ChangeRequestsSchemaItems0: 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/ChangeRequestsSchemaItemsOneOf0CreatedBy' description: The user who created this change request. createdAt: type: string format: date-time description: When this change request was created. state: $ref: '#/components/schemas/ChangeRequestsSchemaItemsOneOf0State' description: The current state of the change request. required: - id - environment - project - features - segments - createdBy - createdAt - state ChangeRequestsSchemaItemsOneOf1CreatedBy: type: object properties: username: type: - string - 'null' imageUrl: type: - string - 'null' format: uri description: The URL of the user's profile image. ChangeRequestsSchemaItemsOneOf1State: 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' ChangeRequestsSchemaItems1: 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/ChangeRequestsSchemaItemsOneOf1CreatedBy' description: The user who created this change request. createdAt: type: string format: date-time description: When this change request was created. state: $ref: '#/components/schemas/ChangeRequestsSchemaItemsOneOf1State' description: The current state of the change request. schedule: $ref: '#/components/schemas/changeRequestScheduleSchema' required: - id - environment - project - features - segments - createdBy - createdAt - state - schedule ChangeRequestsSchemaItems: oneOf: - $ref: '#/components/schemas/ChangeRequestsSchemaItems0' - $ref: '#/components/schemas/ChangeRequestsSchemaItems1' changeRequestsSchema: type: array items: $ref: '#/components/schemas/ChangeRequestsSchemaItems' ``` ## SDK Code Examples ```python import requests url = "https://app.unleash-instance.example.com/api/admin/projects/projectId/change-requests" headers = {"Authorization": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://app.unleash-instance.example.com/api/admin/projects/projectId/change-requests'; const options = {method: 'GET', headers: {Authorization: ''}}; 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" "net/http" "io" ) func main() { url := "https://app.unleash-instance.example.com/api/admin/projects/projectId/change-requests" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "") 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/change-requests") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = '' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://app.unleash-instance.example.com/api/admin/projects/projectId/change-requests") .header("Authorization", "") .asString(); ``` ```php request('GET', 'https://app.unleash-instance.example.com/api/admin/projects/projectId/change-requests', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://app.unleash-instance.example.com/api/admin/projects/projectId/change-requests"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", ""); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://app.unleash-instance.example.com/api/admin/projects/projectId/change-requests")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers 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() ```