Can I have a public APEX REST API e.g. APEX REST api that is accessible without authentication?

1 Answer 1


Yes you can. You will need to configure a public site and make the webservice available through it. There is an excellent tip on the developerforce blogs explaining it in more detail.

I implemented this a few months ago and ran into some issues, but did get it running :). The biggest of which is that your request must have the proper Content-Type Salesforce restful webservices reject x-www-form-urlencoded and refactoring the legacy system was a bit of a problem.

  • which content-type should I use if I want to get back a JSON response?
    – Dedo
    Nov 23, 2012 at 8:42
  • 3
    You will get a JSON response back by default. If necessary, you can force the issue via the Accept: application/json HTTP header or by appending .json to the URL.
    – metadaddy
    Nov 26, 2012 at 19:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.