Set User Refresh Token Expiration Time

PUT /groups/{groupId}/apps/{appId}/security/refresh_token_expiration

Set the expiration time in seconds for user session refresh tokens.

Path parameters

application/json

Body Required

  • expiration_time_seconds number

    The time in seconds that a user session refresh token is valid for after it is issued. After this time, the token is expired and the user must re-authenticate.

    The expiration time must be between 30 minutes and 5 years, inclusive. The default expiration time is 60 days.

    Minimum value is 1800, maximum value is 15552000. Default value is 5184000.

Responses

  • 204

    Expiration time updated

  • 400

    Invalid expiration time

  • 404

    Group or App Not Found

PUT /groups/{groupId}/apps/{appId}/security/refresh_token_expiration
curl \
 --request PUT 'https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}/security/refresh_token_expiration' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"expiration_time_seconds":5184000}'
Request examples
{
  "expiration_time_seconds": 5184000
}