---
title: "Set User Refresh Token Expiration Time"
method: PUT
path: "/groups/{groupId}/apps/{appId}/security/refresh_token_expiration"
tags: ["security"]
---

# 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.

## Request body

- RefreshTokenExpiration
  - `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.

## Response `204`

Expiration time updated

## Other responses

- `400` — Invalid expiration time
- `404` — Group or App Not Found

---

[API](https://skmtc.dev/mongodb/apis/mongodb-atlas-app-services-admin-api.md) · [All operations](https://skmtc.dev/mongodb/apis/mongodb-atlas-app-services-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mongodb/mongodb-atlas-app-services-admin-api/revisions/1365ab72bc03/schema)
