---
title: List all Events
slug: web-experimentation/api/list-all-events
docTags: 
createdAt: 2026-10-02T13:15:18.296Z
---

{
  "id": "dK9yiZTYuPmu1FGV4OtyW",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.optimizely.com/v2/events",
    "servers": [
      {
        "url": "https://api.optimizely.com/v2/events"
      }
    ],
    "name": "List all Events",
    "description": "<p>Get all Events for a Project. This endpoint lists all types of Events including Pageview Events which are stored as Pages. You can also get Goal objects from Optimizely Classic by setting the include_classic parameter to true.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "per_page",
          "type": "integer",
          "description": "Optional pagination argument that specifies the maximum number of objects to return per request",
          "default": 25,
          "maximum": 100
        },
        {
          "kind": "optional",
          "name": "page",
          "type": "integer",
          "description": "Optional pagination argument that specifies the page to return. If you have 140 objects and you choose to return 100 objects per page you will be able to access the last 40 objects on page 2. The default value is 1.\n",
          "default": 1
        },
        {
          "kind": "required",
          "name": "project_id",
          "type": "integer<int64>",
          "description": "The ID of the Project you would like to list all Events for",
          "format": "int64"
        },
        {
          "kind": "optional",
          "name": "include_classic",
          "type": "boolean",
          "description": "Whether or not to include classic Events in the list of Events. If this parameter is not provided it will default to false",
          "default": false
        },
        {
          "kind": "optional",
          "name": "skip_views",
          "type": "boolean",
          "description": "Whether or not to skip Pageview Events in the list of Events. If this parameter is not provided it will default to false",
          "default": false
        }
      ],
      "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": "List of Events for the supplied Project ID",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "Event[]",
            "schema": [
              {
                "name": "archived",
                "kind": "optional",
                "type": "boolean",
                "description": "Whether or not this Event is archived"
              },
              {
                "name": "category",
                "kind": "optional",
                "type": "string",
                "description": "",
                "modelRef": "#/components/schemas/EventCategories",
                "customType": "EventCategories",
                "schema": [
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  }
                ]
              },
              {
                "name": "config",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/InPageEventConfig",
                "customType": "InPageEventConfig",
                "schema": [
                  {
                    "name": "selector",
                    "kind": "required",
                    "type": "string",
                    "description": "<p>CSS selector for the page element(s) that trigger an Event</p>",
                    "example": ".menu-options"
                  }
                ]
              },
              {
                "name": "created",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "Creation date for this Event",
                "format": "date-time"
              },
              {
                "name": "description",
                "kind": "optional",
                "type": "string",
                "description": "A description for this Event",
                "example": "Item added to cart"
              },
              {
                "name": "event_properties",
                "kind": "optional",
                "type": "array",
                "description": "<p>A set of user-defined data elements for the event. Metrics can filter on particular values of these properties.</p>",
                "modelRef": "#/components/schemas/EventProperty",
                "customType": "EventProperty[]",
                "schema": [
                  {
                    "name": "data_type",
                    "kind": "optional",
                    "type": "string<boolean | number | string>",
                    "description": "The type of data that can be accepted for this property.",
                    "enum": [
                      "boolean",
                      "number",
                      "string"
                    ]
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": "The name of the property."
                  }
                ]
              },
              {
                "name": "event_type",
                "kind": "optional",
                "type": "string<custom | click | pageview | classic_custom | classic_click | classic_pageview | classic_engagement | classic_revenue | classic_mobile_tap | classic_mobile_view | classic_mobile_session_length | classic_mobile_num_session>",
                "description": "The type of this Event",
                "enum": [
                  "custom",
                  "click",
                  "pageview",
                  "classic_custom",
                  "classic_click",
                  "classic_pageview",
                  "classic_engagement",
                  "classic_revenue",
                  "classic_mobile_tap",
                  "classic_mobile_view",
                  "classic_mobile_session_length",
                  "classic_mobile_num_session"
                ]
              },
              {
                "name": "experiment_count",
                "kind": "optional",
                "type": "integer<int64>",
                "readOnly": true,
                "description": "<p>Number of experiments that reference this Event across all statuses (running, paused, draft, archived). Computed by the upstream service.</p>",
                "example": 3,
                "format": "int64"
              },
              {
                "name": "id",
                "kind": "optional",
                "type": "integer<int64>",
                "readOnly": true,
                "description": "The unique identifier of the Event",
                "format": "int64"
              },
              {
                "name": "is_classic",
                "kind": "optional",
                "type": "boolean",
                "readOnly": true,
                "description": "<p>Whether or not this Event is a classic Event. If true, this Event is read-only</p>",
                "default": false
              },
              {
                "name": "is_editable",
                "kind": "optional",
                "type": "boolean",
                "readOnly": true,
                "description": "Whether this Event may be edited"
              },
              {
                "name": "key",
                "kind": "optional",
                "type": "string",
                "description": "Unique string identifier for this Event within the Project",
                "example": "add_to_cart",
                "maxLength": 64
              },
              {
                "name": "last_modified",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "The last time the Event was modified",
                "format": "date-time"
              },
              {
                "name": "name",
                "kind": "optional",
                "type": "string",
                "description": "A human readable name for this Event",
                "example": "Add to Cart"
              },
              {
                "name": "page_id",
                "kind": "optional",
                "type": "integer<int64>",
                "description": "The Page ID associated with this Event",
                "example": 5000,
                "format": "int64"
              },
              {
                "name": "project_id",
                "kind": "optional",
                "type": "integer<int64>",
                "description": "The ID of this Event's parent Project",
                "example": 1000,
                "format": "int64"
              },
              {
                "name": "variation_specific",
                "kind": "optional",
                "type": "boolean",
                "description": "Whether or not this Event is variation specific."
              }
            ],
            "modelRef": "#/components/schemas/Event",
            "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 access to Events in the specified Project",
        "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": "Project not found",
        "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": "PaTkOiDQ_4N0sbph2SRyr",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url 'https://api.optimizely.com/v2/events?per_page=25&page=1&project_id=integer%3Cint64%3E&include_classic=boolean&skip_views=boolean' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "tCdxyJS9878R0pJUHXVDk",
          "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/events?per_page=25&page=1&project_id=integer<int64>&include_classic=boolean&skip_views=boolean\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "Xv9zUWB8g81V_dOUSdOzv",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.optimizely.com/v2/events?per_page=25&page=1&project_id=integer<int64>&include_classic=boolean&skip_views=boolean\")\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": "VMiF1bWS7wIUTovWs50oK",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.optimizely.com/v2/events?per_page=25&page=1&project_id=integer<int64>&include_classic=boolean&skip_views=boolean\"\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": "PaTkOiDQ_4N0sbph2SRyr"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// List of Events for the supplied Project ID\n[\n  {\n    \"archived\": false,\n    \"category\": \"\",\n    \"config\": {\n      \"selector\": \".menu-options\"\n    },\n    \"created\": \"\",\n    \"description\": \"Item added to cart\",\n    \"event_properties\": [\n      {\n        \"data_type\": \"\",\n        \"name\": \"\"\n      }\n    ],\n    \"event_type\": \"\",\n    \"experiment_count\": 3,\n    \"id\": \"\",\n    \"is_classic\": false,\n    \"is_editable\": false,\n    \"key\": \"add_to_cart\",\n    \"last_modified\": \"\",\n    \"name\": \"Add to Cart\",\n    \"page_id\": 5000,\n    \"project_id\": 1000,\n    \"variation_specific\": false\n  }\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 access to Events in the specified Project\n{\n  \"code\": \"\",\n  \"message\": \"\",\n  \"messages\": {},\n  \"uuid\": \"\"\n}"
        },
        {
          "id": "response-3-404",
          "language": "404",
          "code": "// Project not found\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": ""
    }
  ]
}