Skip to content

Limit methods: update, delete

The Limit Verbs update, delete as typed SDK methods, with inputs, result, refusals and an example.

Reference for Limit, one group of Limit methods.

Limit.update

Changes the given properties of a Limit. Verb page.

TypeScript
interface LimitVerbs {
  update(input: LimitUpdateInput, options?: SB.CallOptions): SB.Call<Limit>
}

Emits Limit.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Limit.
amountmoneyThe most money it allows.
countintegerThe most calls or units it allows.
periodstringThe window a rate resets over, such as a month.
percentnumberThe largest share off a reference amount it allows, such as 15 percent off list Price.
resetsstringOne of calendar, rolling: a calendar Limit resets at the start of each period, a rolling one counts the last period from now.

Returns

OutputTypeRequiredDescription
limitLimitrequiredThe Limit.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const limit = await $.Limit.update({ id: 'limit_UWHXYVKsJB', amount: { amount: 29, currency: 'USD' } })

Limit.delete

Deletes a Limit: a soft delete that keeps its history, undone by Thing.restore. Verb page.

TypeScript
interface LimitVerbs {
  delete(input: LimitDeleteInput, options?: SB.CallOptions): SB.Call<Limit>
}

Emits Limit.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Limit.

Returns

OutputTypeRequiredDescription
limitLimitrequiredThe Limit.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const limit = await $.Limit.delete({ id: 'limit_UWHXYVKsJB' })