Morpheus API Gateway LogoMorpheus API Gateway
Auth

Delete Api Key

Deactivate an API key. Requires JWT Bearer authentication with the token received from the login endpoint.

DELETE
/api/v1/auth/keys/{key_id}

Authorization

AuthorizationRequiredBearer <token>

Enter the JWT token you received from the login endpoint (without 'Bearer' prefix)

In: header

Path Parameters

key_idRequiredKey Id

Response Body

Schema for API key in database response.

TypeScript Definitions

Use the response body type in TypeScript.

idRequiredId
key_prefixRequiredKey Prefix
namestring | null | null
created_atRequiredCreated At
Format: "date-time"
is_activeRequiredIs Active

Validation Error

TypeScript Definitions

Use the response body type in TypeScript.

detailDetail

@minItems 0

curl -X DELETE "https://api.mor.org/api/v1/auth/keys/0" \
  -H "Authorization: Bearer <token>"
fetch("https://api.mor.org/api/v1/auth/keys/0", {
  headers: {
    "Authorization": "Bearer <token>"
  }
})
package main

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

func main() {
  url := "https://api.mor.org/api/v1/auth/keys/0"

  req, _ := http.NewRequest("DELETE", url, nil)
  req.Header.Add("Authorization", "Bearer <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/auth/keys/0"

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

print(response.text)
{
  "id": 0,
  "key_prefix": "string",
  "name": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "is_active": true
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

How is this guide?