Database Cache
Create a Database cache value
Create a Database cache value. The request is scoped to the authenticated instance and enforces Database cache access.
POST
/
api
/
v1
/
databases
/
cache
/
create
Create a Database cache value
curl --request POST \
--url https://api.revoengine.com/api/v1/databases/cache/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "instance:feature:flags",
"value": {
"enabled": true,
"source": "admin"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({key: 'instance:feature:flags', value: {enabled: true, source: 'admin'}})
};
fetch('https://api.revoengine.com/api/v1/databases/cache/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.revoengine.com/api/v1/databases/cache/create"
payload = {
"key": "instance:feature:flags",
"value": {
"enabled": True,
"source": "admin"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Authorizations
Bearer JWT token or API Key (sk-*).
Body
application/json
Cache key.
Example:
"instance:feature:flags"
Non-null JSON value to store: an object, array, string, number, or boolean. Nested JSON values may be null.
Example:
{ "enabled": true, "source": "admin" }
Optional TTL in seconds for the cached value.
Example:
3600
Response
201
⌘I
Create a Database cache value
curl --request POST \
--url https://api.revoengine.com/api/v1/databases/cache/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "instance:feature:flags",
"value": {
"enabled": true,
"source": "admin"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({key: 'instance:feature:flags', value: {enabled: true, source: 'admin'}})
};
fetch('https://api.revoengine.com/api/v1/databases/cache/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.revoengine.com/api/v1/databases/cache/create"
payload = {
"key": "instance:feature:flags",
"value": {
"enabled": True,
"source": "admin"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
