+ Start a Discussion
Developer BaseDeveloper Base 

Why do we have API versions and when is API version of an org updated?

Why do we have API versions and when is API version of an org updated?
AbhishekAbhishek (Salesforce Developers) 
Every time Salesforce releases a new application version, its API version is updated as well. It tells the version of the developed code. API versioning plays an important role while developing a code for an application. If Apex class versioning in developer and sandbox are not the same then it will through an error "Mismatch API versions".

Adding some more points -

A key principle to understand is that whilst SFDC may release version 28 of the API, the deployment logic associated with version 27 is still available for use as long as you force the API to use version 27. In Eclipse, using the Force.com IDE the version of the API being used is specified in the ./src/package.XML file. Open it in a text editor scroll to the bottom and you will find a line similar to:

<Version>28.0</Version>

It is important to note that your version of Eclipse may not be able to deploy MetaData files with an API version that is higher than the one supported by your Force.com IDE plug-in. So if you are using Eclipse with Force.com IDE version 27, you may not be able to deploy MetaData files with API version 28. The latest version info on the Force.com IDE and how to upgrade can be found here.
This concept may lead to utter confusion and numerous errors if the teams are not consistent with which API version they are using.

Let’s look at an example:
  •   Mary is an Apex developer. She’s been using Eclipse for about 6 months and the Force.com IDE API version she is using in Eclipse (package.xml) is version 27.
  • Bob joins the team – installs Eclipse, installs the force.com IDE and refreshes his environment from a recently released SFDC org which is running Summer 2013. His package.xml file will therefore contain API version 28.
  • Mary and Bob are working on the same project and share the same Git Repo. Mary is working on an Apex Trigger: Account_Update whilst Bob is working on a trigger Contact_Update

============================================

You have to manually update the API Version for your ORG.

To change your class's API version use Setup | Develop | Apex Classes and hit Edit next to your class (see below). Next, click the Version settings tab and use the picker to choose the desired Salesforce.com API as per below. Note – Changing API versions like this can only be done in a sandbox or developer org

https://help.salesforce.com/articleView?id=000334996&type=1&mode=1

For reference, you have to check the below,
https://www.asagarwal.com/how-to-find-out-the-edition-and-release-of-a-salesforce-instance/



Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks.
 
Malika Pathak 9Malika Pathak 9
Hi,

What Api version means?
Basically, It tells the version of the developed code . API versioning plays a important role while developing a code for an application .
If Apex class versioning in developer and sandbox are not same then it will through an error "Mismatch API versions".

Why we need Api versioning?
Versioning helps you iterate faster when the needed changes are identified. Change in an API is inevitable as your knowledge and experience of a system improve. 
Managing the impact of this change can be quite a challenge when it threatens to break existing client integration.

When Api version updated?
Whenever Salesforce releases a new application version,Salesforce internally update the api version and it totally depends on salesforce.

Kindly mark this as best answer, If you find this answer helpful.