solarOSsolarOS Docs

Create a Campaign

Creates one tenant-scoped Campaign. Requires Idempotency-Key. External References are created transactionally and conflicts return 409. Writes emit campaign.created for webhook subscribers. Required scope: campaigns:write.

POST
/campaigns

Creates one tenant-scoped Campaign. Requires Idempotency-Key. External References are created transactionally and conflicts return 409. Writes emit campaign.created for webhook subscribers. Required scope: campaigns:write.

Authorization

Authorization<token>

Organization API key. Format: Bearer sk_live_...

In: header

Request Body

application/json

JSON request payload for createCampaign.

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/campaigns" \  -H "Content-Type: application/json" \  -d '{    "name": "Fall referral campaign",    "status": "active",    "type": "referral",    "isActive": true  }'
{  "data": {    "id": "string",    "name": "string",    "status": "string",    "type": "string",    "description": "string",    "isActive": true,    "startDate": "2019-08-24T14:15:22Z",    "endDate": "2019-08-24T14:15:22Z",    "budgetedCost": "string",    "actualCost": "string",    "expectedRevenue": "string",    "expectedResponseRate": "string",    "metadata": {},    "externalReferences": [      {}    ],    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  },  "meta": {    "requestId": "string",    "version": "v1",    "timestamp": "2019-08-24T14:15:22Z",    "rateLimit": {      "limit": 0,      "remaining": 0,      "reset": 0    }  }}