Skip to content

Create a marketing/ad campaign

SessionCookie (EDITOR) OR MCP scope mcp:links_write. ?getOrCreate=1 resolves atomically by (projectId, name) and returns 200 instead of 201.

projectId
required
string

Tenant project id (row-level isolation on every query).

getOrCreate
string
Allowed values: 1

When ‘1’, reuse-or-create by name and return 200.

Media typeapplication/json

Marketing/ad campaign create (non-email). Budget in major units, stored as cents.

object
name
required
string
>= 1 characters
type
string
platform
string | null
budget
number | null
utmSource
string | null
utmMedium
string | null
utmCampaign
string | null
utmTerm
string | null
utmContent
string | null
startDate
string | null
endDate
string | null
status
string
config
object | null
Examplegenerated
json
{
"name": "example",
"type": "example",
"platform": "example",
"budget": 1,
"utmSource": "example",
"utmMedium": "example",
"utmCampaign": "example",
"utmTerm": "example",
"utmContent": "example",
"startDate": "example",
"endDate": "example",
"status": "example",
"config": "example"
}

Existing/created campaign (getOrCreate mode).

Media typeapplication/json
object
campaign
object
key
additional properties
any

Created campaign.

Media typeapplication/json
object
campaign
object
key
additional properties
any
Examplegenerated
json
{
"campaign": {}
}

Missing projectId or invalid config.

Media typeapplication/json
object
error
required

Human-readable error message.

string
message
string
Examplegenerated
json
{
"error": "example",
"message": "example"
}

Not authenticated (no valid session/principal).

Media typeapplication/json
object
error
required

Human-readable error message.

string
message
string
Examplegenerated
json
{
"error": "example",
"message": "example"
}

Authenticated but lacks the required project role.

Media typeapplication/json
object
error
required

Human-readable error message.

string
message
string
Examplegenerated
json
{
"error": "example",
"message": "example"
}