I am new in the Metadata APIs of Salesforce world, but they look interesting.

I want to know if I can use Metadata APIs or basically create custom objects / fields etc. on any org without using SOAP based approach, as I want to create a generic solution.

I already saw this great library by the great Andrew Fawcett (github - afawcett)


but wanted to know if there is a way which can help me generate a generic way to create metadata without importing anything in my org.

Thanks Ray

  • can u add some context on your use case where you want Metadata API access.. did you try to see if your work can be done with Apex + any other platform feature and then decided Metadata API is the only way ? Jun 3, 2015 at 3:27
  • I would like to create a custom code base which when integrated with process builder or any custom page can give admins provision to create Custom Objects or fields in a custom object dynamically. I assume this is only possible using Metadata api
    – SEuser
    Jun 3, 2015 at 3:36

2 Answers 2


I believe it would have to be a web-service based approach. As far as I know, there aren't native APEX methods for adding new custom objects or fields.


You can create some sorts of metadata using the Tooling Rest Api. Custom fields are supported this way, as are record types, workflow rules, and a number of other setup types. Unfortunately, you can't yet create custom objects this way yet (custom objects support the rest method GET, with either an ID or a query, but they don't support POST), so you need to use a SOAP-based solution if you need to make entirely new objects (rather than just adding fields to existing ones).

You must log in to answer this question.

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