function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sami CohenSami Cohen 

Insert Multiple records with Rest API

Hi,

 

Can we insert multiple records using the Rest API?

 

thanks. 

Navatar_DbSupNavatar_DbSup

Hi,

 

You can't insert multiple rows in a single call in the rest api, you need to use the bulk api.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

Sami CohenSami Cohen

Hi,

 

Thank you for your response. I knew the bulk API, but I just need to enter 2 or 3 records in a single call, and I need to get the result immediatly.

 

Thanks again.

NidsNids

Navatar,

 

I am also looking for some ways to insert multiple(5-10) records in sfdc object in single call through apex rest .

is it possible???

Thanks in advance.

Justin ForrestJustin Forrest
Hi, can someone from the developer team please let us know why this is not possible through the REST interface? The same functionality exists in the SOAP interface, but it is a pain to work with as every time an object is updated we have to generate and download the WSDL again before we can make updates to our programs.

Thanks.
Guy Farrer FisherGuy Farrer Fisher
You can insert multiple records with the REST API with composite request: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_composite_junction_object.htm#topic-title 
Guy Farrer FisherGuy Farrer Fisher
Or you can use the batch resource: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_composite_batch.htm#topic-title
Guy Farrer FisherGuy Farrer Fisher
Also the tree resource: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_composite_sobject_tree_flat.htm?search_text=multiple