---
title: Trigger a forgotten password email
slug: docs/demo/trigger-a-forgotten-password-email
description: Learn how to use the curl command to send a POST request to an API endpoint for requesting a forgotten password. This code example includes headers, response type, content type, and a JSON payload containing the email address for the password reset.
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "f16TsL5pWELjtBzmmcgR6",
  "data": {
    "url": "https://api.fictive.com/REST/api/accounts/forgotten-password",
    "name": "Trigger a forgotten password email",
    "method": "POST",
    "request": {
      "pathParameters": [],
      "queryParameters": [],
      "headerParameters": [
        {
          "kind": "optional",
          "name": "X-TokenId",
          "type": "string",
          "description": "The eSuite Token Id"
        },
        {
          "kind": "optional",
          "name": "X-SessionId",
          "type": "string",
          "description": "The eSuite Session Id"
        },
        {
          "kind": "required",
          "name": "X-Version",
          "type": "string",
          "description": "The eSuite Version"
        },
        {
          "kind": "optional",
          "name": "Origin",
          "type": "string",
          "description": "The eSuite Origin"
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "accountForgottenPasswordRequest",
          "type": "object",
          "schema": [
            {
              "kind": "optional",
              "name": "emailAddress",
              "type": "string",
              "example": "",
              "description": "The email address."
            }
          ],
          "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.AccountForgottenPasswordRequest",
          "customType": "FictiveGlobal.Api.Rest.Dtos.v1.AccountForgottenPasswordRequest",
          "isExpanded": true,
          "description": "Account forgotten password request dto."
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "schema": [
              {
                "kind": "optional",
                "name": "token",
                "type": "string",
                "example": "",
                "description": "The returned token used to reset password."
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.AccountForgottenPassword",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v1.AccountForgottenPassword",
            "isExpanded": true,
            "description": "Account forgotten password dto."
          }
        ],
        "isExpanded": true,
        "statusCode": "200",
        "description": "OK",
        "jsonExample": ""
      },
      {
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "schema": [
              {
                "kind": "optional",
                "name": "token",
                "type": "string",
                "example": "",
                "description": "The returned token used to reset password."
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.AccountForgottenPassword",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v1.AccountForgottenPassword",
            "isExpanded": true,
            "description": "Account forgotten password dto."
          }
        ],
        "isExpanded": true,
        "statusCode": "204",
        "description": "No Content",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "401",
        "description": "Not Authorized",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "Note that the key is a GUID and not an integer.\r\n            This endpoint will provide the ability to trigger an email to an account that contains a link and token that will allow for the completion of password reset",
    "examples": {
      "languages": [
        {
          "id": "oJy3iliwH4oPV-hYPfcWE",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.fictive.com/REST/api/accounts/forgotten-password \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "nV-36I1zdt-IiSgzO_pal",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-version\", \"string\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.fictive.com/REST/api/accounts/forgotten-password\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "do4lhNCr0PMKq6yO3WFsh",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/accounts/forgotten-password\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-version\"] = \"string\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "-Zj_3FIVRgT90wbA40swH",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/accounts/forgotten-password\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-version': 'string'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "oJy3iliwH4oPV-hYPfcWE"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// OK\n{\n  \"token\": \"\"\n}"
        },
        {
          "id": "response-1-204",
          "language": "204",
          "code": "// No Content\n{\n  \"token\": \"\"\n}"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Not Authorized\n"
        },
        {
          "id": "response-3-500",
          "language": "500",
          "code": "// Internal Server Error\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}