---
title: "Create a Logout URL for Browsers"
method: GET
path: "/self-service/logout/browser"
tags: ["frontend"]
---

# Create a Logout URL for Browsers

`GET /self-service/logout/browser`

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.

## Query parameters

- `return_to` string

## Headers

- `cookie` string

## Response `200`

logoutFlow

- LogoutFlow — Logout Flow
  - `logout_token` string, required — LogoutToken can be used to perform logout using AJAX.
  - `logout_url` string, required — LogoutURL can be opened in a browser to sign the user out. format: uri

## Other responses

- `400` — errorGeneric
- `401` — errorGeneric
- `500` — errorGeneric

## Changes

- **2023-08-31** `d10e7b267596` — 2 info
  - added the new optional `query` request parameter `return_to`
  - added the non-success response with the status `400`
- **2022-12-02** `b6e5ffa30d4c` — 3 info
  - api operation id `createSelfServiceLogoutFlowUrlForBrowsers` removed and replaced with `createBrowserLogoutFlow`
  - api tag `frontend` added
  - api tag `v0alpha2` removed
- **2021-10-28** `c55ed8ad9f0c` — 5 info
  - api tag `v0alpha2` added
  - api tag `v0alpha1` removed
  - added the optional property `error/id` to the response with the `401` status
  - added the optional property `error/id` to the response with the `500` status
  - …1 more
- **2021-09-12** `990ebe0a8820` — 1 info
  - the response property `logout_url` became required for the status `200`
- **2021-07-13** `8f1b399ab6e6` — 1 info
  - endpoint added

[Full history](https://skmtc.dev/ory/apis/ory-identities-api/changes/self-service/logout/browser/get.md)

---

[API](https://skmtc.dev/ory/apis/ory-identities-api.md) · [All operations](https://skmtc.dev/ory/apis/ory-identities-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ory/ory-identities-api/revisions/7a0df90e2f13/schema)
