# Logout User POST https://api-gateway-stg.transak.com/api/v1/auth/logout Logout User Reference: https://docs.transak.com/api/whitelabel/user/logout-user ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: whitelabel-api version: 1.0.0 paths: /api/v1/auth/logout: post: operationId: logout-user summary: Logout User description: Logout User tags: - subpackage_user parameters: - name: authorization in: header description: >- Authorization token is the accessToken received from the API -` api/v2/auth/verify` required: true schema: type: string default: YOUR_USER_AUTH_TOKEN responses: '200': description: 200 - Confirm Payment Success content: application/json: schema: $ref: '#/components/schemas/User_logout-user_Response_200' '400': description: 400 - Bad Request content: application/json: schema: $ref: '#/components/schemas/Logout-userRequestBadRequestError' '500': description: 500 - Internal Server Error content: application/json: schema: $ref: '#/components/schemas/Logout-userRequestInternalServerError' servers: - url: https://api-gateway-stg.transak.com components: schemas: ApiV1AuthLogoutPostResponsesContentApplicationJsonSchemaData: type: object properties: message: type: string required: - message title: ApiV1AuthLogoutPostResponsesContentApplicationJsonSchemaData User_logout-user_Response_200: type: object properties: data: $ref: >- #/components/schemas/ApiV1AuthLogoutPostResponsesContentApplicationJsonSchemaData required: - data title: User_logout-user_Response_200 ApiV1AuthLogoutPostResponsesContentApplicationJsonSchemaError: type: object properties: statusCode: type: integer name: type: string message: type: string required: - statusCode - name - message title: ApiV1AuthLogoutPostResponsesContentApplicationJsonSchemaError Logout-userRequestBadRequestError: type: object properties: error: $ref: >- #/components/schemas/ApiV1AuthLogoutPostResponsesContentApplicationJsonSchemaError required: - error title: Logout-userRequestBadRequestError Logout-userRequestInternalServerError: type: object properties: error: $ref: >- #/components/schemas/ApiV1AuthLogoutPostResponsesContentApplicationJsonSchemaError required: - error title: Logout-userRequestInternalServerError ``` ## SDK Code Examples ```python Success import requests url = "https://api-gateway-stg.transak.com/api/v1/auth/logout" headers = {"authorization": "YOUR_USER_AUTH_TOKEN"} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript Success const url = 'https://api-gateway-stg.transak.com/api/v1/auth/logout'; const options = {method: 'POST', headers: {authorization: 'YOUR_USER_AUTH_TOKEN'}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Success package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api-gateway-stg.transak.com/api/v1/auth/logout" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("authorization", "YOUR_USER_AUTH_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Success require 'uri' require 'net/http' url = URI("https://api-gateway-stg.transak.com/api/v1/auth/logout") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["authorization"] = 'YOUR_USER_AUTH_TOKEN' response = http.request(request) puts response.read_body ``` ```java Success import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api-gateway-stg.transak.com/api/v1/auth/logout") .header("authorization", "YOUR_USER_AUTH_TOKEN") .asString(); ``` ```php Success request('POST', 'https://api-gateway-stg.transak.com/api/v1/auth/logout', [ 'headers' => [ 'authorization' => 'YOUR_USER_AUTH_TOKEN', ], ]); echo $response->getBody(); ``` ```csharp Success using RestSharp; var client = new RestClient("https://api-gateway-stg.transak.com/api/v1/auth/logout"); var request = new RestRequest(Method.POST); request.AddHeader("authorization", "YOUR_USER_AUTH_TOKEN"); IRestResponse response = client.Execute(request); ``` ```swift Success import Foundation let headers = ["authorization": "YOUR_USER_AUTH_TOKEN"] let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway-stg.transak.com/api/v1/auth/logout")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```