Morpheus API Gateway LogoMorpheus API Gateway
Session

Close Session

Close the session associated with the current API key.

POST
/api/v1/session/closesession

Authorization

Authorization<token>

Provide the API key in either format: 'Bearer sk-xxxxxx.yyyyyyy' or just 'sk-xxxxxx.yyyyyyy'. The prefix is 9 characters long including 'sk-'.

In: header

Response Body

Successful Response

TypeScript Definitions

Use the response body type in TypeScript.

responseRequiredunknown
curl -X POST "https://api.mor.org/api/v1/session/closesession" \
  -H "Authorization: <token>"
fetch("https://api.mor.org/api/v1/session/closesession", {
  headers: {
    "Authorization": "<token>"
  }
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://api.mor.org/api/v1/session/closesession"

  req, _ := http.NewRequest("POST", url, nil)
  req.Header.Add("Authorization", "<token>")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://api.mor.org/api/v1/session/closesession"

response = requests.request("POST", url, headers = {
  "Authorization": "<token>"
})

print(response.text)
null

How is this guide?