Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full API Version entry
How-to guide

How to manage API Versions in a Salesforce codebase

Version hygiene is a quiet, ongoing discipline. Done well it pays off invisibly; ignored, it surfaces at the worst possible moment as a forced upgrade or a deprecation outage.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated May 19, 2026

Version hygiene is a quiet, ongoing discipline. Done well it pays off invisibly; ignored, it surfaces at the worst possible moment as a forced upgrade or a deprecation outage.

  1. Inventory current API versions

    Query the org's ApexClass and ApexTrigger metadata. Inspect REST callout code and Named Credentials for the version segment. Build a table of which artifacts run at which version.

  2. Pick a target version

    Choose a target API version for the next quarter. Most teams target N-1 or N-2 (one or two releases behind current). Going to N requires testing every new release's behaviour changes.

  3. Upgrade Apex classes incrementally

    Edit metadata to bump apiVersion. Run the test suite per class. Investigate any regressions against the release notes for that version. Promote in stages.

  4. Update REST and SOAP callers

    Update the version segment in callout code and refresh WSDLs for SOAP integrations. Document the new contract for downstream consumers.

  5. Monitor for deprecation announcements

    Subscribe to release notes. Track which API versions are scheduled for retirement and plan the upgrade well before the cutover date.

Gotchas
  • apiVersion changes can shift SOQL behaviour, governor limits, and method signatures silently. Test the regression suite after every bump.
  • Mixing versions across one project makes triage harder. Pick a target version per release and apply it consistently.
  • Staying too far back to avoid one deprecation accumulates years of change into a single forced upgrade.
  • Managed package classes carry their own apiVersion. Subscribers cannot edit it; upgrading the package is the only way.

See the full API Version entry

API Version includes the definition, worked example, deep dive, related terms, and a quiz.