Campaign methods: update, delete
The Campaign Verbs update, delete as typed SDK methods, with inputs, result, refusals and an example.
Reference for Campaign, one group of Campaign methods.
Campaign.update
Changes the given properties of a Campaign. Verb page.
interface CampaignVerbs {
update(input: CampaignUpdateInput, options?: SB.CallOptions): SB.Call<Campaign>
}Emits Campaign.updated.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Campaign. |
budget | money | What it may spend. | |
startsAt | datetime | When it starts. | |
endsAt | datetime | When it ends. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
campaign | Campaign | required | The Campaign. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
import { $ } from 'startup-builder'
const campaign = 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.
interface CampaignVerbs {
delete(input: CampaignDeleteInput, options?: SB.CallOptions): SB.Call<Campaign>
}Emits Campaign.deleted.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Campaign. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
campaign | Campaign | required | The Campaign. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
import { $ } from 'startup-builder'
const campaign = await $.Campaign.delete({ id: 'campaign_NYwCp4DcII' })