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

How to create a new remote site setting through apex code ?

I get the endpoint where the request has to be sent at runtime. Later i want to send an HTTP post request to this endpoint, so I have to create a remote site setting too at runtime.

Is there a way to create a remote site setting through apex code?





Hi Rupali,


I think you are correct, unfortunately there isnt. You have to add it for once.





It is possible to create remote site through apex code. If u still need the solution please let me know.

Rakesh ERakesh E

Hi Aforank,


i have  a requirement to create "Remote Site Settings" programatically. could you please provide assistance on how to do that.

i am looking into the MetaData API but unable to find out a way.


please requesting you to tell me the solution which you have.