Skip to content

Audience methods: update, delete

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

Reference for Audience, one group of Audience methods.

Audience.update

Changes the given properties of an Audience. Verb page.

TypeScript
interface AudienceVerbs {
  update(input: AudienceUpdateInput, options?: SB.CallOptions): SB.Call<Audience>
}

Emits Audience.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Audience.
typelist of NounThe Nouns this Thing is an instance of.
outsidejsonThe ids this Thing has in outside tools, one per Integration, so a re-run matches instead of duplicating.
queryjsonThe saved query that defines a dynamic Collection.
sizeintegerHow many people match.

Returns

OutputTypeRequiredDescription
audienceAudiencerequiredThe Audience.

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 audience = await $.Audience.update({ id: 'audience_vmVkEYrXCN', size: 1 })

Audience.delete

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

TypeScript
interface AudienceVerbs {
  delete(input: AudienceDeleteInput, options?: SB.CallOptions): SB.Call<Audience>
}

Emits Audience.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Audience.

Returns

OutputTypeRequiredDescription
audienceAudiencerequiredThe Audience.

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 audience = await $.Audience.delete({ id: 'audience_vmVkEYrXCN' })