The following documentation helps you to use Truepush APIs

To start using Truepush APIs. Find the authorisation token in your settings(Your project -> settings -> Authentication Token).

Alternatively, you can find it in all projects page too (click 9 dots button on your top right). You can use the APIs by hitting our calls to api.truepush.com

1. Create Campaign
Post ​api/v1​/createCampaign

Use this API to Create a new Campaign in your project.

Request
TypeParamsValues
HEADauthorizationstring
HEADcontent-typeapplication/json
POSTtitle
message
link
scheduled
timings
campaignExpiryTime
buttons
tags
Segment
userInteraction
image
icon
string
string
String
boolean(true/false)(optional)
object(optional)
number(optional)
list(optional)
list(optional)
segmentId(optional)
boolean(optional)(true/false)
URL(optional)
URL(optional)
 If scheduled true"timings":
 If campaignExpiryTimenumber(that takes hours)campaignExpiryTime: 2
 If campaignExpiryTimenumber(that takes hours)campaignExpiryTime: 2
 If buttons“buttons”: [
 If tags“tags”: [“tag1”, “tag2”, “tag3”]
 If segment“segment”: “5f8d407ad11b5a2c2c524f63”
Curl Request:

curl -X POST \
--include \
--header "Authorization: YOUR-REST-API-TOKEN \
--header "Content-Type: application/json" \

-d '

https://api.truepush.com/api/v1/createCampaign

Responses
StatusResponse
200

204

400

401

429

500

2. Cancel Campaign
Put ​api/v1​/cancelCampaign/:id

Use this API to Cancel Campaign in your project.

Request
TypeParamsValues
HEADauthorizationstring
HEADcontent-typeapplication/json
GET:idcampaignId
Curl Request:

curl -X PUT \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \

https://api.truepush.com/api/v1/cancelCampaign/5fca2051f5dcf4f88078e23a

Responses
StatusResponse
200

204

401

429

500

3. Campaign Stats
GET ​api/v1​/campaignStats/:id

Use this API to see the stats of a particular campaign in your Project.

Request
TypeParamsValues
HEADauthorizationstring
HEADcontent-typeapplication/json
GET:idcampaignId
Curl Request:

curl -X GET \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \

https://api.truepush.com/api/v1/campaignStats/5fca2051f5dcf4f88078e23a

Responses
StatusResponse
200

204

401

429

500

4. List Segments
GET ​api/v1​/listSegment/:page

Use this API to get list of all segments in ypur project.

Request
TypeParamsValues
HEADauthorizationstring
HEADauthorizationstring
GET:pagepageNumber
Curl Request:

curl -X GET \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \

https://api.truepush.com/api/v1/listSegment/1

Responses
StatusResponse
200

204

401

429

500

5. Delete Segment
DELETE ​api/v1​/deleteSegment/:id

Use this API to delete the segments from your project

Request
TypeParamsValues
HEADauthorizationstring
HEADcontent-typeapplication/json
DELETE:idsegmentId
Curl Request:

curl -X DELETE \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \

https://api.truepush.com/api/v1/deleteSegment/5f89365f51e2766113d29fd6

Responses
StatusResponse
200

204

401

429

500

6. Create Template
Post api/v1/createTemplate

Use this API to create a new Template in your Project.

Request
TypeParamsValues
HEADauthorizationstring
HEADcontent-typeapplication/json
POSTname
title
message
link
buttons
tags
userInteractionRequired
image
icon
string
string
string
String
list(optional)
list(optional)
boolean(optional)(true/false)
URL(optional)
URL(optional)
 If buttons“buttons”: [
 If tags“tags”: [“tag1”, “tag2”, “tag3”]
Curl Request:

curl -X POST \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \

--header "Content-Type: application/json" \ -d '

https://api.truepush.com/api/v1/createTemplate

Responses
StatusResponse
200

204

400

401

429

500

7. Delete Template
DELETE api/v1/deleteTemplate/:id

Use this API to Delete your existing templates from your Project.

Request
TypeParamsValues
HEADauthorizationstring
HEADcontent-typeapplication/json
DELETE:idtemplateId
Curl Request:

curl -X DELETE \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \

https://api.truepush.com/api/v1/deleteTemplate/5fb8d81b8deea45b89458df9

Responses
StatusResponse
200

204

401

429

500

8. List Template
GET api/v1/listTemplate/:page

Use this API to see the list of Templates in your Project.

Request
TypeParamsValues
HEADauthorizationstring
HEADcontent-typeapplication/json
GET:pagepageNUmber
Curl Request:

curl -X GET \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \

https://api.truepush.com/api/v1/listTemplate/1

Responses
StatusResponse
200

204

401

429

500

9.Create Trigger
Post api/v1/createTrigger/

Use this Campaign to a Create a new Trigger in your Project

Request
TypeParamsValues
HEADauthorizationstring
HEADcontent-typeapplication/json
POSTnamenote
segmentId
templateId
type
timings
string(Unique name)
string(optional)
string(segmentId)
string(templateId)
string(once/repeated/multiple) Object
 If type is once timingstimings :
 If type is multiple timingstimings:
 If type is multiple timingsIf sub_type is daily timings:
(or)
If sub_type id yearly timings:
Curl Request:

curl -X POST \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \

--header "Content-Type: application/json" \
-d '

https://api.truepush.com/api/v1/createTrigger

Responses
StatusResponse
200

204

400

401

429

500

10. Delete Trigger
DELETE api/v1/deleteTrigger/:id

Use this API to Delete Triggers from your project.

Request
TypeParamsValues
HEADauthorizationstring
HEADcontent-typeapplication/json
DELETE:idtriggerId
Curl Request:

curl -X DELETE \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \

https://api.truepush.com/api/v1/deleteTrigger/5fb2087c68e8e445158b7307

Responses
StatusResponse
200

204

401

429

500

11. List Trigger
GET api/v1/listTrigger/:page

Use this API to see the list of Triggers in your Project.

Request
TypeParamsValues
HEADauthorizationstring
HEADcontent-typeapplication/json
GET:pagepageNUmber
Curl Request:

curl -X GET \
--include \
--header "Authorization: YOUR-REST-API-TOKEN \

https://api.truepush.com/api/v1/listTrigger/1

Responses
StatusResponse
200

204

401

429

500

12. Change Trigger Status
PUT api/v1/triggerStatus/:id

Change this API to change the Trigger status from existing triggers in your project.

Request
TypeParamsValues
HEADauthorizationstring
HEADcontent-typeapplication/json
PUT:id
status
triggerId
string(active/inactive)
Curl Request:

curl -X PUT \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \

--header "Content-Type: application/json" \
-d '

https://api.truepush.com/api/v1/triggerStatus/5fae1887042f2bee7ef8aef9

Responses
StatusResponse
200

204

401

429

500

13. List Campaigns
GET api/v1/listCampaign/:page

Use this API to see the List of campaigns in your Project.

Request
TypeParamsValues
HEADauthorizationstring
HEADcontent-typeapplication/json
GET:id
:page
pageNUmber
Curl Request:

curl -X GET \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \

https://api.truepush.com/api/v1/listCampaign/1

Responses
StatusResponse
200

204

401

429

500