API · Campaigns

Scheduled recurring sends.

Base: https://api.pushtifly.com. Every response uses { errCode, errMsg, data, meta }. Authentication and keys · Error catalog

GET/v1/campaigns

Recurring campaigns (notifications:read)

Key: sk_

Responses: 200

curl -X GET "https://api.pushtifly.com/v1/campaigns" \
  -H "Authorization: Bearer sk_test_YOUR_SECRET_KEY"

POST/v1/campaigns

Create a recurring campaign (notifications:send)

Key: sk_

Body

FieldTypeDescription
appIdstring
name*string
notification*object
notification.contentType"alert" | "data_only" | "silent"
notification.contentobjectPer language, e.g. { en: { title, subtitle, body } }
notification.variablesobjectThey replace {{name}} in the text
notification.dataobject
notification.deepLinkstringmax. 500 characters
notification.badgeinteger
notification.soundstringdefault or a sound registered in the app (2002 if it doesn't exist)
notification.ttlSecondsinteger0–2419200
notification.priority"high" | "normal"
notification.androidobject
notification.iosobject
notification.appIdstring
notification.target*object
notification.platforms"android" | "ios" | "web"[]
notification.category"transactional" | "marketing"
notification.scheduleobjectnow; at {sendAt, timezone}: fixed time (no offset = in timezone; defaults to the company's); local_time {date, time}: that time in each device's zone (~26 h). Maximum 365 days. Errors 2011 / 2012.
notification.validateOnlyboolean
notification.templateIdstringTemplate: what you send in the request takes priority; its variables are required (2001)
notification.mediaobjectOnly the URL travels in the payload. Android: large image (or GIF/video poster); iOS: mutable-content + _ph.media for the extension. A file still processing is only accepted in scheduled sends (4009 if immediate). Carousel: type carousel with items (2 to 5 images); without an SDK that draws it, the first one is shown.
notification.largeIconobjectImage (Android, via SDK)
notification.actionsobject[]max. 3 items
recurrence*object
recurrence.freq*"daily" | "weekly" | "monthly"
recurrence.intervalinteger1–52
recurrence.weekdays"mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun"[]
recurrence.monthDayintegerIf the month doesn't have that day, the last day · 1–31
recurrence.monthWeekobject
recurrence.time*string
recurrence.timezonestring
recurrence.startDatestring
recurrence.endDatestring
recurrence.countinteger1–1000

Responses: 201422

curl -X POST "https://api.pushtifly.com/v1/campaigns" \
  -H "Authorization: Bearer sk_test_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "appId": "YOUR_APP_ID",
  "name": "Weekly reminder",
  "notification": {
    "target": {
      "type": "topic",
      "name": "offers"
    },
    "content": {
      "en": {
        "title": "This week's deals",
        "body": "Check out what's new"
      }
    },
    "category": "marketing"
  },
  "recurrence": {
    "freq": "weekly",
    "weekdays": [
      "mon"
    ],
    "time": "09:00",
    "timezone": "America/New_York"
  }
}'

GET/v1/campaigns/{id}

Details: next 5 occurrences and the notifications created

Key: sk_

Parameters

NameInTypeDescription
id*pathstring

Responses: 200

curl -X GET "https://api.pushtifly.com/v1/campaigns/ID_ID" \
  -H "Authorization: Bearer sk_test_YOUR_SECRET_KEY"

PATCH/v1/campaigns/{id}

Edit name, notification or recurrence

Key: sk_

Parameters

NameInTypeDescription
id*pathstring

Responses: 200

curl -X PATCH "https://api.pushtifly.com/v1/campaigns/ID_ID" \
  -H "Authorization: Bearer sk_test_YOUR_SECRET_KEY"

DELETE/v1/campaigns/{id}

Cancel

Key: sk_

Parameters

NameInTypeDescription
id*pathstring

Responses: 200

curl -X DELETE "https://api.pushtifly.com/v1/campaigns/ID_ID" \
  -H "Authorization: Bearer sk_test_YOUR_SECRET_KEY"

POST/v1/campaigns/{id}/pause

Pause

Key: sk_

Parameters

NameInTypeDescription
id*pathstring

Responses: 200

curl -X POST "https://api.pushtifly.com/v1/campaigns/ID_ID/pause" \
  -H "Authorization: Bearer sk_test_YOUR_SECRET_KEY"

POST/v1/campaigns/{id}/resume

Resume (doesn't send the occurrences missed during the pause)

Key: sk_

Parameters

NameInTypeDescription
id*pathstring

Responses: 200

curl -X POST "https://api.pushtifly.com/v1/campaigns/ID_ID/resume" \
  -H "Authorization: Bearer sk_test_YOUR_SECRET_KEY"