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
| Field | Type | Description |
|---|---|---|
appId | string | |
name* | string | |
notification* | object | |
notification.contentType | "alert" | "data_only" | "silent" | |
notification.content | object | Per language, e.g. { en: { title, subtitle, body } } |
notification.variables | object | They replace {{name}} in the text |
notification.data | object | |
notification.deepLink | string | max. 500 characters |
notification.badge | integer | |
notification.sound | string | default or a sound registered in the app (2002 if it doesn't exist) |
notification.ttlSeconds | integer | 0–2419200 |
notification.priority | "high" | "normal" | |
notification.android | object | |
notification.ios | object | |
notification.appId | string | |
notification.target* | object | |
notification.platforms | "android" | "ios" | "web"[] | |
notification.category | "transactional" | "marketing" | |
notification.schedule | object | now; 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.validateOnly | boolean | |
notification.templateId | string | Template: what you send in the request takes priority; its variables are required (2001) |
notification.media | object | Only 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.largeIcon | object | Image (Android, via SDK) |
notification.actions | object[] | max. 3 items |
recurrence* | object | |
recurrence.freq* | "daily" | "weekly" | "monthly" | |
recurrence.interval | integer | 1–52 |
recurrence.weekdays | "mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun"[] | |
recurrence.monthDay | integer | If the month doesn't have that day, the last day · 1–31 |
recurrence.monthWeek | object | |
recurrence.time* | string | |
recurrence.timezone | string | |
recurrence.startDate | string | |
recurrence.endDate | string | |
recurrence.count | integer | 1–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
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string |
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
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string |
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
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string |
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
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string |
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
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string |
Responses: 200
curl -X POST "https://api.pushtifly.com/v1/campaigns/ID_ID/resume" \
-H "Authorization: Bearer sk_test_YOUR_SECRET_KEY"