Skip to content

Ad methods: update, delete

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

Reference for Ad, one group of Ad methods.

Ad.update

Changes the given properties of an Ad. Verb page.

TypeScript
interface AdVerbs {
  update(input: AdUpdateInput, options?: SB.CallOptions): SB.Call<Ad>
}

Emits Ad.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Ad.
formatstringOne of search, display, image, or video.
spendmoneyWhat it has cost so far.

Returns

OutputTypeRequiredDescription
adAdrequiredThe Ad.

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 ad = await $.Ad.update({ id: 'ad_yVW4IAmeOW', format: 'search' })

Ad.delete

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

TypeScript
interface AdVerbs {
  delete(input: AdDeleteInput, options?: SB.CallOptions): SB.Call<Ad>
}

Emits Ad.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Ad.

Returns

OutputTypeRequiredDescription
adAdrequiredThe Ad.

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 ad = await $.Ad.delete({ id: 'ad_yVW4IAmeOW' })