> For the complete documentation index, see [llms.txt](https://docs.flxbl.io/flxbl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flxbl.io/flxbl/sfp/faqs/common-questions/api-version.md).

# API Version

When encountering an issue where the `build` command builds an artifact that is incompatible with the target Salesforce environment, it's important to understand the role of the `sourceApiVersion` in the `sfdx-project.json` file and other factors that might influence the API version used during the build.

### Understanding the sourceApiVersion

The `sourceApiVersion` in your `sfdx-project.json` file is intended to specify the default API version for your Salesforce DX project. This version is used when creating scratch orgs and can influence the API version used for package builds. However, if your build results in a package versioned at 59.0 while your `sourceApiVersion` is set to v55.0, this need to be resolved

### Resolving the Version Mismatch

To resolve the version mismatch and ensure your package is built with a compatible API version for your sandbox, consider the following steps:

* **Review and Align Configuration Files**: Double-check your `sfdx-project.json` and any other configuration files involved in the build process. Make sure the `sourceApiVersion` is consistently set to the intended version across all configurations.
* **Check CLI and Plugin Versions**: Ensure `sfp` cli is up-to-date. Review the documentation or release notes for these tools to understand their behavior regarding API version selection.
* **Specify API Version in Build Command**: If possible, use command-line options to explicitly specify the API version when issuing the build command. For example, some CLI commands allow you to set the API version directly as an argument.

By understanding the factors that influence the API version used during the package build process and taking proactive steps to align your project's configuration with your target environment, you can avoid version compatibility issues and ensure smooth deployments.

\\


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.flxbl.io/flxbl/sfp/faqs/common-questions/api-version.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
