New Ory Agent Security is now live! Claim your complimentary test drive. Get Started!

Skip to main content

Extend a Session

PATCH 

/admin/sessions/:id/extend

Calling this endpoint extends the given session ID. If session.earliest_possible_extend is set it will only extend the session after the specified time has passed.

This endpoint returns per default a 204 No Content response on success. Older Ory Network projects may return a 200 OK response with the session in the body. Returning the session as part of the response will be deprecated in the future and should not be relied upon.

This endpoint returns a success response without extending the session if the session is not yet due for an extension, including when a consecutive or concurrent request already extended it. This endpoint returns a 404 error if the session does not exist.

Retrieve the session ID from the /sessions/whoami endpoint / toSession SDK method.

SDK ReferenceTypeScript
extendSession()
ParametersTypeRequiredDescription
idstringrequiredID is the session's ID.
VariableType
dataSession