Create a Logout URL for Browsers

GET {{baseUrl}}/self-service/logout/browser?return_to=<string>

This endpoint initializes a browser-based user logout flow and a URL which can be used to log out the user.

This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). For API clients you can call the /self-service/logout/api URL directly with the Ory Session Token.

The URL is only valid for the currently signed in user. If no user is signed in, this endpoint returns a 401 error.

When calling this endpoint from a backend, please ensure to properly forward the HTTP cookies.

Request Params

KeyDatatypeRequiredDescription
return_tostringReturn to URL

The URL to which the browser should be redirected to after the logout has been performed. |

HEADERS

KeyDatatypeRequiredDescription
cookiestringHTTP Cookies

If you call this endpoint from a backend, please include the original Cookie header in the request. | | Accept | string | | |

RESPONSES

status: OK

{&quot;logout_url&quot;:&quot;\u003cstring\u003e&quot;,&quot;logout_token&quot;:&quot;\u003cstring\u003e&quot;}