Skip to content

Ad programs: update, delete

The Ad Verbs update, delete as MCP do programs, with inputs, result, refusals and an example.

Reference for Ad, one group of Ad programs.

Ad.update

Changes the given properties of an Ad. Verb page.

Text
do: return await $.Ad.update(input)

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

JSON
{
  "name": "do",
  "arguments": {
    "code": "return 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.

Text
do: return await $.Ad.delete(input)

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

JSON
{
  "name": "do",
  "arguments": {
    "code": "return await $.Ad.delete({ id: 'ad_yVW4IAmeOW' })"
  }
}