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

creating a case via REST API

Hello All,

I am planning to integrate Salesforce to an email management system(EMS). I wanted to create the case with in salesforce for any email received into EMS or any outbound email. What would be the recommended approach to do this integration? Is there any REST/SOAP API available to create a case in SalesForce? Is there any other method to do this integration?


There are both REST and SOAP api's available that can create cases. see

James BrunskillJames Brunskill
Does anyone know if some example code I could look at that uses the REST api to create a new salesforce case?

Struggling to follow the documentation!

I've found this example for creating a 'record' is this what I'd need to do?
If so, Where do I find the correct json format for the case data?

I've also found this on the SOAP api page:
Is creating a case only available via SOAP?

It feels like this must be a very common use case, I would have expected to find some example code somewhere, maybe google is just failing me because case is such a common english word.
Alan deLespinasseAlan deLespinasse
I found it! Salesforce has an API Explorer that is in "developer preview". There's a link at the top of the main developer docs page (, but I hadn't noticed it because it blends in with the page header material; it doesn't look like an actual part of the documentation. Also the link doesn't even take you to the API Explorer itself, but to a page with a couple other cryptically-named links, one of which takes you to the right place. I haven't seen it mentioned anywhere else. I only found it when I thought to Google "Salesforce API explorer".

Here are the docs for actually creating a new Case:

I'm new to Salesforce and REALLY UNHAPPY with the documentation so far. This stuff should be simple for an experienced developer.
James BrunskillJames Brunskill
Thanks Alan, That looks like that link makes things a lot clearer. Totally agree with your comment that the docs need to be made a lot more approachable for new Salesforce Developers!
Colin KenworthyColin Kenworthy
Thanks Alan, I've not heard of  the API Explorer before, it makes it much easier to set up the requests.  I was using Workbench before.