---
title: Get email token for user.
slug: cms-12/api/get-email-token-for-user
docTags: 
createdAt: 2026-08-28T13:16:06.833Z
---

{
  "id": "lTJi5pWi5xBKoFM5pGmkY",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "/api/episerver/v3.0/customers/email/token",
    "servers": [],
    "name": "Get email token for user.",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json",
            "application/problem+json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "The model",
          "customType": "generateEmailToken",
          "schema": [
            {
              "name": "customerId",
              "kind": "required",
              "type": "string",
              "description": "The customer id."
            }
          ],
          "modelRef": "#/components/schemas/generateEmailToken",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Success",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "string",
            "description": "",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Bad Request",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "403",
        "description": "Forbidden",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "BfWa00G68TWMqTBdmZktL",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url /api/episerver/v3.0/customers/email/token \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"customerId\": \"\"\n     }'"
        },
        {
          "id": "lTeykoC7z1-rD9yBXu3nm",
          "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   \"customerId\": \"\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"/api/episerver/v3.0/customers/email/token\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "pXyoWiu1ECPxkceeaK82s",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"/api/episerver/v3.0/customers/email/token\")\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   \"customerId\": \"\"\n})\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "eBPZnZaPmxE2CgyyZdIWA",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"/api/episerver/v3.0/customers/email/token\"\n\npayload = json.dumps({\n   \"customerId\": \"\"\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": "BfWa00G68TWMqTBdmZktL"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Success\n\"\""
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Bad Request\n"
        },
        {
          "id": "response-2-403",
          "language": "403",
          "code": "// Forbidden\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}