Skip to main content
POST
Create a refill configuration.

Authorizations

x-api-key
string
header
required

LedgerUp API Key.

Headers

Idempotency-Key
string

Optional. Duplicate keys within the same company namespace and route return 409. Non-empty idempotency key for deduplicating write requests on the same route.

Example:

"6f31c20e-725c-4be8-96f4-835042f67602"

Body

application/json

Create-refill-configuration request. target_balance must be greater than minimum_balance. Unknown JSON fields are rejected.

account_id
string
required

LedgerUp account identifier.

Pattern: ^account_[0-9a-f]{32}$
Example:

"account_0194f4e3a2b77c6aa91c4f6b4db2a980"

metric_id
string
required

LedgerUp metric identifier.

Pattern: ^metric_[0-9a-f]{32}$
Example:

"metric_0194f4e3a2b77c6aa91c4f6b4db2a980"

minimum_balance
string
required

Decimal balance serialized as a string.

Pattern: ^-?\d+(\.\d+)?$
Example:

"100.0"

target_balance
string
required

Decimal balance serialized as a string.

Pattern: ^-?\d+(\.\d+)?$
Example:

"100.0"

is_active
boolean
required

Whether automatic refills are enabled.

Example:

true

Response

Created.

account_id
string
required

LedgerUp account identifier.

Pattern: ^account_[0-9a-f]{32}$
Example:

"account_0194f4e3a2b77c6aa91c4f6b4db2a980"

metric_id
string
required

LedgerUp metric identifier.

Pattern: ^metric_[0-9a-f]{32}$
Example:

"metric_0194f4e3a2b77c6aa91c4f6b4db2a980"

minimum_balance
string
required

Decimal balance serialized as a string.

Pattern: ^-?\d+(\.\d+)?$
Example:

"100.0"

target_balance
string
required

Decimal balance serialized as a string.

Pattern: ^-?\d+(\.\d+)?$
Example:

"100.0"

is_active
boolean
required

Whether automatic refills are enabled.

Example:

true

created_at
integer<int64>
required

Unix timestamp in seconds.

Example:

1767225600

updated_at
integer<int64>
required

Unix timestamp in seconds.

Example:

1767225600