---
title: Fetch a Single Report
slug: feature-experimentation/api/fetch-a-single-report
docTags: 
createdAt: 2026-08-28T15:54:06.731Z
---

{
  "id": "ed0BEiw8sbptGkI3cbTnn",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.optimizely.com/flags/v1//projects/{project_id}/environments/{environment_key}/reports/{report_key}",
    "servers": [
      {
        "url": "https://api.optimizely.com/flags/v1//projects/{project_id}/environments/{environment_key}/reports/{report_key}"
      }
    ],
    "name": "Fetch a Single Report",
    "description": "<p>Fetch a single Report in an Environment of a Project by its key.</p>\n<p>This operation corresponds to the <code>fetch_report_url</code> in a Report response.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "project_id",
          "type": "integer",
          "example": 12345,
          "description": "The project identifier"
        },
        {
          "kind": "required",
          "name": "environment_key",
          "type": "string",
          "example": "production",
          "description": "The Environment identifier"
        },
        {
          "kind": "required",
          "name": "report_key",
          "type": "string",
          "example": "paid_users_45633910",
          "description": "<p>The Report identifier. Get the key from the List Reports endpoint (key is not displayed in the Optimizely app)</p>"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKey",
          "name": "apiKey",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        },
        {
          "id": "OAuth2",
          "name": "OAuth2",
          "kind": "optional",
          "type": "oauth2",
          "description": "Write applications that authenticate with the REST API via OAuth 2.0.",
          "oauth2Flows": {
            "authorizationCode": {
              "authorizationUrl": "https://app.optimizely.com/oauth2/authorize",
              "tokenUrl": "https://app.optimizely.com/oauth2/token",
              "scopes": {
                "all": "Grants all access"
              }
            }
          },
          "requiredScopes": [
            "read",
            "write"
          ]
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "<p>Successful retrieval of a Report.</p>\n<p>The response includes RESTful JSON (<a href=\"https://restfuljson.org/\" target=\"_blank\">https://restfuljson.org/</a>) styled links. If a\nlink is not present in the response, it indicates a user is not authorized to access\nthe related resource.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "Report with results for the active rule for a flag in a project.",
            "customType": "Report",
            "schema": [
              {
                "name": "archive_url",
                "kind": "optional",
                "type": "object",
                "readOnly": true,
                "description": "Link to archive this Report",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "UrlValue",
                    "description": "",
                    "modelRef": "#/components/schemas/UrlValue",
                    "schema": []
                  }
                ],
                "schema": []
              },
              {
                "name": "archived",
                "kind": "optional",
                "type": "boolean",
                "description": "Indicates if the Report is archived or not",
                "example": false
              },
              {
                "name": "created_time",
                "kind": "required",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "Timestamp when the Report is created",
                "example": "2019-05-08T00:00:00.000Z",
                "format": "date-time"
              },
              {
                "name": "delete_url",
                "kind": "optional",
                "type": "object",
                "readOnly": true,
                "description": "Link to delete this Report",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "UrlValue",
                    "description": "",
                    "modelRef": "#/components/schemas/UrlValue",
                    "schema": []
                  }
                ],
                "schema": []
              },
              {
                "name": "description",
                "kind": "optional",
                "type": "string",
                "description": "Additional context of the Report",
                "example": "Detailed context about the report is here."
              },
              {
                "name": "distribution_mode",
                "kind": "optional",
                "type": "string<manual | stats_accelerator>",
                "readOnly": true,
                "nullable": true,
                "description": "Type of rule distribution",
                "enum": [
                  "manual",
                  "stats_accelerator"
                ]
              },
              {
                "name": "end_time",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "Timestamp until when the Report is computed",
                "example": "2019-05-08T00:00:00.000Z",
                "format": "date-time"
              },
              {
                "name": "fetch_flag_url",
                "kind": "optional",
                "type": "object",
                "readOnly": true,
                "description": "Link to flag url to which this report belongs to",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "UrlValue",
                    "description": "",
                    "modelRef": "#/components/schemas/UrlValue",
                    "schema": []
                  }
                ],
                "schema": []
              },
              {
                "name": "fetch_results_api_url",
                "kind": "optional",
                "type": "object",
                "readOnly": true,
                "description": "Link to the results API associated with this Report",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "UrlValue",
                    "description": "",
                    "modelRef": "#/components/schemas/UrlValue",
                    "schema": []
                  }
                ],
                "schema": []
              },
              {
                "name": "fetch_results_ui_url",
                "kind": "optional",
                "type": "object",
                "readOnly": true,
                "description": "Link to the results UI associated with this Report",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "UrlValue",
                    "description": "",
                    "modelRef": "#/components/schemas/UrlValue",
                    "schema": []
                  }
                ],
                "schema": []
              },
              {
                "name": "flag_key",
                "kind": "required",
                "type": "string",
                "readOnly": true,
                "description": "The Key of the Flag this report belongs to",
                "example": "recurring_deposit"
              },
              {
                "name": "flag_name",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "The Name of the Flag this report belongs to",
                "example": "Recurring Deposit"
              },
              {
                "name": "flag_state",
                "kind": "optional",
                "type": "string<enabled | disabled | unarchived | archived | deleted>",
                "readOnly": true,
                "description": "State of the Flag this report belongs to",
                "example": "unarchived",
                "enum": [
                  "enabled",
                  "disabled",
                  "unarchived",
                  "archived",
                  "deleted"
                ]
              },
              {
                "name": "id",
                "kind": "required",
                "type": "integer",
                "readOnly": true,
                "description": "System generated Unique ID of the Report",
                "example": 45633910
              },
              {
                "name": "key",
                "kind": "required",
                "type": "string",
                "readOnly": true,
                "description": "<p>User-facing Unique identifier of the Report. Same as rule key with report ID appended.</p>",
                "example": "paid_users-45633910"
              },
              {
                "name": "layer_experiment_id",
                "kind": "optional",
                "type": "integer",
                "readOnly": true,
                "description": "Experiment ID or Layer Experiment of a rule"
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "<p>User-facing name of the Report. Same as rule name.</p>",
                "example": "Paid Users"
              },
              {
                "name": "primary_metric",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "The first metric in the list of metrics.",
                "example": "conversion_rate"
              },
              {
                "name": "reset_results_url",
                "kind": "optional",
                "type": "object",
                "readOnly": true,
                "description": "Link to reset results associated with this Report",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "UrlValue",
                    "description": "",
                    "modelRef": "#/components/schemas/UrlValue",
                    "schema": []
                  }
                ],
                "schema": []
              },
              {
                "name": "revision",
                "kind": "optional",
                "type": "integer",
                "readOnly": true,
                "description": "Revision number for tracking changes"
              },
              {
                "name": "role",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "Granular permission role",
                "example": "admin"
              },
              {
                "name": "rule_description",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "The description of the Rule this report belongs to",
                "example": "Paid Users description"
              },
              {
                "name": "rule_key",
                "kind": "required",
                "type": "string",
                "readOnly": true,
                "description": "The Key of the Rule this report belongs to",
                "example": "paid_users"
              },
              {
                "name": "rule_name",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "The Name of the Rule this report belongs to",
                "example": "Paid Users"
              },
              {
                "name": "rule_state",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "State of the Rule this report belong to",
                "example": "deleted"
              },
              {
                "name": "start_time",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "Timestamp from when the Report is computed",
                "example": "2019-05-08T00:00:00.000Z",
                "format": "date-time"
              },
              {
                "name": "type",
                "kind": "required",
                "type": "string<a/b | multi_armed_bandit | feature_rollout>",
                "readOnly": true,
                "description": "Type of report.",
                "example": "a/b",
                "enum": [
                  "a/b",
                  "multi_armed_bandit",
                  "feature_rollout"
                ]
              },
              {
                "name": "unarchive_url",
                "kind": "optional",
                "type": "object",
                "readOnly": true,
                "description": "Link to unarchive this Report",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "UrlValue",
                    "description": "",
                    "modelRef": "#/components/schemas/UrlValue",
                    "schema": []
                  }
                ],
                "schema": []
              },
              {
                "name": "updated_time",
                "kind": "required",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "Timestamp when the Report is last updated",
                "example": "2019-05-08T00:00:00.000Z",
                "format": "date-time"
              },
              {
                "name": "url",
                "kind": "required",
                "type": "object",
                "readOnly": true,
                "description": "Link to self",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "UrlValue",
                    "description": "",
                    "modelRef": "#/components/schemas/UrlValue",
                    "schema": []
                  }
                ],
                "schema": []
              },
              {
                "name": "urn",
                "kind": "required",
                "type": "string",
                "readOnly": true,
                "description": "The URN for the Report",
                "example": "reports.flag.optimizely.com::45633910"
              }
            ],
            "modelRef": "#/components/schemas/Report",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Malformed requests and invalid parameter names and types",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "401",
        "description": "Invalid credentials",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "403",
        "description": "Do not have permission to perform the operation",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "Not found. No content",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "YEBq97KGVuJKk1VQm2AZ6",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.optimizely.com/flags/v1//projects/{project_id}/environments/{environment_key}/reports/{report_key} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "NfeecyO4lSod-eTB0gMkV",
          "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/flags/v1//projects/{project_id}/environments/{environment_key}/reports/{report_key}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "jTvFiB59FcFV6DX6ONuf4",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.optimizely.com/flags/v1//projects/{project_id}/environments/{environment_key}/reports/{report_key}\")\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": "_bi7LYlCoNmIj7vqVLXdi",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.optimizely.com/flags/v1//projects/{project_id}/environments/{environment_key}/reports/{report_key}\"\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": "YEBq97KGVuJKk1VQm2AZ6"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Successful retrieval of a Report.\nThe response includes RESTful JSON (https://restfuljson.org/) styled links. If a\nlink is not present in the response, it indicates a user is not authorized to access\nthe related resource.\n{\n  \"archive_url\": {},\n  \"archived\": false,\n  \"created_time\": \"2019-05-08T00:00:00.000Z\",\n  \"delete_url\": {},\n  \"description\": \"Detailed context about the report is here.\",\n  \"distribution_mode\": \"\",\n  \"end_time\": \"2019-05-08T00:00:00.000Z\",\n  \"fetch_flag_url\": {},\n  \"fetch_results_api_url\": {},\n  \"fetch_results_ui_url\": {},\n  \"flag_key\": \"recurring_deposit\",\n  \"flag_name\": \"Recurring Deposit\",\n  \"flag_state\": \"unarchived\",\n  \"id\": 45633910,\n  \"key\": \"paid_users-45633910\",\n  \"layer_experiment_id\": 0,\n  \"name\": \"Paid Users\",\n  \"primary_metric\": \"conversion_rate\",\n  \"reset_results_url\": {},\n  \"revision\": 0,\n  \"role\": \"admin\",\n  \"rule_description\": \"Paid Users description\",\n  \"rule_key\": \"paid_users\",\n  \"rule_name\": \"Paid Users\",\n  \"rule_state\": \"deleted\",\n  \"start_time\": \"2019-05-08T00:00:00.000Z\",\n  \"type\": \"a/b\",\n  \"unarchive_url\": {},\n  \"updated_time\": \"2019-05-08T00:00:00.000Z\",\n  \"url\": {},\n  \"urn\": \"reports.flag.optimizely.com::45633910\"\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Malformed requests and invalid parameter names and types\n"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Invalid credentials\n"
        },
        {
          "id": "response-3-403",
          "language": "403",
          "code": "// Do not have permission to perform the operation\n"
        },
        {
          "id": "response-4-404",
          "language": "404",
          "code": "// Not found. No content\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}