# List feature flag statuses

GET https://app.launchdarkly.com/api/v2/flag-statuses/{projectKey}/{environmentKey}

Get a list of statuses for all feature flags. The status includes the last time the feature flag was requested, as well as a state, which is one of the following:

- `new`: You created the flag fewer than seven days ago and it has never been requested.
- `active`: LaunchDarkly is receiving requests for this flag, but there are either multiple variations configured, or it is toggled off, or there have been changes to configuration in the past seven days.
- `inactive`: You created the feature flag more than seven days ago, and hasn't been requested within the past seven days.
- `launched`: LaunchDarkly is receiving requests for this flag, it is toggled on, there is only one variation configured, and there have been no changes to configuration in the past seven days.

To learn more, read [Flag statuses](https://launchdarkly.com/docs/home/observability/flag-status).


Reference: https://launchdarkly.com/docs/api/feature-flags/get-feature-flag-statuses

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: LaunchDarkly REST API
  version: 1.0.0
paths:
  /api/v2/flag-statuses/{projectKey}/{environmentKey}:
    get:
      operationId: get-feature-flag-statuses
      summary: List feature flag statuses
      description: >
        Get a list of statuses for all feature flags. The status includes the
        last time the feature flag was requested, as well as a state, which is
        one of the following:


        - `new`: You created the flag fewer than seven days ago and it has never
        been requested.

        - `active`: LaunchDarkly is receiving requests for this flag, but there
        are either multiple variations configured, or it is toggled off, or
        there have been changes to configuration in the past seven days.

        - `inactive`: You created the feature flag more than seven days ago, and
        hasn't been requested within the past seven days.

        - `launched`: LaunchDarkly is receiving requests for this flag, it is
        toggled on, there is only one variation configured, and there have been
        no changes to configuration in the past seven days.


        To learn more, read [Flag
        statuses](https://launchdarkly.com/docs/home/observability/flag-status).
      tags:
        - subpackage_featureFlags
      parameters:
        - name: projectKey
          in: path
          description: The project key
          required: true
          schema:
            type: string
            format: string
        - name: environmentKey
          in: path
          description: The environment key
          required: true
          schema:
            type: string
            format: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Flag Statuses collection response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeatureFlagStatuses'
        '401':
          description: Invalid access token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorRep'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenErrorRep'
        '404':
          description: Invalid resource identifier
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorRep'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitedErrorRep'
servers:
  - url: https://app.launchdarkly.com
  - url: https://app.launchdarkly.us
components:
  schemas:
    Link:
      type: object
      properties:
        href:
          type: string
          description: The URL of the link
        type:
          type: string
          description: The type of the link
      title: Link
    FlagStatusRepName:
      type: string
      enum:
        - new
        - inactive
        - active
        - launched
      description: Status of the flag
      title: FlagStatusRepName
    FlagStatusRep:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/FlagStatusRepName'
          description: Status of the flag
        lastRequested:
          type: string
          format: date-time
          description: Timestamp of last time flag was requested
        default:
          description: Default value seen from code
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Link'
      required:
        - name
        - _links
      title: FlagStatusRep
    FeatureFlagStatuses:
      type: object
      properties:
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Link'
        items:
          type: array
          items:
            $ref: '#/components/schemas/FlagStatusRep'
      required:
        - _links
      title: FeatureFlagStatuses
    UnauthorizedErrorRep:
      type: object
      properties:
        code:
          type: string
          description: Specific error code encountered
        message:
          type: string
          description: Description of the error
      required:
        - code
        - message
      title: UnauthorizedErrorRep
    ForbiddenErrorRep:
      type: object
      properties:
        code:
          type: string
          description: Specific error code encountered
        message:
          type: string
          description: Description of the error
      required:
        - code
        - message
      title: ForbiddenErrorRep
    NotFoundErrorRep:
      type: object
      properties:
        code:
          type: string
          description: Specific error code encountered
        message:
          type: string
          description: Description of the error
      required:
        - code
        - message
      title: NotFoundErrorRep
    RateLimitedErrorRep:
      type: object
      properties:
        code:
          type: string
          description: Specific error code encountered
        message:
          type: string
          description: Description of the error
      required:
        - code
        - message
      title: RateLimitedErrorRep
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization

```

## SDK Code Examples

```python
import requests

url = "https://app.launchdarkly.com/api/v2/flag-statuses/projectKey/environmentKey"

headers = {"Authorization": "<apiKey>"}

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

print(response.json())
```

```javascript
const url = 'https://app.launchdarkly.com/api/v2/flag-statuses/projectKey/environmentKey';
const options = {method: 'GET', headers: {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/flag-statuses/projectKey/environmentKey"

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

	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/flag-statuses/projectKey/environmentKey")

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

request = Net::HTTP::Get.new(url)
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/flag-statuses/projectKey/environmentKey")
  .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/flag-statuses/projectKey/environmentKey', [
  'headers' => [
    'Authorization' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://app.launchdarkly.com/api/v2/flag-statuses/projectKey/environmentKey");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://app.launchdarkly.com/api/v2/flag-statuses/projectKey/environmentKey")! 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()
```