Add a OTP Email authenticator​
Add a new one-time-password (OTP) Email authenticator to a user. If the email is not passed as verified, a verification code will be generated, which can be either returned or will be sent to the user by email.
Path Parameters
unique identifier of the user.
Request Body required
email object
Request Body required
email object
Request Body required
email object
- 200
- 403
- 404
- default
OTP Email authenticator successfully added
Schema
details object
unique identifier of the OTP Email registration.
The OTP verification code will be set if a email was set with a return_code verification option.
{
"details": {
"sequence": "2",
"changeDate": "2024-06-13T06:44:36.416Z",
"resourceOwner": "69629023906488334"
},
"otpEmailId": "163840776835432705",
"verificationCode": "SKJd342k"
}
Schema
details object
unique identifier of the OTP Email registration.
The OTP verification code will be set if a email was set with a return_code verification option.
{
"details": {
"sequence": "2",
"changeDate": "2024-06-13T06:44:36.416Z",
"resourceOwner": "69629023906488334"
},
"otpEmailId": "163840776835432705",
"verificationCode": "SKJd342k"
}
Schema
details object
unique identifier of the OTP Email registration.
The OTP verification code will be set if a email was set with a return_code verification option.
{
"details": {
"sequence": "2",
"changeDate": "2024-06-13T06:44:36.416Z",
"resourceOwner": "69629023906488334"
},
"otpEmailId": "163840776835432705",
"verificationCode": "SKJd342k"
}
Returned when the user does not have permission to access the resource.
Schema
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Schema
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Schema
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Returned when the resource does not exist.
Schema
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Schema
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Schema
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
An unexpected error response.
Schema
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Schema
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Schema
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
POST /v3alpha/users/:userId/otp_email
Authorization
name: OAuth2type: oauth2scopes:openid,urn:zitadel:iam:org:project:id:zitadel:aud
flows: { "authorizationCode": { "authorizationUrl": "$CUSTOM-DOMAIN/oauth/v2/authorize", "tokenUrl": "$CUSTOM-DOMAIN/oauth/v2/token", "scopes": { "openid": "openid", "urn:zitadel:iam:org:project:id:zitadel:aud": "urn:zitadel:iam:org:project:id:zitadel:aud" } } }
Request
Request
curl -L -X POST 'https://$CUSTOM-DOMAIN/v3alpha/users/:userId/otp_email' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"email": {
"address": "mini@mouse.com",
"sendCode": {
"urlTemplate": "https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}"
},
"returnCode": {},
"isVerified": true
}
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v3alpha/users/:userId/otp_email' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"email": {
"address": "mini@mouse.com",
"sendCode": {
"urlTemplate": "https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}"
},
"returnCode": {},
"isVerified": true
}
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v3alpha/users/:userId/otp_email' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"email": {
"address": "mini@mouse.com",
"sendCode": {
"urlTemplate": "https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}"
},
"returnCode": {},
"isVerified": true
}
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v3alpha/users/:userId/otp_email' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"email": {
"address": "mini@mouse.com",
"sendCode": {
"urlTemplate": "https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}"
},
"returnCode": {},
"isVerified": true
}
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v3alpha/users/:userId/otp_email' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"email": {
"address": "mini@mouse.com",
"sendCode": {
"urlTemplate": "https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}"
},
"returnCode": {},
"isVerified": true
}
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v3alpha/users/:userId/otp_email' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"email": {
"address": "mini@mouse.com",
"sendCode": {
"urlTemplate": "https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}"
},
"returnCode": {},
"isVerified": true
}
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v3alpha/users/:userId/otp_email' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"email": {
"address": "mini@mouse.com",
"sendCode": {
"urlTemplate": "https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}"
},
"returnCode": {},
"isVerified": true
}
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v3alpha/users/:userId/otp_email' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"email": {
"address": "mini@mouse.com",
"sendCode": {
"urlTemplate": "https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}"
},
"returnCode": {},
"isVerified": true
}
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v3alpha/users/:userId/otp_email' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"email": {
"address": "mini@mouse.com",
"sendCode": {
"urlTemplate": "https://example.com/email/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}"
},
"returnCode": {},
"isVerified": true
}
}'