---
title: "PUT /v1/accounts/{id}/auto-topup"
description: "Turn auto top-up on or off and set its threshold, pack and monthly cap."
canonical_url: https://groundsocial.dev/docs/api/accounts-autoTopup-update
---
# PUT /v1/accounts/{id}/auto-topup

> Turn auto top-up on or off and set its threshold, pack and monthly cap.

> ## Agent Instructions
> The Groundsocial REST API is at https://api.groundsocial.dev (OpenAPI: https://groundsocial.dev/openapi.json). Set yourself up with https://groundsocial.dev/SKILL.md; the MCP server is https://api.groundsocial.dev/mcp. Every docs page is Markdown at its URL plus `.md`; the index is https://groundsocial.dev/llms.txt.

|  |  |
| --- | --- |
| Request | `PUT /v1/accounts/{id}/auto-topup` |
| Operation id | `accounts.autoTopup.update` |
| Cost | Free |
| Auth | Dashboard session: `Authorization: Bearer <session_token>`. API keys are refused. |

Below threshold_credits (100 to 1000000, under the pack's credits) the saved card is charged for the pack, at most monthly_cap_usd per UTC month (up to $10000). Turning it on needs a saved card (409 otherwise). A declined card turns it off and emails the owners.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | Example: `acct_01J…`. |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `enabled` | `boolean` | yes |  |
| `threshold_credits` | `integer` | yes |  |
| `pack` | `string` | yes | starter, builder, scale, volume |
| `monthly_cap_usd` | `string` | yes |  |

## Responses

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | The saved settings. | `AutoTopup` |
| `400` | Invalid settings. | `Error` |
| `401` | Not signed in, or an API key was sent. | `Error` |
| `403` | Members can look; owners and admins make changes. | `Error` |
| `404` | No such account among yours. | `Error` |
| `409` | No saved card yet. | `Error` |

### AutoTopup fields

| Field | Type | Description |
| --- | --- | --- |
| `enabled` | `boolean` |  |
| `active` | `boolean` | Enabled with a saved card: the next spend below the threshold charges it. |
| `threshold_credits` | `integer` |  |
| `pack` | `string` |  |
| `monthly_cap_usd` | `string` |  |
| `spent_this_month_usd` | `string` |  |
| `card` | `object \| null` |  |
| `disabled_reason` | `string \| null` |  |
| `attempts` | `object[]` |  |

Errors use one shape everywhere; see [Errors](https://groundsocial.dev/docs/errors) for every code and what to do.

## Example

cURL:

```bash
curl -X POST "https://api.groundsocial.dev/v1/accounts/acct_01J…/auto-topup" \
  -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled":"<enabled>","threshold_credits":"<threshold_credits>","pack":"<pack>","monthly_cap_usd":"<monthly_cap_usd>"}'
```

TypeScript:

```ts
const res = await fetch('https://api.groundsocial.dev/v1/accounts/acct_01J…/auto-topup', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({"enabled":"<enabled>","threshold_credits":"<threshold_credits>","pack":"<pack>","monthly_cap_usd":"<monthly_cap_usd>"}),
})
if (!res.ok) throw new Error((await res.json()).error.hint)
const data = await res.json()
```

Python:

```python
import os, requests

res = requests.post(
    "https://api.groundsocial.dev/v1/accounts/acct_01J…/auto-topup",
    headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
    json={"enabled":"<enabled>","threshold_credits":"<threshold_credits>","pack":"<pack>","monthly_cap_usd":"<monthly_cap_usd>"},
)
res.raise_for_status()
data = res.json()
```

_Canonical HTML: https://groundsocial.dev/docs/api/accounts-autoTopup-update_

## Site Navigation

### Global Hub
- [Home](https://groundsocial.dev/index.md)
- [Pricing](https://groundsocial.dev/pricing.md)
- [Endpoints](https://groundsocial.dev/endpoints.md)
- [For agents](https://groundsocial.dev/agents.md)
- [Docs](https://groundsocial.dev/docs.md)
- [Compare](https://groundsocial.dev/compare.md)
- [Blog](https://groundsocial.dev/blog.md)
- [Tutorials](https://groundsocial.dev/tutorials.md)
- [Changelog](https://groundsocial.dev/changelog.md)
- [llms.txt](https://groundsocial.dev/llms.txt)
- [Agent skill](https://groundsocial.dev/SKILL.md)

### On This Topic
- [Groundsocial docs](https://groundsocial.dev/docs.md)
- [Quickstart](https://groundsocial.dev/docs/quickstart.md)
- [Authentication](https://groundsocial.dev/docs/authentication.md)
- [Credits and payments](https://groundsocial.dev/docs/payments.md)
- [Rate limits](https://groundsocial.dev/docs/rate-limits.md)
- [Errors](https://groundsocial.dev/docs/errors.md)
- [Data freshness and caching](https://groundsocial.dev/docs/freshness.md)
- [MCP server](https://groundsocial.dev/docs/mcp.md)
- [SKILL.md, llms.txt and Markdown twins](https://groundsocial.dev/docs/skill.md)
- [CLI](https://groundsocial.dev/docs/cli.md)
- [TypeScript SDK](https://groundsocial.dev/docs/sdk.md)
- [PRAW and snoowrap](https://groundsocial.dev/docs/praw.md)
- [Legal and compliance](https://groundsocial.dev/docs/compliance.md)
- [API reference](https://groundsocial.dev/docs/api.md)

## Structured data

```json
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://groundsocial.dev/"},{"@type":"ListItem","position":2,"name":"Docs","item":"https://groundsocial.dev/docs"},{"@type":"ListItem","position":3,"name":"API reference","item":"https://groundsocial.dev/docs/api"},{"@type":"ListItem","position":4,"name":"PUT /v1/accounts/{id}/auto-topup","item":"https://groundsocial.dev/docs/api/accounts-autoTopup-update"}]}
```
