Change the overage opt-in
PATCH
/v1/billing
const url = 'https://api.overwatch.weareheavy.dev/v1/billing';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"overageEnabled":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.overwatch.weareheavy.dev/v1/billing \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "overageEnabled": true }'Flip the account’s overage opt-in. Turning it on un-pauses every app at its allowance from the next scheduler tick; turning it off re-arms pause-and-notify at each allowance. Session-only, owner/admin.
Authorizations
Section titled “ Authorizations ”Request Bodyrequired
Section titled “ Request Bodyrequired ”Media typeapplication/json
object
overageEnabled
required
boolean
Example
{ "overageEnabled": true}Responses
Section titled “ Responses ”The new opt-in state.
Media typeapplication/json
object
overageEnabled
required
boolean
Examplegenerated
{ "overageEnabled": true}overageEnabled is missing or not a boolean.
Media typeapplication/json
object
error
required
A human-readable error message.
string
Examplegenerated
{ "error": "example"}Missing or invalid credentials.
Media typeapplication/json
object
error
required
A human-readable error message.
string
Example
{ "error": "invalid api key"}A dashboard session is required (API-key callers are rejected), or the session’s role does not allow this action.
Media typeapplication/json
object
error
required
A human-readable error message.
string
Example
{ "error": "a dashboard session is required"}