Update TOTP device name
Update the name of a TOTP device for a user.
PUT
/appid-{appId}/recipe/totp/deviceAuthorization
api-keyAPI key · headerrequiredThe core service API token. If you are using a self-hosted core service and you have not generated a token, you can omit the header.
Header parameters
ridstringcdi-versionstringX.Y of the X.Y.Z CDI version.
Request body
application/jsonuserIduserIdrequiredexistingDeviceNamestringrequiredCurrent name of the TOTP device
newDeviceNamestringrequiredNew name for the TOTP device
Responses
200Indicates success with the status property
One of:
object
statusstatusOKAllowed:
OKobject
statusstringAllowed:
UNKNOWN_DEVICE_ERRORobject
statusstringAllowed:
DEVICE_ALREADY_EXISTS_ERROR400error code 400
string401error code 401
string404error code 404
string500error code 500
stringTry it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X PUT "/appid-{appId}/recipe/totp/device" \
-H "api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"userId": "fa7a0841-b533-4478-95533-0fde890c3483",
"existingDeviceName": "My Authy App",
"newDeviceName": "A better name for my TOTP device"
}'const response = await fetch("/appid-{appId}/recipe/totp/device", {
method: "PUT",
headers: {
"api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"userId": "fa7a0841-b533-4478-95533-0fde890c3483",
"existingDeviceName": "My Authy App",
"newDeviceName": "A better name for my TOTP device"
})
});import requests
response = requests.put(
"/appid-{appId}/recipe/totp/device",
headers={
"api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"userId": "fa7a0841-b533-4478-95533-0fde890c3483",
"existingDeviceName": "My Authy App",
"newDeviceName": "A better name for my TOTP device"
},
)Response
{
"status": "OK"
}"string""Invalid API key""Not Found""Internal Error"