Add One-Time Password (OTP)
POSThttps://$CUSTOM-DOMAIN/auth/v1/users/me/auth_factors/otp
Add a new One-Time Password (OTP) factor to the authenticated user. OTP is an authenticator app like Google/Microsoft Authenticator, Authy, etc. Only one OTP per user is allowed. After adding a new OTP it has to be verified.
Request​
- application/json
- application/grpc
- application/grpc-web+proto
Body
required
object
Body
required
object
Body
required
object
Responses​
- 200
- default
A successful response.
- application/json
- application/grpc
- application/grpc-web+proto
- Schema
- Example (from schema)
Schema
url string
secret string
details
object
{
"url": "otpauth://totp/ZITADEL:gigi@acme.zitadel.cloud?algorithm=SHA1&digits=6&issuer=ZITADEL&period=30&secret=TJOPWSDYILLHXFV4MLKNNJOWFG7VSDCK",
"secret": "TJOPWSDYILLHXFV4MLKNNJOWFG7VSDCK",
"details": {
"sequence": "2",
"creationDate": "2025-03-21T10:51:27.198Z",
"changeDate": "2025-03-21T10:51:27.198Z",
"resourceOwner": "69629023906488334"
}
}
- Schema
- Example (from schema)
Schema
url string
secret string
details
object
{
"url": "otpauth://totp/ZITADEL:gigi@acme.zitadel.cloud?algorithm=SHA1&digits=6&issuer=ZITADEL&period=30&secret=TJOPWSDYILLHXFV4MLKNNJOWFG7VSDCK",
"secret": "TJOPWSDYILLHXFV4MLKNNJOWFG7VSDCK",
"details": {
"sequence": "2",
"creationDate": "2025-03-21T10:51:27.198Z",
"changeDate": "2025-03-21T10:51:27.198Z",
"resourceOwner": "69629023906488334"
}
}
- Schema
- Example (from schema)
Schema
url string
secret string
details
object
{
"url": "otpauth://totp/ZITADEL:gigi@acme.zitadel.cloud?algorithm=SHA1&digits=6&issuer=ZITADEL&period=30&secret=TJOPWSDYILLHXFV4MLKNNJOWFG7VSDCK",
"secret": "TJOPWSDYILLHXFV4MLKNNJOWFG7VSDCK",
"details": {
"sequence": "2",
"creationDate": "2025-03-21T10:51:27.198Z",
"changeDate": "2025-03-21T10:51:27.198Z",
"resourceOwner": "69629023906488334"
}
}
An unexpected error response.
- application/json
- application/grpc
- application/grpc-web+proto
- Schema
- Example (from schema)
Schema
code int32
message string
details
object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
- Schema
- Example (from schema)
Schema
code int32
message string
details
object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
- Schema
- Example (from schema)
Schema
code int32
message string
details
object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L 'https://$CUSTOM-DOMAIN/auth/v1/users/me/auth_factors/otp' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{}'
ResponseClear