# Get approval request settings

GET https://app.launchdarkly.com/api/v2/approval-requests/projects/{projectKey}/settings

Get the approval request settings for the given project, optionally filtered by environment and resource kind.

Reference: https://launchdarkly.com/docs/api/approvals-beta/get-approval-request-settings

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: LaunchDarkly REST API
  version: 1.0.0
paths:
  /api/v2/approval-requests/projects/{projectKey}/settings:
    get:
      operationId: get-approval-request-settings
      summary: Get approval request settings
      description: >-
        Get the approval request settings for the given project, optionally
        filtered by environment and resource kind.
      tags:
        - subpackage_approvalsBeta
      parameters:
        - name: projectKey
          in: path
          required: true
          schema:
            type: string
        - name: environmentKey
          in: query
          description: An environment key filter to apply to the approval request settings.
          required: false
          schema:
            type: string
        - name: resourceKind
          in: query
          description: A resource kind filter to apply to the approval request settings.
          required: false
          schema:
            type: string
        - name: expand
          in: query
          description: >-
            A comma-separated list of fields to expand in the response. Options
            include 'default' and 'strict'.
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
        - name: LD-API-Version
          in: header
          description: Version of the endpoint.
          required: true
          schema:
            $ref: >-
              #/components/schemas/ApiV2ApprovalRequestsProjectsProjectKeySettingsGetParametersLdApiVersion
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalRequestSettings'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
servers:
  - url: https://app.launchdarkly.com
  - url: https://app.launchdarkly.us
components:
  schemas:
    ApiV2ApprovalRequestsProjectsProjectKeySettingsGetParametersLdApiVersion:
      type: string
      enum:
        - beta
      title: ApiV2ApprovalRequestsProjectsProjectKeySettingsGetParametersLdApiVersion
    ApprovalRequestSetting:
      type: object
      properties:
        required:
          type: boolean
          description: If approvals are required for this environment
        bypassApprovalsForPendingChanges:
          type: boolean
          description: Whether to skip approvals for pending changes
        minNumApprovals:
          type: integer
          description: >
            Sets the amount of approvals required before a member can apply a
            change. The minimum is one and the maximum is five.
        canReviewOwnRequest:
          type: boolean
          description: >-
            Allow someone who makes an approval request to apply their own
            change
        canApplyDeclinedChanges:
          type: boolean
          description: >-
            Allow applying the change as long as at least one person has
            approved
        autoApplyApprovedChanges:
          type:
            - boolean
            - 'null'
          description: >
            Automatically apply changes that have been approved by all
            reviewers. This field is only applicable for approval services other
            than LaunchDarkly.
        serviceKind:
          type: string
          description: Which service to use for managing approvals
        serviceConfig:
          type: object
          additionalProperties:
            description: Any type
          description: Arbitrary service-specific configuration
        requiredApprovalTags:
          type: array
          items:
            type: string
          description: >
            Require approval only on flags with the provided tags. Otherwise all
            flags will require approval.
        serviceKindConfigurationId:
          type:
            - string
            - 'null'
          description: >
            Optional integration configuration ID of a custom approval
            integration. This is an Enterprise-only feature.
      required:
        - required
        - bypassApprovalsForPendingChanges
        - minNumApprovals
        - canReviewOwnRequest
        - canApplyDeclinedChanges
        - serviceKind
        - serviceConfig
        - requiredApprovalTags
      description: >-
        Configuration that controls how changes to a resource are gated by
        approvals.
      title: ApprovalRequestSetting
    ApprovalRequestSettingWithEnvs:
      type: object
      properties:
        environments:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/ApprovalRequestSetting'
          description: Environment-specific overrides.
        _default:
          $ref: '#/components/schemas/ApprovalRequestSetting'
        _strict:
          $ref: '#/components/schemas/ApprovalRequestSetting'
      title: ApprovalRequestSettingWithEnvs
    ApprovalRequestSettings:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/ApprovalRequestSettingWithEnvs'
      title: ApprovalRequestSettings
    Error:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
      required:
        - message
        - code
      title: Error
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization

```

## SDK Code Examples

```python
import requests

url = "https://app.launchdarkly.com/api/v2/approval-requests/projects/default/settings"

querystring = {"expand":"default,strict"}

headers = {
    "LD-API-Version": "beta",
    "Authorization": "<apiKey>"
}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://app.launchdarkly.com/api/v2/approval-requests/projects/default/settings?expand=default%2Cstrict';
const options = {method: 'GET', headers: {'LD-API-Version': 'beta', Authorization: '<apiKey>'}};

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.launchdarkly.com/api/v2/approval-requests/projects/default/settings?expand=default%2Cstrict"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("LD-API-Version", "beta")
	req.Header.Add("Authorization", "<apiKey>")

	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.launchdarkly.com/api/v2/approval-requests/projects/default/settings?expand=default%2Cstrict")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["LD-API-Version"] = 'beta'
request["Authorization"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://app.launchdarkly.com/api/v2/approval-requests/projects/default/settings?expand=default%2Cstrict")
  .header("LD-API-Version", "beta")
  .header("Authorization", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://app.launchdarkly.com/api/v2/approval-requests/projects/default/settings?expand=default%2Cstrict', [
  'headers' => [
    'Authorization' => '<apiKey>',
    'LD-API-Version' => 'beta',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://app.launchdarkly.com/api/v2/approval-requests/projects/default/settings?expand=default%2Cstrict");
var request = new RestRequest(Method.GET);
request.AddHeader("LD-API-Version", "beta");
request.AddHeader("Authorization", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "LD-API-Version": "beta",
  "Authorization": "<apiKey>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://app.launchdarkly.com/api/v2/approval-requests/projects/default/settings?expand=default%2Cstrict")! 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()
```