Logging out users (v2)

Note: This guide describes how to log out users using the v2 endpoint. To see the latest v2.1 version of this guide, go to Logging out users. For more information on LINE Login v2.1, see the LINE Login v2.1 released news post.

You can enable logout on your app by invalidating the access token through the Social API. To provide a better user experience, we recommend providing a way for users to log out of your app.

Before you begin

To call the Social API, you must have an access token retrieved through the LINE Login authentication and authorization process. For more information on how to use LINE Login, see the following pages.

Logging out users

To log out users, make an HTTP POST request to the https://api.line.me/v2/oauth/revoke endpoint with a refresh token in the body. This request invalidates the user’s access token and logs out the user. All user data stored on your app should be deleted when a user’s access token is invalidated.

POST https://api.line.me/v2/oauth/revoke

Request header

Header Description
Content-Type application/x-www-form-urlencoded

Request body

Parameter Description
refresh_token Refresh token string

Example request

curl -v -X POST https://api.line.me/v2/oauth/revoke \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'refresh_token={refresh token}'

Response

If the call is successful, a 200 OK HTTP status code and an empty response body are returned.

Status codes

The following HTTP status codes are returned when an HTTP request is sent.

HTTP status Description
200 OK Request successful
400 Bad Request Problem with the request. Check the request parameters and JSON format.
401 Unauthorized Check that the authorization header is correct.
403 Forbidden Not authorized to use the API. Confirm that your account or plan is authorized to use the API.
429 Too Many Requests Make sure that you are within the rate limits for requests.
500 Internal Server Error Temporary error on the API server.

{{ $t("form.question.helpful") }}

{{ $t("form.question.detail") }}

{{ $t("form.question.improve") }}

{{ $t("form.info.start") }}{{ $t("form.info.link") }}{{ $t("form.info.end") }}


{{ $t("form.result.success") }}
{{ $t("form.result.error") }}
{{ $t("form.result.errorLink") }}