Version
PATCH

Change the auto top-up and the cap

/v1/me/copilot-credits/settings in the Copilot Credits API.

curl -X PATCH https://api.subscriby.net/v1/me/copilot-credits/settings \  -H "Authorization: Bearer $SUBSCRIBY_TOKEN" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{ "auto_topup_pack": "regular", "auto_topup_below_cents": 500 }'

Answers 200 with the settings after the change. Every field is optional and an omitted one keeps its stored value, so { "auto_topup_pack": null } switches the auto top-up off and changes nothing else. The bounds are the Billing dialog's: a threshold of $1 to $100 and a cap of $0 to $10,000, in cents. Saving the settings resumes an auto top-up a failed charge had paused.

PATCH
/v1/me/copilot-credits/settings

Requires ability

The token must hold this ability, or the call is refused with 403.

Runs the same action from an agent, behind the same ability.

Idempotent

Send the header on every call; the same key replays the original response for 24 hours.

Authorization

bearerToken
AuthorizationBearer <token>

A personal access token minted on the dashboard under Settings, then Tokens, sent as Authorization: Bearer sbt_live_…. The token carries the abilities each endpoint lists under Requires ability and is frozen to one team.

In: header

Header Parameters

Idempotency-Key*string

A key unique to this operation, such as a fresh UUID. The same key replays the original 2xx response for 24 hours (with Idempotent-Replay: true), so a retry after a timeout never repeats the write; the same key with a different body is refused with 409.

Formatuuid

Request body

JSONWhat the request carries

Validates PATCH /api/v1/me/copilot-credits/settings: the auto top-up and the monthly cap.

Partial by design: every field is optional and an omitted one keeps its stored value, so a client can switch the auto top-up off with one key. The bounds are the Billing dialog's, in cents: a threshold of $1 to $100 and a cap of $0 to $10,000, so the API cannot set what the dialog refuses.

Responses

200OK

The settings after the change.

400Bad request

Every write needs an Idempotency-Key header. Send a fresh UUID per distinct operation.

401Unauthorized

The request carries no bearer token, or one that is revoked, malformed, or minted for another environment (an sbt_test_ token on production).

403Forbidden

The token is valid but does not carry the ability this endpoint requires; error.context.required_ability names the one to grant. An endpoint that also checks who owns a row or which tier the account is on answers FORBIDDEN, TEAM_TIER_REQUIRED or CONNECTOR_TIER_REQUIRED with the same status, and says so in its own description.

409Conflict

The key was already used in the last 24 hours with a different request body.

422Validation failed

The payload broke a rule, and error.fields maps each offending key to its messages. A refusal from the domain, such as a plan that cannot go on sale or a member who cannot be removed, uses the same code with error.message saying why and no fields. On this endpoint: VALIDATION_FAILED: when auto_topup_pack is not a pack on sale, auto_topup_below_cents is outside 100 to 10,000, monthly_spend_cap_cents is outside 0 to 1,000,000, or the auto top-up is switched on with no card on file.

425Too early

The first request with this key is still running; retry in a few seconds and the original response is replayed.

429Too many requests

The token has spent its 300 requests a minute or 10,000 an hour; Retry-After says when the next one is accepted.

How is this guide?

Last updated on