curl --request POST \
--url https://api.hevn.finance/dapi/v1/auth/refresh \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"userId": "cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41"
}
'import requests
url = "https://api.hevn.finance/dapi/v1/auth/refresh"
payload = { "userId": "cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({userId: 'cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41'})
};
fetch('https://api.hevn.finance/dapi/v1/auth/refresh', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"accessToken": "<string>",
"expiresIn": 123,
"userId": "cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41"
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}Exchange a refresh token for a session, optionally acting for an account
Exchange a device-bound refresh token for a new short-lived access token. userId may select an account the authenticated actor is currently authorized to access.
curl --request POST \
--url https://api.hevn.finance/dapi/v1/auth/refresh \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"userId": "cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41"
}
'import requests
url = "https://api.hevn.finance/dapi/v1/auth/refresh"
payload = { "userId": "cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({userId: 'cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41'})
};
fetch('https://api.hevn.finance/dapi/v1/auth/refresh', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"accessToken": "<string>",
"expiresIn": 123,
"userId": "cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41"
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}Authorizations
Platform access token from POST /auth/token, carrying the platform audience and the developer_key_id of the registration that minted it. It acts as your own account; name a client you created with X-Hevn-Account: cl_…. Every request re-checks that the registration is still active and that the caller's source IP is inside its allowlist. A token is valid only against the server that issued it, so sandbox tokens are refused in production and production tokens in the sandbox.
Body
Account to act for; omit it to continue acting as the authenticated account.
^(?:cl_)?[A-Za-z0-9._:\-]{1,216}$"cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41"
Response
Successful Response
Short-lived bearer token used to authorize API requests.
Number of seconds until the access token expires.
Account selected for the issued session.
^(?:cl_)?[A-Za-z0-9._:\-]{1,216}$"cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41"
Was this page helpful?