Developing APIs
Developing APIs in AL for Business Central: API page and API query types, building custom REST/OData v4 endpoints, Connect app basics, filters, request tips, troubleshooting, performance and web service telemetry. It answers how to build, call, tune and diagnose web service APIs.
Path: Development > Programming in the AL language > Developing APIs · tier official · system development · narrative reviewed (checked by Opus)
Overview
This section covers building and consuming REST APIs in Business Central with AL. API pages give versioned, OData v4 enabled, webhook-capable endpoints with create, read, update and delete operations. API queries join data from several sources and expose it as read-only endpoints. Both use properties such as APIPublisher, APIGroup and APIVersion.
Start with “Develop APIs with Pages and Queries” for the overview, then “API page type” and “API query type” for the object types. “Developing a custom API” is a walkthrough for API pages: key fields, SystemId, entity names, relationships through parts and navigation properties, and moving away from the deprecated ODataEDMType complex types. “Get started developing Connect apps” covers authentication (Microsoft Entra ID with OAuth 2.0, or basic authentication with a web service access key) and exploring endpoints with Insomnia.
The remaining pages support day-to-day work with the APIs: tips on GET requests, Accept-Language, OData $batch and the Data-Access-Intent header; filter expressions; error and status code troubleshooting; performance patterns and anti-patterns; and web service telemetry for SOAP, OData and API traffic.
Key points
- API page type creates versioned, OData v4 enabled REST endpoints with webhook support and CRUD; InsertAllowed and ModifyAllowed properties control writes.
- API query type joins data from different sources and exposes it read-only, using APIPublisher, APIGroup and version properties.
- The custom API walkthrough covers API v2.0 pages, ODataKeyFields, SystemId, EntityName, EntityCaption and EntitySetCaption, and parts and navigation properties for relationships.
- Connect apps make point-to-point connections to partner solutions over REST APIs; authentication uses Microsoft Entra ID with OAuth 2.0 or basic authentication with a web service access key. The getting started guide refers to 2022 release wave 1.
- API tips cover GET requests, Accept-Language for localization, transactional OData $batch with Isolation: snapshot, and the Data-Access-Intent header with ReadOnly. The tips page refers to 2020 release wave 2 (version 17.1).
- Filtering follows Microsoft REST API guidelines, with property-based and range-based filter expressions.
- Troubleshooting maps AL runtime exceptions to OData error codes and HTTP status codes, using the AL debugger and telemetry.
- Performance depends on both the server endpoint and the consumer; guidance lists patterns, anti-patterns and Power BI considerations.
Learn pages
- API page type: Description of the API page type used for exposing web service endpoints.
- API query type: Description of the API query type used for exposing and viewing web service endpoints.
- In the observatory: Query 20000 “APIV1 - Customer Sales”
- Develop APIs with Pages and Queries: Learn how to develop custom Business Central APIs with API pages and API queries, and find guidance for performance and troubleshooting.
- Developing a custom API: Learn how to develop a custom API page by using an AL extension and accessing it to retrieve responses and make updates through the API.
- Get started developing Connect apps for Dynamics 365 Business Central: Learn how to develop a Connect app for Business Central, including setting up Microsoft Entra authentication and exploring REST APIs with Insomnia.
- Tips for working with the APIs: Provides some tips about working with Business Central API.
- Troubleshooting REST API/OData calls: Learn about how to troubleshoot Business Central web service errors of types REST API or OData.
- Using filters with API/OData calls: Learn how to use filters with API calls to get targeted information in return.
- Web Service Performance (OData, API, and SOAP): Learn about how performance of Business Central web services (OData, API, and SOAP)
- Web Service Telemetry in Business Central: Monitor Business Central web service requests with telemetry to analyze endpoint usage, HTTP failures, access key authentication, and publishing errors.
Videos, posts and code changes
Linked by a Haiku matcher with a grounding quote from the item’s summary (link/topics.ts); machine-generated.
- #10130 [ExpenseAgent] Expose VatSpecifications on Expense API Page (code change): “The Expense API page now exposes VAT specifications through a new part”
- #11701 [MCP] Hide codeunit APIs from Available APIs dropdown (AB#650771) (code change): “Codeunit API options are hidden from the MCP Configuration Available APIs dropdown”
- #13554 Add procedures to import configuration packages and manage table operations in Fabric API (code change): “The Fabric API now supports resetting and removing tables”
- #13622 [Main]- Edit in Excel insert fails on Price List Lines (Page 7001) — Unit of Measure Code validated before Product No. is set causing NavTestFieldException on Price Asset (Table 7003) (code change): “Edit in Excel inserts to Price List Lines now validate against the current row values”
- #13824 Implement namespace normalization for Fabric Data and Logging in setup pages and platform management (code change): “Fabric namespace fields on the setup pages and API now convert entered values to lowercase”
- #9725 [Master] - Slice 626127: [Excise Tax][VENDOR] Multiple Excise Taxes per Item (code change): “Item Excise Tax API page (7417)”
- #156 18 AL/BC patterns: style, data-modeling, web-services, appsource, breaking-changes, performance, testing (code change): “2 web-services articles: keep consumer-provided key fields editable on insert”
- BC Friday Tips #66 API v2 app (community post): “The app holds the standard API V2 objects used by Business Central”
Source: Microsoft Learn (CC BY 4.0). Descriptions are Learn’s own.
What Learn documents here 8 of 10 Learn pages
- learnAPI page type2026-09-21
- learnAPI query type2026-09-21
- learnDevelop APIs with Pages and Queries2026-10-08
- learnDeveloping a custom API2024-11-28
- learnGet started developing Connect apps for Dynamics 365 Business Central2026-06-19
- learnTips for working with the APIs2026-09-22
- learnTroubleshooting REST API/OData calls2024-02-06
- learnUsing filters with API/OData calls2026-03-23