Refresh access token
/v1/auth/refreshRequest body
Code samples
curl -X POST "https://api.canopy.dev/v1/auth/refresh" \
-H "Content-Type: application/json" \
-d '{}'const response = await fetch("https://api.canopy.dev/v1/auth/refresh", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.canopy.dev/v1/auth/refresh",
headers={
"Content-Type": "application/json"
},
json={},
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
payload := map[string]interface{}{}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", "https://api.canopy.dev/v1/auth/refresh", bytes.NewBuffer(body))
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}Responses
200 New tokens returned
{
"access_token": "string",
"token_type": "string",
"expires_in": 0,
"user": {
"id": "string",
"email": "string",
"first_name": "string",
"last_name": "string"
},
"default_environment_slug": "string"
}application/json
access_token *stringtoken_type *stringexpires_in *numberuserAuthUserDtodefault_environment_slugstring
401 Invalid or expired token