Create a new session​
Create a new session. A token will be returned, which is required for further updates of the session.
Request Body required
checks object
metadata object
challenges object
userAgent object
"duration (in seconds) after which the session will be automatically invalidated"
Request Body required
checks object
metadata object
challenges object
userAgent object
"duration (in seconds) after which the session will be automatically invalidated"
Request Body required
checks object
metadata object
challenges object
userAgent object
"duration (in seconds) after which the session will be automatically invalidated"
- 200
- 403
- 404
- default
OK
Schema
details object
"id of the session"
"The current token of the session, which is required for delete session, get session or the request of other resources."
challenges object
{
"details": {
"sequence": "2",
"changeDate": "2024-06-17T11:37:09.171Z",
"resourceOwner": "69629023906488334"
},
"sessionId": "222430354126975533",
"sessionToken": "string",
"challenges": {
"webAuthN": {
"publicKeyCredentialRequestOptions": {
"publicKey": {
"allowCredentials": [
{
"id": "ATmqBg-99qyOZk2zloPdJQyS2R7IkFT7v9Hoos_B_nM",
"type": "public-key"
}
],
"challenge": "GAOHYz2jE69kJMYo6Laij8yWw9-dKKgbViNhfuy0StA",
"rpId": "localhost",
"timeout": 300000,
"userVerification": "required"
}
}
},
"otpSms": "string",
"otpEmail": "string"
}
}
Schema
details object
"id of the session"
"The current token of the session, which is required for delete session, get session or the request of other resources."
challenges object
{
"details": {
"sequence": "2",
"changeDate": "2024-06-17T11:37:09.171Z",
"resourceOwner": "69629023906488334"
},
"sessionId": "222430354126975533",
"sessionToken": "string",
"challenges": {
"webAuthN": {
"publicKeyCredentialRequestOptions": {
"publicKey": {
"allowCredentials": [
{
"id": "ATmqBg-99qyOZk2zloPdJQyS2R7IkFT7v9Hoos_B_nM",
"type": "public-key"
}
],
"challenge": "GAOHYz2jE69kJMYo6Laij8yWw9-dKKgbViNhfuy0StA",
"rpId": "localhost",
"timeout": 300000,
"userVerification": "required"
}
}
},
"otpSms": "string",
"otpEmail": "string"
}
}
Schema
details object
"id of the session"
"The current token of the session, which is required for delete session, get session or the request of other resources."
challenges object
{
"details": {
"sequence": "2",
"changeDate": "2024-06-17T11:37:09.172Z",
"resourceOwner": "69629023906488334"
},
"sessionId": "222430354126975533",
"sessionToken": "string",
"challenges": {
"webAuthN": {
"publicKeyCredentialRequestOptions": {
"publicKey": {
"allowCredentials": [
{
"id": "ATmqBg-99qyOZk2zloPdJQyS2R7IkFT7v9Hoos_B_nM",
"type": "public-key"
}
],
"challenge": "GAOHYz2jE69kJMYo6Laij8yWw9-dKKgbViNhfuy0StA",
"rpId": "localhost",
"timeout": 300000,
"userVerification": "required"
}
}
},
"otpSms": "string",
"otpEmail": "string"
}
}
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 /v2beta/sessions
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/v2beta/sessions' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"checks": {
"user": {
"userId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"loginName": "mini@mouse.com"
},
"password": {
"password": "V3ryS3cure!"
},
"webAuthN": {
"credentialAssertionData": {}
},
"idpIntent": {
"idpIntentId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"idpIntentToken": "SJKL3ioIDpo342ioqw98fjp3sdf32wahb="
},
"totp": {
"code": "323764"
},
"otpSms": {
"code": "3237642"
},
"otpEmail": {
"code": "3237642"
}
},
"metadata": {},
"challenges": {
"webAuthN": {
"domain": "string",
"userVerificationRequirement": "USER_VERIFICATION_REQUIREMENT_UNSPECIFIED"
},
"otpSms": {
"returnCode": true
},
"otpEmail": {
"sendCode": {
"urlTemplate": "https://example.com/otp/verify?userID={{.UserID}}&code={{.Code}}"
},
"returnCode": {}
}
},
"userAgent": {
"fingerprintId": "string",
"ip": "string",
"description": "string",
"header": {}
},
"lifetime": "18000s"
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v2beta/sessions' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"checks": {
"user": {
"userId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"loginName": "mini@mouse.com"
},
"password": {
"password": "V3ryS3cure!"
},
"webAuthN": {
"credentialAssertionData": {}
},
"idpIntent": {
"idpIntentId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"idpIntentToken": "SJKL3ioIDpo342ioqw98fjp3sdf32wahb="
},
"totp": {
"code": "323764"
},
"otpSms": {
"code": "3237642"
},
"otpEmail": {
"code": "3237642"
}
},
"metadata": {},
"challenges": {
"webAuthN": {
"domain": "string",
"userVerificationRequirement": "USER_VERIFICATION_REQUIREMENT_UNSPECIFIED"
},
"otpSms": {
"returnCode": true
},
"otpEmail": {
"sendCode": {
"urlTemplate": "https://example.com/otp/verify?userID={{.UserID}}&code={{.Code}}"
},
"returnCode": {}
}
},
"userAgent": {
"fingerprintId": "string",
"ip": "string",
"description": "string",
"header": {}
},
"lifetime": "18000s"
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v2beta/sessions' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"checks": {
"user": {
"userId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"loginName": "mini@mouse.com"
},
"password": {
"password": "V3ryS3cure!"
},
"webAuthN": {
"credentialAssertionData": {}
},
"idpIntent": {
"idpIntentId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"idpIntentToken": "SJKL3ioIDpo342ioqw98fjp3sdf32wahb="
},
"totp": {
"code": "323764"
},
"otpSms": {
"code": "3237642"
},
"otpEmail": {
"code": "3237642"
}
},
"metadata": {},
"challenges": {
"webAuthN": {
"domain": "string",
"userVerificationRequirement": "USER_VERIFICATION_REQUIREMENT_UNSPECIFIED"
},
"otpSms": {
"returnCode": true
},
"otpEmail": {
"sendCode": {
"urlTemplate": "https://example.com/otp/verify?userID={{.UserID}}&code={{.Code}}"
},
"returnCode": {}
}
},
"userAgent": {
"fingerprintId": "string",
"ip": "string",
"description": "string",
"header": {}
},
"lifetime": "18000s"
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v2beta/sessions' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"checks": {
"user": {
"userId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"loginName": "mini@mouse.com"
},
"password": {
"password": "V3ryS3cure!"
},
"webAuthN": {
"credentialAssertionData": {}
},
"idpIntent": {
"idpIntentId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"idpIntentToken": "SJKL3ioIDpo342ioqw98fjp3sdf32wahb="
},
"totp": {
"code": "323764"
},
"otpSms": {
"code": "3237642"
},
"otpEmail": {
"code": "3237642"
}
},
"metadata": {},
"challenges": {
"webAuthN": {
"domain": "string",
"userVerificationRequirement": "USER_VERIFICATION_REQUIREMENT_UNSPECIFIED"
},
"otpSms": {
"returnCode": true
},
"otpEmail": {
"sendCode": {
"urlTemplate": "https://example.com/otp/verify?userID={{.UserID}}&code={{.Code}}"
},
"returnCode": {}
}
},
"userAgent": {
"fingerprintId": "string",
"ip": "string",
"description": "string",
"header": {}
},
"lifetime": "18000s"
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v2beta/sessions' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"checks": {
"user": {
"userId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"loginName": "mini@mouse.com"
},
"password": {
"password": "V3ryS3cure!"
},
"webAuthN": {
"credentialAssertionData": {}
},
"idpIntent": {
"idpIntentId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"idpIntentToken": "SJKL3ioIDpo342ioqw98fjp3sdf32wahb="
},
"totp": {
"code": "323764"
},
"otpSms": {
"code": "3237642"
},
"otpEmail": {
"code": "3237642"
}
},
"metadata": {},
"challenges": {
"webAuthN": {
"domain": "string",
"userVerificationRequirement": "USER_VERIFICATION_REQUIREMENT_UNSPECIFIED"
},
"otpSms": {
"returnCode": true
},
"otpEmail": {
"sendCode": {
"urlTemplate": "https://example.com/otp/verify?userID={{.UserID}}&code={{.Code}}"
},
"returnCode": {}
}
},
"userAgent": {
"fingerprintId": "string",
"ip": "string",
"description": "string",
"header": {}
},
"lifetime": "18000s"
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v2beta/sessions' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"checks": {
"user": {
"userId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"loginName": "mini@mouse.com"
},
"password": {
"password": "V3ryS3cure!"
},
"webAuthN": {
"credentialAssertionData": {}
},
"idpIntent": {
"idpIntentId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"idpIntentToken": "SJKL3ioIDpo342ioqw98fjp3sdf32wahb="
},
"totp": {
"code": "323764"
},
"otpSms": {
"code": "3237642"
},
"otpEmail": {
"code": "3237642"
}
},
"metadata": {},
"challenges": {
"webAuthN": {
"domain": "string",
"userVerificationRequirement": "USER_VERIFICATION_REQUIREMENT_UNSPECIFIED"
},
"otpSms": {
"returnCode": true
},
"otpEmail": {
"sendCode": {
"urlTemplate": "https://example.com/otp/verify?userID={{.UserID}}&code={{.Code}}"
},
"returnCode": {}
}
},
"userAgent": {
"fingerprintId": "string",
"ip": "string",
"description": "string",
"header": {}
},
"lifetime": "18000s"
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v2beta/sessions' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"checks": {
"user": {
"userId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"loginName": "mini@mouse.com"
},
"password": {
"password": "V3ryS3cure!"
},
"webAuthN": {
"credentialAssertionData": {}
},
"idpIntent": {
"idpIntentId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"idpIntentToken": "SJKL3ioIDpo342ioqw98fjp3sdf32wahb="
},
"totp": {
"code": "323764"
},
"otpSms": {
"code": "3237642"
},
"otpEmail": {
"code": "3237642"
}
},
"metadata": {},
"challenges": {
"webAuthN": {
"domain": "string",
"userVerificationRequirement": "USER_VERIFICATION_REQUIREMENT_UNSPECIFIED"
},
"otpSms": {
"returnCode": true
},
"otpEmail": {
"sendCode": {
"urlTemplate": "https://example.com/otp/verify?userID={{.UserID}}&code={{.Code}}"
},
"returnCode": {}
}
},
"userAgent": {
"fingerprintId": "string",
"ip": "string",
"description": "string",
"header": {}
},
"lifetime": "18000s"
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v2beta/sessions' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"checks": {
"user": {
"userId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"loginName": "mini@mouse.com"
},
"password": {
"password": "V3ryS3cure!"
},
"webAuthN": {
"credentialAssertionData": {}
},
"idpIntent": {
"idpIntentId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"idpIntentToken": "SJKL3ioIDpo342ioqw98fjp3sdf32wahb="
},
"totp": {
"code": "323764"
},
"otpSms": {
"code": "3237642"
},
"otpEmail": {
"code": "3237642"
}
},
"metadata": {},
"challenges": {
"webAuthN": {
"domain": "string",
"userVerificationRequirement": "USER_VERIFICATION_REQUIREMENT_UNSPECIFIED"
},
"otpSms": {
"returnCode": true
},
"otpEmail": {
"sendCode": {
"urlTemplate": "https://example.com/otp/verify?userID={{.UserID}}&code={{.Code}}"
},
"returnCode": {}
}
},
"userAgent": {
"fingerprintId": "string",
"ip": "string",
"description": "string",
"header": {}
},
"lifetime": "18000s"
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v2beta/sessions' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"checks": {
"user": {
"userId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"loginName": "mini@mouse.com"
},
"password": {
"password": "V3ryS3cure!"
},
"webAuthN": {
"credentialAssertionData": {}
},
"idpIntent": {
"idpIntentId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"idpIntentToken": "SJKL3ioIDpo342ioqw98fjp3sdf32wahb="
},
"totp": {
"code": "323764"
},
"otpSms": {
"code": "3237642"
},
"otpEmail": {
"code": "3237642"
}
},
"metadata": {},
"challenges": {
"webAuthN": {
"domain": "string",
"userVerificationRequirement": "USER_VERIFICATION_REQUIREMENT_UNSPECIFIED"
},
"otpSms": {
"returnCode": true
},
"otpEmail": {
"sendCode": {
"urlTemplate": "https://example.com/otp/verify?userID={{.UserID}}&code={{.Code}}"
},
"returnCode": {}
}
},
"userAgent": {
"fingerprintId": "string",
"ip": "string",
"description": "string",
"header": {}
},
"lifetime": "18000s"
}'