Auth
Refresh Token
Get a new access token using a refresh token.
Authorization
Authorization
RequiredBearer <token>Enter the JWT token you received from the login endpoint (without 'Bearer' prefix)
In: header
Request Body
application/json
Requiredrefresh_token
RequiredRefresh TokenResponse Body
Schema for token response.
TypeScript Definitions
Use the response body type in TypeScript.
access_token
RequiredAccess Tokenrefresh_token
RequiredRefresh Tokentoken_type
Token TypeDefault:
"bearer"
Validation Error
TypeScript Definitions
Use the response body type in TypeScript.
detail
Detailcurl -X POST "https://api.mor.org/api/v1/auth/refresh" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"refresh_token": "string"
}'
const body = JSON.stringify({
"refresh_token": "string"
})
fetch("https://api.mor.org/api/v1/auth/refresh", {
headers: {
"Authorization": "Bearer <token>"
},
body
})
package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://api.mor.org/api/v1/auth/refresh"
body := strings.NewReader(`{
"refresh_token": "string"
}`)
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/refresh"
body = {
"refresh_token": "string"
}
response = requests.request("POST", url, json = body, headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
})
print(response.text)
{
"access_token": "string",
"refresh_token": "string",
"token_type": "bearer"
}
{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}
How is this guide?
Login POST
Log in a user and return JWT tokens. Simply provide your email and password directly in the request body: ```json { "email": "user@example.com", "password": "yourpassword" } ``` The response will contain an access_token that should be used in the Authorization header for protected endpoints, with the format: `Bearer {access_token}`
Register User POST
Register a new user.