Update the password of a guest using OTP
This API helps you to update a guest's password by using the one-time password (OTP) that was sent to the guest's registered email ID after resetting the password.
To invoke this API, you must specify a unique identifier of the guest in the request as guest_id.
You must also provide in the request body the verification_code and verification_id details that the guest received after resetting the password. After the verification_code and verification_id details have been successfully validated, the guest's password is updated to the new_password value.
This API either returns a success parameter that indicates that the password-updation process was successful or returns an error object if there is any error.
Before you begin
- You need a valid API key or access token. See Set up API authentication.
Permission: Manage API Keys (on the Administrator security object) — Required to access Zenoti APIs.
Endpoint
PUT /v1/guests/{guest_id}/password
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| guest_id | string | Yes | Unique 32-character identifier of the guest whose password is to be updated. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| new_password | string | No | This is the new password of the guest. |
| verification_code | string | No | This is the verification code of the guest. |
| verification_id | string | No | This is the verification id for resetting the password. |
Response
Success (200 OK)
{
"success": true
}
Response fields
| Field | Type | Description |
|---|---|---|
| success | boolean |
Example
curl --request PUT \
--url 'https://api.zenoti.com/v1/guests/{guest_id}/password' \
--header 'Authorization: bearer {{access_token}}' \
--header 'Content-Type: application/json' \
--data '{
"new_password": "string",
"verification_code": "string",
"verification_id": "string"
}'
const response = await fetch('https://api.zenoti.com/v1/guests/{guest_id}/password', {
method: 'PUT',
headers: {
'Authorization': 'bearer {{access_token}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({ new_password: 'string', verification_code: 'string', verification_id: 'string' })
});
const data = await response.json();
import requests
response = requests.put(
'https://api.zenoti.com/v1/guests/{guest_id}/password',
headers={
'Authorization': 'bearer {{access_token}}',
},
json={'new_password': 'string', 'verification_code': 'string', 'verification_id': 'string'}
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var content = new StringContent(
JsonSerializer.Serialize(new { new_password = "string", verification_code = "string", verification_id = "string" }),
Encoding.UTF8, "application/json");
var response = await client.PutAsync(
"https://api.zenoti.com/v1/guests/{guest_id}/password", content);
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/guests/{guest_id}/password')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Put.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
request['Content-Type'] = 'application/json'
request.body = { new_password: 'string', verification_code: 'string', verification_id: 'string' }.to_json
response = http.request(request)
data = JSON.parse(response.body)
Error codes
| Status | Description |
|---|---|
| 400 | 400 |
| 401 | Unauthorized -- invalid or expired access token |
| 429 | Too many requests -- rate limit exceeded |