# Search change requests GET https://app.unleash-instance.example.com/api/admin/search/change-requests **Enterprise feature** Search and filter change requests by creator and approver. Reference: https://docs.getunleash.io/api/search-change-requests ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Search change requests version: endpoint_changeRequests.searchChangeRequests paths: /api/admin/search/change-requests: get: operationId: search-change-requests summary: Search change requests description: |- **Enterprise feature** Search and filter change requests by creator and approver. tags: - - subpackage_changeRequests parameters: - name: createdBy in: query description: Filter by change request creator user ID required: false schema: type: string - name: requestedApproverId in: query description: Filter by requested approver user ID required: false schema: type: string - name: state in: query description: >- Filter by open / closed change requests. Change requests that are in 'draft', 'in review', 'approved', or 'scheduled' states are considered open. Change requests that are in 'cancelled', 'applied', or 'rejected' states are considered closed. required: false schema: $ref: >- #/components/schemas/ApiAdminSearchChangeRequestsGetParametersState - name: offset in: query description: >- The number of change requests to skip when returning a page. By default it is set to 0. required: false schema: type: integer default: 0 - name: limit in: query description: >- The number of change requests to return in a page. By default it is set to 50. The maximum is 1000. required: false schema: type: integer default: 50 - name: Authorization in: header description: Header authentication of the form `undefined ` required: true schema: type: string responses: '200': description: changeRequestSearchResponseSchema content: application/json: schema: $ref: '#/components/schemas/changeRequestSearchResponseSchema' '401': description: >- Authorization information is missing or invalid. Provide a valid API token as the `authorization` header, e.g. `authorization:*.*.my-admin-token`. content: {} '403': description: >- The provided user credentials are valid, but the user does not have the necessary permissions to perform this operation content: {} '404': description: The requested resource was not found. content: {} components: schemas: ApiAdminSearchChangeRequestsGetParametersState: type: string enum: - value: IS:open - value: IS:closed ChangeRequestSearchItemSchemaOneOf0CreatedBy: type: object properties: id: type: number format: double description: Unique identifier of the user. username: type: string description: Username of the user. imageUrl: type: string format: uri description: Avatar image URL for the user. required: - id ChangeRequestSearchItemSchemaOneOf0State: type: string enum: - value: Draft - value: Approved - value: In review - value: Applied - value: Rejected - value: Cancelled ChangeRequestSearchItemSchema0: type: object properties: id: type: number format: double description: Unique identifier for the change request. title: type: string description: >- Title of the change request. Only present if a custom title is set for this change request. environment: type: string description: Environment where the change request applies. project: type: string description: Project ID where the change request belongs. createdBy: $ref: '#/components/schemas/ChangeRequestSearchItemSchemaOneOf0CreatedBy' description: User who created the change request. createdAt: type: string format: date-time description: Date and time when the change request was created. features: type: array items: type: string description: List of feature names affected by this change request. segments: type: array items: type: string description: List of segment names affected by this change request. state: $ref: '#/components/schemas/ChangeRequestSearchItemSchemaOneOf0State' description: The current state of the change request. required: - id - environment - project - createdBy - createdAt - features - segments - state ChangeRequestSearchItemSchemaOneOf1CreatedBy: type: object properties: id: type: number format: double description: Unique identifier of the user. username: type: string description: Username of the user. imageUrl: type: string format: uri description: Avatar image URL for the user. required: - id ChangeRequestSearchItemSchemaOneOf1State: 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' ChangeRequestSearchItemSchema1: type: object properties: id: type: number format: double description: Unique identifier for the change request. title: type: string description: >- Title of the change request. Only present if a custom title is set for this change request. environment: type: string description: Environment where the change request applies. project: type: string description: Project ID where the change request belongs. createdBy: $ref: '#/components/schemas/ChangeRequestSearchItemSchemaOneOf1CreatedBy' description: User who created the change request. createdAt: type: string format: date-time description: Date and time when the change request was created. features: type: array items: type: string description: List of feature names affected by this change request. segments: type: array items: type: string description: List of segment names affected by this change request. state: $ref: '#/components/schemas/ChangeRequestSearchItemSchemaOneOf1State' description: The current state of the change request. schedule: $ref: '#/components/schemas/changeRequestScheduleSchema' required: - id - environment - project - createdBy - createdAt - features - segments - state - schedule changeRequestSearchItemSchema: oneOf: - $ref: '#/components/schemas/ChangeRequestSearchItemSchema0' - $ref: '#/components/schemas/ChangeRequestSearchItemSchema1' changeRequestSearchResponseSchema: type: object properties: changeRequests: type: array items: $ref: '#/components/schemas/changeRequestSearchItemSchema' description: List of change requests matching the search criteria. total: type: number format: double description: Total number of change requests matching the search criteria. required: - changeRequests - total ``` ## SDK Code Examples ```python import requests url = "https://app.unleash-instance.example.com/api/admin/search/change-requests" headers = {"Authorization": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://app.unleash-instance.example.com/api/admin/search/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/search/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/search/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/search/change-requests") .header("Authorization", "") .asString(); ``` ```php request('GET', 'https://app.unleash-instance.example.com/api/admin/search/change-requests', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://app.unleash-instance.example.com/api/admin/search/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/search/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() ```