POST
/
v1
/
campaigns
curl --request POST \
  --url https://api.castled.io/backend/external/v1/campaigns \
  --header 'Api-Key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "my-campaign",
  "externalId": "<string>",
  "segment": {
    "query": "select * from users",
    "primaryKey": "user_id"
  },
  "schedule": {
    "type": "START_NOW",
    "startTs": 123
  },
  "message": {
    "type": "MOBILE_PUSH",
    "iosEnabled": true,
    "androidEnabled": true,
    "title": {
      "en": "Hey {{ first_name | '\''there'\'' }}",
      "hi": " हेलो {{ first_name | '\''there'\'' }}"
    },
    "subtitle": {},
    "body": {
      "en": "Hello from Castled!",
      "hi": "कैसल्ड की ओर से नमस्ते!"
    },
    "collapseId": "<string>",
    "ttl": 123,
    "action": "DEFAULT",
    "androidActionUrl": "<string>",
    "iosActionUrl": "<string>",
    "keyVals": {},
    "bigImageUrl": "<string>",
    "largeIconUrl": "<string>",
    "smallIconResourceId": "<string>",
    "androidChannel": "<string>",
    "priority": "NORMAL",
    "androidActionButtons": [
      {
        "label": "<string>",
        "url": "<string>",
        "clickAction": "DEEP_LINKING",
        "keyVals": {}
      }
    ],
    "soundFileName": "<string>",
    "richMediaUrl": "<string>",
    "mediaType": "IMAGE",
    "interruptionLevel": "PASSIVE",
    "badgeCount": 123,
    "relevanceScore": "SCORE_MAX",
    "contentAvailable": true,
    "actionCategory": {
      "type": "PREDEFINED_CATEGORY",
      "name": "<string>",
      "actionComponents": [
        {
          "actionId": "<string>",
          "url": "<string>",
          "clickAction": "DEEP_LINKING",
          "keyVals": {},
          "useWebview": true
        }
      ]
    }
  }
}'
{
  "uuid": "<string>"
}

Headers

Api-Key
string
required

Private key to access the API.

Body

application/json
Event data to be tracked.

Schema representing campaign create request data.

Response

200 - application/json
Campaign successfully created

A standard response for successful campaign creation.