Update the two-factor type

POST /api/v1/me/otp/settings

Validates the requested 2fa type can be set - checks we have a valid and verified TOTP or SMS OTP setup.

Headers

application/json

Body Required

  • two_factor_type string Required

    The type of 2fa to set for the user. Possible values are otp|sms|either|disabled

Responses

  • 422 application/json

    Unable to set the two_factor_type to SMS

    Hide response attributes Show response attributes object
POST /api/v1/me/otp/settings
curl \
 -X POST https://api.plannrcrm.com/api/v1/me/otp/settings \
 -H "Authorization: Bearer {OAUTH_ACCESS_TOKEN or PERSONAL_ACCESS_TOKEN}" \
 -H "Content-Type: application/json" \
 -H "Accept: application/json" \
 -d '{"two_factor_type":"otp"}'
Request examples
# Headers
Authorization: Bearer {OAUTH_ACCESS_TOKEN or PERSONAL_ACCESS_TOKEN}
Content-Type: application/json
Accept: application/json

# Payload
{
  "two_factor_type": "otp"
}
Response examples (422)
{
  "errors": {
    "two_factor_type": [
      "Unable to set the two_factor_type to \"sms\" because the sms two factor setup is not complete"
    ]
  },
  "message": "Unable to set the two_factor_type to \"sms\" because the sms two factor setup is not complete."
}