> ## Documentation Index
> Fetch the complete documentation index at: https://docs2.growthbook.io/llms.txt
> Use this file to discover all available pages before exploring further.

# API

> API

GrowthBook offers a full REST API for interacting with the application.

[View REST API Docs](/api/introduction)

## SDK Connection Endpoints

In addition to the REST API above, there is one additional readonly endpoint - the SDK Connection Endpoint.

The SDK Connection Endpoint provides readonly access to a subset of your feature flag data, just enough for the [GrowthBook SDKs](/lib) to assign values to users. They are meant to be public and do not require authentication to view.

In **GrowthBook Cloud**, the SDK Connection Endpoints are served from our global CDN: `https://cdn.growthbook.io/api/features/...`. If you are self-hosting, you can use [your own CDN](/self-host/cdn) or run the [GrowthBook Proxy server](/self-host/proxy), which provides built-in caching and performance optimizations.

SDK Connection Endpoints are scoped to a single Environment (e.g. `dev` or `production`) and can also be scoped to a single Project. Manage all of your SDK Connections on the **Features → SDKs** page.

<AccordionGroup>
  <Accordion title="Typescript Type Definition">
    ```ts theme={null}
    interface SDKEndpointResponse {
      status: 200;
      features: {
        [key: string]: FeatureDefinition
      }
    }

    interface FeatureDefinition {
      defaultValue: any;
      rules?: FeatureDefinitionRule[];
    }

    interface FeatureDefinitionRule {
      force?: any;
      weights?: number[];
      variations?: any[];
      hashAttribute?: string;
      hashVersion?: number;
      seed?: string;
      namespace?: [string, number, number];
      key?: string;
      coverage?: number;
      condition?: any;
      meta?: VariationMeta[];
      name?: string;
      phase?: string;
    }

    interface VariationMeta = {
      passthrough?: boolean;
      key?: string;
      name?: string;
    }
    ```
  </Accordion>

  <Accordion title="Example JSON object">
    ```json theme={null}
    {
      "status": 200,
      "features": {
        "feature-key": {
          "defaultValue": true
        },
        "another-feature": {
          "defaultValue": "blue",
          "rules": [
            {
              "condition": {
                "browser": "firefox"
              },
              "force": "green"
            }
          ]
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### Encryption

If you've enabled encryption for your SDK endpoint, the response format changes:

<AccordionGroup>
  <Accordion title="Typescript Type Definition">
    ```ts theme={null}
    interface SDKEncryptedEndpointResponse {
      status: 200;
      encryptedFeatures: string;
    }
    ```
  </Accordion>

  <Accordion title="Example JSON object">
    ```json theme={null}
    {
      "status": 200,
      "encryptedFeatures": "abcdef123456GHIJKL0987654321..."
    }
    ```
  </Accordion>
</AccordionGroup>

You will need to decrypt the features first before passing into the SDK. Our front-end SDKs (Javascript and React) handle this for you automatically and we're in the process of adding built-in support to our other SDKs.
