---
title: Get an Extension
slug: web-experimentation/api/get-an-extension
docTags: 
createdAt: 2026-10-02T13:15:18.296Z
---

{
  "id": "uBsA3G_dmpTl4ja91hABy",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.optimizely.com/v2/extensions/{extension_id}",
    "servers": [
      {
        "url": "https://api.optimizely.com/v2/extensions/{extension_id}"
      }
    ],
    "name": "Get an Extension",
    "description": "Get an Extension by ID",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "extension_id",
          "type": "integer<int64>",
          "description": "The ID of the extension you'd like to get",
          "format": "int64"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKey",
          "name": "apiKey",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        },
        {
          "id": "OAuth2",
          "name": "OAuth2",
          "kind": "optional",
          "type": "oauth2",
          "description": "<p>Write applications that authenticate with the REST API via OAuth 2.0. Or, to authenticate using a personal token, see <a href=\"https://docs.developers.optimizely.com/web/docs/personal-token\" target=\"_blank\">https://docs.developers.optimizely.com/web/docs/personal-token</a></p>",
          "oauth2Flows": {
            "authorizationCode": {
              "authorizationUrl": "https://app.optimizely.com/oauth2/authorize",
              "tokenUrl": "https://app.optimizely.com/oauth2/token",
              "scopes": {
                "all": "Full access to your account"
              }
            }
          },
          "requiredScopes": [
            "read",
            "write"
          ]
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Return extension info",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Extension",
            "schema": [
              {
                "name": "archived",
                "kind": "optional",
                "type": "boolean",
                "readOnly": true,
                "description": "Whether the extension is archived"
              },
              {
                "name": "created",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "The time when the extension was initially created",
                "format": "date-time"
              },
              {
                "name": "description",
                "kind": "optional",
                "type": "string",
                "description": "The description for the extension"
              },
              {
                "name": "edit_url",
                "kind": "required",
                "type": "string",
                "description": "The URL to load when editing the extension"
              },
              {
                "name": "enabled",
                "kind": "optional",
                "type": "boolean",
                "description": "Whether the extension is enabled. A disabled extension won't appear in the editor and won't be built into the snippet"
              },
              {
                "name": "experiment_count",
                "kind": "optional",
                "type": "integer<int64>",
                "readOnly": true,
                "description": "<p>Number of experiments that reference this extension across all statuses (running, paused, draft, archived). Computed by the upstream service.</p>",
                "example": 3,
                "format": "int64"
              },
              {
                "name": "fields",
                "kind": "optional",
                "type": "array",
                "description": "Array of editable fields in the extension",
                "modelRef": "#/components/schemas/Field",
                "customType": "Field[]",
                "schema": [
                  {
                    "name": "api_name",
                    "kind": "required",
                    "type": "string",
                    "description": "The API name of the field"
                  },
                  {
                    "name": "default_value",
                    "kind": "required",
                    "type": "string",
                    "description": "<p>A string in JSON format that corresponds to the default_value of the field</p>"
                  },
                  {
                    "name": "field_type",
                    "kind": "required",
                    "type": "string<selector | text | multi_text | rich_text | number | html | css | js | toggle | dropdown | multi_select | image | color | slider>",
                    "description": "The type of the field",
                    "enum": [
                      "selector",
                      "text",
                      "multi_text",
                      "rich_text",
                      "number",
                      "html",
                      "css",
                      "js",
                      "toggle",
                      "dropdown",
                      "multi_select",
                      "image",
                      "color",
                      "slider"
                    ]
                  },
                  {
                    "name": "label",
                    "kind": "required",
                    "type": "string",
                    "description": "The label of the field"
                  },
                  {
                    "name": "options",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/components/schemas/Options",
                    "customType": "Options",
                    "schema": [
                      {
                        "name": "choices",
                        "kind": "optional",
                        "type": "array",
                        "description": "The choices for a field",
                        "modelRef": "#/components/schemas/Choices",
                        "customType": "Choices[]",
                        "schema": [
                          {
                            "name": "label",
                            "kind": "optional",
                            "type": "string",
                            "description": "label of the choice"
                          },
                          {
                            "name": "value",
                            "kind": "optional",
                            "type": "string",
                            "description": "value of the choice"
                          }
                        ]
                      }
                    ]
                  }
                ]
              },
              {
                "name": "id",
                "kind": "optional",
                "type": "integer<int64>",
                "readOnly": true,
                "description": "The unique identifier for the extension",
                "example": 3000,
                "format": "int64"
              },
              {
                "name": "implementation",
                "kind": "required",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/Implementation",
                "customType": "Implementation",
                "schema": [
                  {
                    "name": "apply_js",
                    "kind": "optional",
                    "type": "string",
                    "description": "The Apply JS code is used to inject the extension onto the page",
                    "default": ""
                  },
                  {
                    "name": "css",
                    "kind": "optional",
                    "type": "string",
                    "description": "<p>Some extensions may not need any CSS because they inherit styles from the page itself. However, you can add additional styling here. This will be injected on the page through a  tag</p>",
                    "default": ""
                  },
                  {
                    "name": "html",
                    "kind": "optional",
                    "type": "string",
                    "description": "The html implementation of the field",
                    "default": ""
                  },
                  {
                    "name": "reset_js",
                    "kind": "optional",
                    "type": "string",
                    "description": "<p>Reset JS is used to \"clean up\" after a extension. It's used in the editor, when changing field values or removing an existing extension. Reset JS should remove the element and any other side-effects</p>",
                    "default": ""
                  }
                ]
              },
              {
                "name": "last_modified",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "The last time when the extension was modified",
                "format": "date-time"
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "Name of the extension",
                "example": "My Extension"
              },
              {
                "name": "project_id",
                "kind": "required",
                "type": "integer<int64>",
                "description": "The project the extension is in",
                "example": 1000,
                "format": "int64"
              }
            ],
            "modelRef": "#/components/schemas/Extension",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "Invalid credentials",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Error",
            "schema": [
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "messages",
                "kind": "optional",
                "type": "object",
                "description": "",
                "example": "",
                "schema": []
              },
              {
                "name": "uuid",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "403",
        "description": "You do not have permission to access the specified Extension",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Error",
            "schema": [
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "messages",
                "kind": "optional",
                "type": "object",
                "description": "",
                "example": "",
                "schema": []
              },
              {
                "name": "uuid",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Extension not found or invalid ID supplied",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Error",
            "schema": [
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "messages",
                "kind": "optional",
                "type": "object",
                "description": "",
                "example": "",
                "schema": []
              },
              {
                "name": "uuid",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Unexpected error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Error",
            "schema": [
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "messages",
                "kind": "optional",
                "type": "object",
                "description": "",
                "example": "",
                "schema": []
              },
              {
                "name": "uuid",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "-eTyXMxU1l2B2cOh9Xv0r",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.optimizely.com/v2/extensions/{extension_id} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "cZGcCkiW5SgixcCuary-U",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.optimizely.com/v2/extensions/{extension_id}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "1p-nSfWTomXqP8nuyya-m",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.optimizely.com/v2/extensions/{extension_id}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "6lLLNxXaDwL-Wa2KQ_m9P",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.optimizely.com/v2/extensions/{extension_id}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "-eTyXMxU1l2B2cOh9Xv0r"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Return extension info\n{\n  \"archived\": false,\n  \"created\": \"\",\n  \"description\": \"\",\n  \"edit_url\": \"\",\n  \"enabled\": false,\n  \"experiment_count\": 3,\n  \"fields\": [\n    {\n      \"api_name\": \"\",\n      \"default_value\": \"\",\n      \"field_type\": \"\",\n      \"label\": \"\",\n      \"options\": {\n        \"choices\": [\n          {\n            \"label\": \"\",\n            \"value\": \"\"\n          }\n        ]\n      }\n    }\n  ],\n  \"id\": 3000,\n  \"implementation\": {\n    \"apply_js\": \"\",\n    \"css\": \"\",\n    \"html\": \"\",\n    \"reset_js\": \"\"\n  },\n  \"last_modified\": \"\",\n  \"name\": \"My Extension\",\n  \"project_id\": 1000\n}"
        },
        {
          "id": "response-1-401",
          "language": "401",
          "code": "// Invalid credentials\n{\n  \"code\": \"\",\n  \"message\": \"\",\n  \"messages\": {},\n  \"uuid\": \"\"\n}"
        },
        {
          "id": "response-2-403",
          "language": "403",
          "code": "// You do not have permission to access the specified Extension\n{\n  \"code\": \"\",\n  \"message\": \"\",\n  \"messages\": {},\n  \"uuid\": \"\"\n}"
        },
        {
          "id": "response-3-404",
          "language": "404",
          "code": "// Extension not found or invalid ID supplied\n{\n  \"code\": \"\",\n  \"message\": \"\",\n  \"messages\": {},\n  \"uuid\": \"\"\n}"
        },
        {
          "id": "response-4-default",
          "language": "default",
          "code": "// Unexpected error\n{\n  \"code\": \"\",\n  \"message\": \"\",\n  \"messages\": {},\n  \"uuid\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}