# Get all feature types GET https://app.unleash-instance.example.com/api/admin/feature-types Retrieves all feature types that exist in this Unleash instance, along with their descriptions and lifetimes. Reference: https://docs.getunleash.io/api/get-all-feature-types ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Get all feature types version: endpoint_featureTypes.getAllFeatureTypes paths: /api/admin/feature-types: get: operationId: get-all-feature-types summary: Get all feature types description: >- Retrieves all feature types that exist in this Unleash instance, along with their descriptions and lifetimes. tags: - - subpackage_featureTypes parameters: - name: Authorization in: header description: Header authentication of the form `undefined ` required: true schema: type: string responses: '200': description: featureTypesSchema content: application/json: schema: $ref: '#/components/schemas/featureTypesSchema' '401': description: >- Authorization information is missing or invalid. Provide a valid API token as the `authorization` header, e.g. `authorization:*.*.my-admin-token`. content: {} components: schemas: FeatureTypesSchemaVersion: type: string enum: - value: '1' featureTypeSchema: type: object properties: id: type: string description: The identifier of this feature flag type. name: type: string description: The display name of this feature flag type. description: type: string description: >- A description of what this feature flag type is intended to be used for. lifetimeDays: type: - integer - 'null' description: >- How many days it takes before a feature flag of this typed is flagged as [potentially stale](https://docs.getunleash.io/concepts/technical-debt#stale-and-potentially-stale-toggles) by Unleash. If this value is `null`, Unleash will never mark it as potentially stale. required: - id - name - description - lifetimeDays featureTypesSchema: type: object properties: version: $ref: '#/components/schemas/FeatureTypesSchemaVersion' description: >- The schema version used to describe the feature flag types listed in the `types` property. types: type: array items: $ref: '#/components/schemas/featureTypeSchema' description: The list of feature flag types. required: - version - types ``` ## SDK Code Examples ```python import requests url = "https://app.unleash-instance.example.com/api/admin/feature-types" headers = {"Authorization": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://app.unleash-instance.example.com/api/admin/feature-types'; 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/feature-types" 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/feature-types") 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/feature-types") .header("Authorization", "") .asString(); ``` ```php request('GET', 'https://app.unleash-instance.example.com/api/admin/feature-types', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://app.unleash-instance.example.com/api/admin/feature-types"); 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/feature-types")! 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() ```