Mastering Business Central API for App Management
This post provides practical PowerShell examples for automating extension management in Business Central using the Administration API, including deploying .app files, monitoring installation progress, handling failures, and uninstalling extensions.

post Aardvark Labs
"To uninstall an extension, we first check whether any dependencies must be removed."
Key points
- Get a bearer token via the client credentials flow and reuse the header for every Administration API call
- Install a .app through the pteInstall endpoint with a multipart form request carrying the file plus deploymentSchedule, syncMode, languageId, acceptIsvEula and dependency options; the upload is limited to 50 MB
- Poll the app operations endpoint to track the deployment until it reports succeeded, failed or canceled, with failures returning an error message
- Before uninstalling, call uninstallRequirements; then post to the uninstall endpoint with update window, dependents and delete-data settings and poll until done
Quotes
- “To uninstall an extension, we first check whether any dependencies must be removed.” (Checking dependencies before uninstall prevents errors and ensures safe removal of extensions)
Context
- Features: Extension installation, Extension uninstallation, App deployment scheduling, Dependency checking, Operation monitoring, Multipart file upload, Environment management
Source: Aardvark Labs, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.