Morpheus API Gateway LogoMorpheus API Gateway
Auth

Store Private Key

Store an encrypted blockchain private key for the authenticated user. Replaces any existing key.

POST
/api/v1/auth/private-key

Authorization

AuthorizationRequiredBearer <token>

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

In: header

Request Body

application/jsonRequired
[key: string]any

Response Body

Successful Response

TypeScript Definitions

Use the response body type in TypeScript.

[key: string]any

Validation Error

TypeScript Definitions

Use the response body type in TypeScript.

detailDetail
curl -X POST "https://api.mor.org/api/v1/auth/private-key" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{}'
const body = JSON.stringify({})

fetch("https://api.mor.org/api/v1/auth/private-key", {
  headers: {
    "Authorization": "Bearer <token>"
  },
  body
})
package main

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

func main() {
  url := "https://api.mor.org/api/v1/auth/private-key"
  body := strings.NewReader(`{}`)
  req, _ := http.NewRequest("POST", url, body)
  req.Header.Add("Authorization", "Bearer <token>")
  req.Header.Add("Content-Type", "application/json")
  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/private-key"
body = {}
response = requests.request("POST", url, json = body, headers = {
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
})

print(response.text)
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

How is this guide?