Skip to content

Campaign programs: update, delete

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

Reference for Campaign, one group of Campaign programs.

Campaign.update

Changes the given properties of a Campaign. Verb page.

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

Emits Campaign.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Campaign.
budgetmoneyWhat it may spend.
startsAtdatetimeWhen it starts.
endsAtdatetimeWhen it ends.

Returns

OutputTypeRequiredDescription
campaignCampaignrequiredThe Campaign.

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 $.Campaign.update({ id: 'campaign_NYwCp4DcII', budget: { amount: 29, currency: 'USD' } })"
  }
}

Campaign.delete

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

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

Emits Campaign.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Campaign.

Returns

OutputTypeRequiredDescription
campaignCampaignrequiredThe Campaign.

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 $.Campaign.delete({ id: 'campaign_NYwCp4DcII' })"
  }
}