Update an existing session​
Update an existing session with new information.
Path Parameters
"id of the session to update"
Request Body required
Possible values: non-empty
and <= 200 characters
"The current token of the session, previously returned on the create / update request."
checks object
metadata object
challenges object
"duration (in seconds) after which the session will be automatically invalidated"
Request Body required
Possible values: non-empty
and <= 200 characters
"The current token of the session, previously returned on the create / update request."
checks object
metadata object
challenges object
"duration (in seconds) after which the session will be automatically invalidated"
Request Body required
Possible values: non-empty
and <= 200 characters
"The current token of the session, previously returned on the create / update request."
checks object
metadata object
challenges object
"duration (in seconds) after which the session will be automatically invalidated"
- 200
- 403
- 404
- default
OK
Schema
details object
"The current token of the session, which is required for further updates of the session or to request other resources."
challenges object
{
"details": {
"sequence": "2",
"changeDate": "2024-05-10T13:32:02.712Z",
"resourceOwner": "69629023906488334"
},
"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
"The current token of the session, which is required for further updates of the session or to request other resources."
challenges object
{
"details": {
"sequence": "2",
"changeDate": "2024-05-10T13:32:02.713Z",
"resourceOwner": "69629023906488334"
},
"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
"The current token of the session, which is required for further updates of the session or to request other resources."
challenges object
{
"details": {
"sequence": "2",
"changeDate": "2024-05-10T13:32:02.713Z",
"resourceOwner": "69629023906488334"
},
"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"
}
]
}
PATCH /v2beta/sessions/:sessionId
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 PATCH 'https://$CUSTOM-DOMAIN/v2beta/sessions/:sessionId' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"sessionToken": "string",
"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": {}
}
},
"lifetime": "18000s"
}'
curl -L -X PATCH 'https://$CUSTOM-DOMAIN/v2beta/sessions/:sessionId' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"sessionToken": "string",
"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": {}
}
},
"lifetime": "18000s"
}'
curl -L -X PATCH 'https://$CUSTOM-DOMAIN/v2beta/sessions/:sessionId' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"sessionToken": "string",
"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": {}
}
},
"lifetime": "18000s"
}'
curl -L -X PATCH 'https://$CUSTOM-DOMAIN/v2beta/sessions/:sessionId' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"sessionToken": "string",
"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": {}
}
},
"lifetime": "18000s"
}'
curl -L -X PATCH 'https://$CUSTOM-DOMAIN/v2beta/sessions/:sessionId' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"sessionToken": "string",
"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": {}
}
},
"lifetime": "18000s"
}'
curl -L -X PATCH 'https://$CUSTOM-DOMAIN/v2beta/sessions/:sessionId' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"sessionToken": "string",
"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": {}
}
},
"lifetime": "18000s"
}'
curl -L -X PATCH 'https://$CUSTOM-DOMAIN/v2beta/sessions/:sessionId' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"sessionToken": "string",
"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": {}
}
},
"lifetime": "18000s"
}'
curl -L -X PATCH 'https://$CUSTOM-DOMAIN/v2beta/sessions/:sessionId' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"sessionToken": "string",
"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": {}
}
},
"lifetime": "18000s"
}'
curl -L -X PATCH 'https://$CUSTOM-DOMAIN/v2beta/sessions/:sessionId' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"sessionToken": "string",
"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": {}
}
},
"lifetime": "18000s"
}'