Skip to main content

Logout

API to log out a user's active session, making the current session no longer valid. After logging out, the user will need to log in again for any further interactions.

Request

curl --location --request DELETE 'https://api.upstox.com/v2/logout' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'

For additional samples in various languages, please refer to the Sample code section on this page.

Responses

Response Body

{
"status": "success",
"data": true
}
NameTypeDescription
statusstringA string indicating the outcome of the request. Typically success for successful operations.
databooleanIndicates whether the logout was successful

Sample Code

import requests

url = 'https://api.upstox.com/v2/logout'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {your_access_token}'
}

response = requests.delete(url, headers=headers)

print(response.status_code)
print(response.json())
Loading...