Every piece of customization, integration, and automation in Salesforce relies on a fundamental concept: the API name. Unlike what users see on the screen—the label—the API name is the technical backbone that developers and administrators use in Apex, flows, reports, SOQL queries, and integrations. Whether you are writing a trigger, building a complex data model, or connecting Salesforce to an external system, knowing how to find a field or object's API name is a critical skill. It is the universal language that the system understands, independent of user-facing display names or translations.
One of the most straightforward places to find API names is directly within the Salesforce Setup menu. You can navigate to Object Manager to search for any object or field and see all the details. This is the primary method for getting the exact technical identifier for standard and custom elements in your org.
Finding the API Name of an Object in Salesforce
To discover the API name for an object, you can follow these steps. First, log in to your Salesforce org and access the Setup menu by clicking on the gear icon in the top right corner. From there, use the Quick Find box and type "Object Manager." Click on Object Manager that appears in the results. Once you are in the Object Manager, select the object you are interested in from the list. For example, if you want the API name for the standard Account object, click on "Account." On the left-hand side of the object's detail page, you will see a section labeled "Details." Here, you will find the "API Name" field, which displays the technical name for that object. For standard objects, the API name is usually the same as the object name (e.g., "Account"). For custom objects, the API name will always end with "__c" (e.g., "My_Custom_Object__c").

Finding the API Name of a Field in Salesforce
The process for finding a field's API name is very similar to finding an object's API name. After navigating to the Object Manager and selecting the desired object, look for the "Fields & Relationships" section on the left-hand sidebar. Click on it to see a list of all fields associated with that object. You can scroll through the list or use the search bar to find a specific field. Once you locate the field, click on its name to open the field's detail page. On this page, you will see a section labeled "Field Information." Within this section, you will find the "Field Name" entry, which is the API name for that field. Just like with objects, custom fields will have an API name that ends with "__c". For example, a custom text field might have an API name like "Customer_Notes__c".
Using Developer Console to Find API Names
For developers who prefer a more technical approach, the Salesforce Developer Console is a powerful tool. You can open it from the gear icon menu by selecting "Developer Console." Once the console is open, navigate to "File" -> "Open" -> "Objects" or "File" -> "Open" -> "Fields." This will bring up a search window where you can type the name of the object or field you are looking for. When you select an item from the search results, the console will display its details, including the API name. This method is particularly useful when you are already working within the console for other development tasks and need to quickly look up an API name without leaving your workflow.
Using SOQL to Discover API Names
Another effective method, especially for those comfortable with Salesforce's query language, is to use SOQL (Salesforce Object Query Language). You can execute a query in the Developer Console's Query Editor or through any API tool like Workbench. To find all fields for an object, you can use the "FIELDS(ALL)" function in a SOQL query. For example, a query like "SELECT FIELDS(ALL) FROM Account LIMIT 1" will return all fields for the Account object. The column headers in the result set will be the API names of the fields. This is a dynamic and efficient way to get a complete list of API names for any object, including custom fields that you might not be aware of.

Using Workbench to Find API Names
Workbench is a powerful, free tool provided by Salesforce for developers and administrators. It can be accessed at workbench.developerforce.com. After logging in with your Salesforce credentials, you can navigate to "Info" -> "Standard & Custom Objects." This will present you with a list of all objects in your org. Selecting an object will show you its details, including its API name and a list of all its fields with their respective API names. Workbench is an excellent resource because it provides a comprehensive, read-only view of your org's metadata, making it a safe and reliable way to explore your data model.
Important Considerations and Best Practices
When working with API names, there are a few key points to remember. First, API names are case-insensitive in most contexts, such as SOQL queries and Apex code. However, it is a best practice to be consistent with your casing for readability. Second, never hard-code API names in your Apex code if you can avoid it. Instead, use dynamic Apex or describe calls to retrieve API names at runtime. This makes your code more resilient to changes in the org, such as a field being renamed. Finally, always be mindful of the namespace prefix for managed packages. If you are working with fields or objects from a managed package, their API names will include the namespace prefix (e.g., "namespace__Field_Name__c").
Mastering the ability to find API names is a foundational skill for anyone working with Salesforce. It bridges the gap between the declarative, point-and-click administration and the programmatic, code-based development. By using the methods outlined above—whether through the Setup menu, Developer Console, SOQL, or Workbench—you can quickly and accurately identify the technical names for any object or field in your org. This knowledge empowers you to build more robust integrations, write more effective Apex code, and ultimately, leverage the full power of the Salesforce platform.























