Salesforce Streaming API documentation gives the examples of creating PushTopics through the developer console by running some APEX code. Is there a way to create PushTopics programmatically using REST API? If yes, then how? If no, then does it mean that I will have to upload this APEX for each sobject in the salesforce account?

2 Answers 2


Yes, you can create a PushTopic via the REST API.

Based on the Create a Record example and PushTopic:

curl https://na1.salesforce.com/services/data/v32.0/sobjects/PushTopic/ 
    -H "Authorization: Bearer token -H "Content-Type: application/json" 
    -d "@newpushtopic.json"

Request Body newpushtopic.json

    "Name" : "Account",
    "Query" : "SELECT Id FROM Account",
    "ApiVersion" : 32.0,
    "NotifyForOperationCreate" : true,
    "NotifyForOperationUpdate" : true,
    "NotifyForOperationUndelete" : true,
    "NotifyForOperationDelete" : true,
    "NotifyForFields" : "All",

is their any specific requirement of implementing Pushtopic code using REST api ?

If you just don't want to copy paste code every time in developer console for pushtopic creation. make use of an apex class and invoke that class from a command button from your desired location.

  • When I deploy my code to a target org, the pushtopics needs to be created for all objects. Hence the question.
    – auny
    Sep 9, 2014 at 11:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .