# Logout user POST /api/v1/logout/ Clears authentication cookies and instructs browser to clear site data. Reference: https://docs.aisquare.studio/api-reference/ai-square-studio-api/logout/create ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: AISquare Studio API version: 1.0.0 paths: /api/v1/logout/: post: operationId: create summary: Logout user description: Clears authentication cookies and instructs browser to clear site data. tags: - subpackage_logout responses: '200': description: Logout successful, cookies cleared content: application/json: schema: description: Any type '401': description: Unauthorized content: application/json: schema: description: Any type ``` ## SDK Code Examples ```python Logout Example import requests url = "https://api.example.com/api/v1/logout/" response = requests.post(url) print(response.json()) ``` ```javascript Logout Example const url = 'https://api.example.com/api/v1/logout/'; const options = {method: 'POST'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Logout Example package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.example.com/api/v1/logout/" req, _ := http.NewRequest("POST", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Logout Example require 'uri' require 'net/http' url = URI("https://api.example.com/api/v1/logout/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) response = http.request(request) puts response.read_body ``` ```java Logout Example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.example.com/api/v1/logout/") .asString(); ``` ```php Logout Example request('POST', 'https://api.example.com/api/v1/logout/'); echo $response->getBody(); ``` ```csharp Logout Example using RestSharp; var client = new RestClient("https://api.example.com/api/v1/logout/"); var request = new RestRequest(Method.POST); IRestResponse response = client.Execute(request); ``` ```swift Logout Example import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/api/v1/logout/")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" 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() ```