Skip to main content

Create One-Time Password Token Request

POST Create One-Time Password Token Request

https://useast.api.elasticpath.com/v2/authentication-realms/:realm-id/password-profiles/:profile-id/one-time-password-token-request

Parameters

Headers

NameRequiredTypeDescription
AuthorizationRequiredstringThe Bearer token required to get access to the API.

Body

NameRequiredTypeDescription
typeRequiredstringRepresents the type of object being returned. You must use one_time_password_token_request.
usernameRequiredstringThe username.
purposeRequiredstringRepresents the purpose for requesting one-time password token. Value must be reset_password or passwordless_authentication.

Request Examples

Curl

curl -X POST https://useast.api.elasticpath.com/v2/authentication-realms/:realm-id/password-profiles/:profile-id/one-time-password-token-request \
-H "Authorization: Bearer XXXX" \
-H "Content-Type: application/json" \
-d $'{
"data": {
"type": "one_time_password_token_request",
"username": "john.doe",
"purpose": "reset_password"
}
}'

JavaScript SDK

const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X'
})
const realmId = 'XXXX'
const profileId = 'XXXX'
const body = {
type: "one_time_password_token_request",
username: "john.doe",
purpose: "reset_password"
}

Moltin.OneTimePasswordTokenRequest.Create({
realmId,
profileId,
body
}
)

Response Example

202 Accepted