Mutation
createCampaign
Create a campaign of a given campaignType in the current workspace. Idempotent on externalId.
Arguments
Object, input and enum types open in place — use + to reveal their fields. A type that is already open above the row stops at a ↻ circular marker, and anything nested past the depth limit links out to its own page instead.
- input CreateCampaignInput! required
- Mutation input.
- campaignType CampaignType! required
- What kind of campaign to create. It decides which dates are required and which settings member applies.
- CONTENT_CAPTURE
- Content Capture: Archive adds no posts on its own; the campaign holds exactly the posts you add with updateCampaign(posts:). Read them with items(filter: { campaignsIds: [<campaign id>] }); that list is search-indexed and catches up shortly after a change, so diff against it on a later run, not right after patching. dateStart and dateEnd are optional. No options: send no
settings. - CREATOR_MONITORING
- Creator Monitoring: Archive captures the posts every creator on the roster publishes between dateStart and dateEnd (both required). Options:
settings.creatorMonitoring. - dateEnd DateTime
- End of the campaign's window (UTC), not before dateStart. Required for CREATOR_MONITORING. Uses the supplied instant at whole-second precision; choose your timezone and day boundaries, then convert to UTC before sending it.
- dateStart DateTime
- Start of the campaign's window (UTC). Required for CREATOR_MONITORING: creators added later have their posts pulled back to it. Uses the supplied instant at whole-second precision; choose your timezone and day boundaries, then convert to UTC before sending it.
- externalId String! required
- The caller's key for this campaign, at most 255 characters (surrounding whitespace is trimmed). A workspace holds one campaign per key: sending a key again returns the campaign it first created, as stored (nothing is changed), so a retried request never creates a second campaign.
- name String! required
- Campaign name as shown in Archive. Stored with surrounding whitespace and invisible characters removed and NFC-normalized; that stored form must be unique among the workspace's campaigns of this campaignType (compared exactly, so names differing only in case are distinct). Blank, longer than 255 characters, or holding control or bidirectional text characters is a userError on input.name. Not checked on an externalId replay.
- settings CampaignSettingsInput
- Type-specific options; omit to use the type defaults.
- creatorMonitoring CreatorMonitoringSettingsInput
- Options for a CREATOR_MONITORING campaign.
- tagNames [String!] default []
- Hashtags or mentions that narrow capture to posts carrying any of them. Empty (the default) captures every post the roster publishes in the window. Note: a creator's tracking mode is shared across the workspace — one campaign capturing everything widens it for all of them. Each entry is a #hashtag or @mention. Entries are trimmed, lowercased and split on whitespace, trailing commas are dropped and duplicates count once. An entry that is blank, or holds a token that is not # or @ followed by the tag, is a userError on its index.
Returns
- campaign Campaign
- The campaign for this externalId: new, or the existing one on a repeat. Null on validation failure.
- campaignType CampaignType
- What kind of campaign this is; null for a campaign whose type the API does not expose.
- CONTENT_CAPTURE
- Content Capture: Archive adds no posts on its own; the campaign holds exactly the posts you add with updateCampaign(posts:). Read them with items(filter: { campaignsIds: [<campaign id>] }); that list is search-indexed and catches up shortly after a change, so diff against it on a later run, not right after patching. dateStart and dateEnd are optional. No options: send no
settings. - CREATOR_MONITORING
- Creator Monitoring: Archive captures the posts every creator on the roster publishes between dateStart and dateEnd (both required). Options:
settings.creatorMonitoring. - createdAt DateTime!
- When the campaign was created (UTC).
- creatorsCount Int!
- Creators currently on the roster. Creators added through updateCampaign join it once their background import resolves them.
- dateEnd DateTime
- End of the campaign's window (UTC); null when it has none.
- dateStart DateTime
- Start of the campaign's window (UTC); null when it has none.
- externalId String
- The key the campaign was created with through createCampaign; null for a campaign created in the Archive app.
- id ID!
- Unique identifier for the campaign in Archive's system.
- name String!
- Campaign name as shown in Archive.
- userErrors [UserError!]!
- List of user-facing validation errors. Empty on success.
- field [String!]
- Path to the input field that caused the error.
- message String!
- The error message.