---
title: Send event to Optimizely Data Platform (ODP).
slug: feature-experimentation/api/send-event-to-optimizely-data-platform-odp
createdAt: 2026-08-28T15:54:06.731Z
---

{
  "id": "XTVzl0F7W9skXjnp3-btx",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "/v1/send-odp-event",
    "servers": [],
    "name": "Send event to Optimizely Data Platform (ODP).",
    "description": "<p>Send ODP event to Optimizely Data Platform. Clients can send arbitrary events to the ODP server. For instance, they can bind an email to the FS userId via this API.</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": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "customType": "SendOdpEventContext",
          "schema": [
            {
              "name": "action",
              "kind": "required",
              "type": "string",
              "description": ""
            },
            {
              "name": "type",
              "kind": "optional",
              "type": "string",
              "description": ""
            },
            {
              "name": "identifiers",
              "kind": "required",
              "type": "map",
              "description": "",
              "example": "",
              "customType": "map<string, string>",
              "schema": []
            },
            {
              "name": "data",
              "kind": "optional",
              "type": "map",
              "description": "",
              "example": "",
              "customType": "map<string, string>",
              "schema": []
            }
          ],
          "modelRef": "#/components/schemas/SendOdpEventContext",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "SdkKeyAuth",
          "name": "X-Optimizely-SDK-Key",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        },
        {
          "id": "TokenAuth",
          "name": "TokenAuth",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "<p>Valid response, event received</p>",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "400",
        "description": "Missing required parameters",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "401",
        "description": "<p>Unauthorized, invalid JWT</p>",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "403",
        "description": "You do not have necessary permissions for the resource",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "You do not have necessary permissions for the resource",
            "customType": "Forbidden",
            "schema": [],
            "modelRef": "#/components/responses/Forbidden",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "500",
        "description": "Failed to send odp event",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "deprecated": false,
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url /v1/send-odp-event \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"action\": \"\",\n     \"identifiers\": \"\"\n     }'"
        },
        {
          "id": "example-1-javascript",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"action\": \"\",\n   \"identifiers\": \"\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"/v1/send-odp-event\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"/v1/send-odp-event\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"action\": \"\",\n   \"identifiers\": \"\"\n})\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"/v1/send-odp-event\"\n\npayload = json.dumps({\n   \"action\": \"\",\n   \"identifiers\": \"\"\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Valid response, event received\n"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Missing required parameters\n"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Unauthorized, invalid JWT\n"
        },
        {
          "id": "response-3-403",
          "language": "403",
          "code": "// You do not have necessary permissions for the resource\n{}"
        },
        {
          "id": "response-4-500",
          "language": "500",
          "code": "// Failed to send odp event\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}