Skip to content
Dashboard
API Reference

Update Credit Settings ​

Configure auto top-ups for your organization's credits.

Enable, disable, or update auto top-up settings for your organization. When enabled, credits are automatically purchased at your plan's top-up rate whenever your balance drops below the threshold.

Requires one of these active plans: creator, creator_annual, professional, or professional_annual. Returns 403 if no eligible plan is active.

To read current credit and auto top-up state, use GET /credits.

Request ​

bash
curl -X POST "https://api.mosaic.so/credits/settings" \
  -H "Authorization: Bearer mk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "auto_topup": {
      "enabled": true,
      "threshold": 1000,
      "quantity": 5000
    }
  }'

Body Parameters ​

FieldTypeRequiredDescription
auto_topup.enabledbooleanYesEnable or disable auto top-ups.
auto_topup.thresholdnumberYesCredit balance threshold that triggers an auto top-up (0 – 1,000,000).
auto_topup.quantitynumberYesNumber of credits to purchase per auto top-up (0 – 1,000,000).

Response ​

Returns the updated settings.

json
{
  "auto_topup": {
    "enabled": true,
    "threshold": 1000,
    "quantity": 5000
  }
}

Errors ​

StatusReason
403No active paid plan, or plan is not eligible for auto top-ups (must be creator, creator_annual, professional, or professional_annual).

Examples ​

Enable auto top-up ​

bash
curl -X POST "https://api.mosaic.so/credits/settings" \
  -H "Authorization: Bearer mk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "auto_topup": {
      "enabled": true,
      "threshold": 500,
      "quantity": 2000
    }
  }'

Disable auto top-up ​

bash
curl -X POST "https://api.mosaic.so/credits/settings" \
  -H "Authorization: Bearer mk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "auto_topup": {
      "enabled": false,
      "threshold": 0,
      "quantity": 0
    }
  }'