{"title":"API page type","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/devenv-api-pagetype/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-api-pagetype, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-api-pagetype","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Description of the API page type used for exposing web service endpoints.","date":"2026-09-21","meta":{"topic":"concept-article"},"outline":[{"level":1,"title":"API page type","slug":"api-page-type","at":0,"chars":4355},{"level":2,"title":"Naming conventions","slug":"naming-conventions","at":795,"chars":729},{"level":2,"title":"Create, read, update, and delete operations","slug":"create-read-update-and-delete-operations","at":1524,"chars":554},{"level":2,"title":"Describe the API for MCP tools","slug":"describe-the-api-for-mcp-tools","at":2078,"chars":815},{"level":2,"title":"Example of the API page type","slug":"example-of-the-api-page-type","at":2893,"chars":940},{"level":2,"title":"Related information","slug":"related-information","at":3833,"chars":522}],"text":"# API page type\nPages of the type API are used to create versioned, webhook-supported, OData v4 enabled REST web services. This type of page can't be displayed in the user interface, but is intended for building reliable integration services. When creating this page type, you must specify many properties that provide information for the web service endpoint. Use the snippet `tpage - Page of type API` to get the right template and the list of these properties automatically filled in. This page type can't be extended by creating a page extension object. Instead, you must create a new API by adding a page object.\nPages of the type API can be used to develop a custom API. See devenv-develop-custom-api.\n> NOTE\n> Extending API pages and queries isn't currently possible in Business Central.\n## Naming conventions\nFor the API page type, the following naming conventions exist:\n camelCase for naming attributes, tables, and APIPublisher, APIGroup, EntityName, and EntitySetName.\n Alphanumeric characters allowed (A-Z+a-z+0-9) in above elements.\n APIVersion follows the pattern vX.Y or beta.\nAt design time, the compiler shows warnings on casing violations and errors on naming violations. Once an API page is deployed, the corresponding $metadata<devenv-connect-apps-tips> is exposed on the endpoint of the page.\n> TIP\n> Use Ctrl+Space to trigger IntelliSense and get assistance on code completion, parameter info, quick info, and member lists. For more information about snippets, see Syntax and snippets<devenv-syntax>.\n## Create, read, update, and delete operations\nAPI pages support create, read, update, and delete operations. If you want to disallow, create, update, and delete operations, you can use the properties/devenv-insertallowed-property, properties/devenv-modifyallowed-property, and properties/devenv-deleteallowed-property properties respectively.\nIf you only want your API to expose committed data, you can add an OnOpenPageTrigger like this:\n```al\n    trigger OnOpenPage()\n    begin\n        Rec.ReadIsolation := IsolationLevel::ReadCommitted;\n    end;\n```\n## Describe the API for MCP tools\nWhen an API page or API query is exposed as a tool through the Business Central MCP server, the server uses metadata from the API object to generate the tool description.\nThe MCP server determines the tool description in the following order:\n1. The properties/devenv-abouttext-property property.\n1. If AboutText isn't specified, the server uses the properties/devenv-entitysetcaption-property property.\n1. If EntitySetCaption isn't available, the server uses a camel-cased version of the properties/devenv-entityname-property property.\nProvide meaningful values for these properties to help MCP clients and agents understand and select the appropriate tools. Learn more about the Business Central MCP server in Model Context Protocol (MCP) in Business Central<../ai/mcp-overview>.\n## Example of the API page type\nThe following page example publishes an API available at:\n`../contoso/app1/v2.0/companies({id})/customers`. The APIVersion can be specified as one version, or a list of versions, if the API is supported through multiple versions.\n```al\npage 50120 MyCustomerApi\n{\n    PageType = API;\n    Caption = 'My Customer API';\n    APIPublisher = 'contoso';\n    APIGroup = 'app1';\n    APIVersion = 'v2.0', 'v1.0';\n    EntityName = 'customer';\n    EntitySetName = 'customers';\n    SourceTable = Customer;\n    DelayedInsert = true;\n\n    layout\n    {\n        area(Content)\n        {\n            repeater(GroupName)\n            {\n                field(id; Rec.SystemId)\n                {\n                    Caption = 'Id';\n                    Editable = false;\n                }\n                field(name; Name)\n                {\n                    Caption = 'Name';\n                }\n            }\n        }\n    }\n}\n```\n## Related information\nDevelop APIs with pages and queries<devenv-api>\nAL development environment<devenv-reference-overview>\nAPI query type<devenv-api-querytype>\nWalkthrough: developing a custom API<devenv-develop-custom-api>\nPage extension object<devenv-page-ext-object>\nproperties/devenv-apipublisher-page-property\nproperties/devenv-apigroup-page-property\nproperties/devenv-apiversion-page-property\nproperties/devenv-entityname-property\nproperties/devenv-entitysetname-property\nDeveloping extensions<devenv-dev-overview>"}