Update auto top-off settings
PUT
/api/v1/credits/auto-topoff
Authentication
Bearer Token API Key (cookie: better-auth.session_token)
Request Body
application/jsonenabled
boolean
REQUIRED
packId
string
REQUIRED
Enum:
5, 20, 50, 100Responses
200
Updated auto top-off config
application/jsonenabled
boolean
REQUIRED
packId
string
REQUIRED
Enum:
5, 20, 50, 100
400
Invalid pack
401
Unauthorized
curl -X PUT 'https://littledemo.com/api/v1/credits/auto-topoff' \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "enabled": true, "packId": "5"}'
const response = await fetch('https://littledemo.com/api/v1/credits/auto-topoff', { method: 'PUT', headers: { "Authorization": "Bearer YOUR_API_TOKEN", "Content-Type": "application/json" }, body: JSON.stringify({ "enabled": true, "packId": "5" })});const data = await response.json();console.log(data);
import requestsheaders = { 'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.put('https://littledemo.com/api/v1/credits/auto-topoff', headers=headers, json={ "enabled": true, "packId": "5"})print(response.json())
200
Response
{ "enabled": true, "packId": "5"}
API Playground
Try this endpoint
PUT
/api/v1/credits/auto-topoff