ApexPage represents a Visualforce page: its markup plus metadata for the page's identity, API version, request security, mobile-tab availability, and managed-package references. Pages can provide application interfaces, embedded content, or site entry, authentication, and error pages.
The page is not its controller or its reusable Visualforce components. Those remain separate assets. Controller bindings, page actions, expressions, and component rendering belong in the markup and referenced code, not in top-level ApexPage metadata settings.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName |
The page developer name and unique API identity. It must begin with a letter, contain only alphanumeric characters and underscores, contain no spaces or consecutive underscores, and not end with an underscore. It is distinct from the display label. |
content |
The Visualforce markup, inherited from MetadataWithContent, the base type for metadata that includes file content. The API transports this value as base64-encoded data; the source file itself contains markup, not base64 text. |
apiVersion |
Required. Stores the API version specified for the page. This is separate from the Metadata API version used to retrieve or deploy it. |
label |
Required. The page's display label, not its unique API identity. |
description |
A description of what the page does. |
availableInTouch |
A boolean indicating whether Visualforce tabs associated with the page can be used in the Salesforce mobile app. It does not enable mobile support for standard object tab overrides. |
confirmationTokenRequired |
A boolean indicating whether GET requests require a cross-site request forgery (CSRF) confirmation token. Changing it from false to true makes existing links without the token unable to open the page. |
packageVersions |
The installed managed-package versions referenced by this page. Each entry identifies the package namespace and its major and minor version through namespace, majorNumber, and minorNumber. This is not an inventory of every installed package. |
Behavior and Constraints
Request security can make a valid page link inaccessible. When confirmationTokenRequired changes from false to true, links to the page must include a CSRF confirmation token. An access failure after that change can originate in the incoming link, rather than the user's page permissions.
Mobile availability applies to Visualforce tabs, not standard object tab overrides. Setting availableInTouch to true allows associated Visualforce tabs to be used in the Salesforce mobile app. If a standard object tab is overridden with a Visualforce page, mobile displays the object's default page instead, even when this setting is enabled.
Creating a page and granting user access are separate concerns. Page Security and the ProfileApexPageAccess structure in Profile metadata provide page-access configuration. PermissionSet and MutingPermissionSet also contain page references. The page definition alone does not establish effective access for a particular user. The creator-only access scenario described below is a community report, not a universal default-access rule.
Page version context is local to the asset. The page's apiVersion is not the version of the Metadata API request. Likewise, packageVersions describes this page's managed-package references, not all packages installed in the org.
Deployment and Retrieval
Visualforce pages are stored in the pages folder within the corresponding package directory. The page source uses the .page suffix. The declarative example pairs SampleApexPage.page with SampleApexPage.page-meta.xml; together, the markup and accompanying metadata describe one page asset.
Use ApexPage as the metadata type in package.xml. It supports the wildcard member * for retrieving pages. This support belongs to ApexPage; do not substitute the wildcard behavior documented for its base type, MetadataWithContent.
When passing content through the API, clients encode the binary data as base64 before sending it and decode returned base64 data after receiving it. A SOAP client handles this conversion. This transport requirement does not mean that a .page source file should be saved as base64 text.
Metadata API creation, updates, and deletion identify the page by fullName, which must be supplied for those operations. Changing or supplying label does not replace that identity.
Controllers, extensions, reusable components, and resources referenced in the markup remain separate assets. Their presence and the referencing configuration determine the applicable dependencies; a possible relationship does not establish a mandatory deployment sequence.
Do not assume that pages generated during interactive site creation already exist in an API deployment destination. The reported CommunitiesLanding failure below required including the Visualforce page and its controller with the site deployment.
Relationships
Outgoing dependencies are embedded in page content and represented by filedata relationships, rather than top-level page settings. Incoming references explain where a page can affect applications, object configuration, sites, navigation, and access. A path such as CustomSite to ApexPage to its controller and resources applies only when the actual configuration and markup contain those references.
References
-
ApexClass:filedata, for controllers or extensions. -
ApexComponent:filedata, for reusable Visualforce components. -
ApexPage:filedata, for references to other pages. -
CustomField:filedata. -
CustomLabel:filedata. -
CustomObject:filedata. -
FieldSet:filedata. -
Flow:filedata. -
LightningMessageChannel:filedata. -
StaticResource:filedata.
Referenced By
-
ApexClass:filedata. -
ApexComponent:filedata. -
ApexPage:filedata. -
ApexTrigger:filedata. -
Community:communityFeedPage. -
CustomApplication:components,content,pageNamesToOpen. -
CustomApplicationComponent:visualforcePage. -
CustomObject:content,customHelpPage,page. -
WebLink:page. -
CustomPageWebLink:page. -
CustomSite:authorizationRequiredPage,bandwidthExceededPage,changePasswordPage,chatterAnswersForgotPasswordConfirmPage,chatterAnswersForgotPasswordPage,chatterAnswersHelpPage,chatterAnswersLoginPage,chatterAnswersRegistrationPage,fileNotFoundPage,forgotPasswordPage,genericErrorPage,inMaintenancePage,inactiveIndexPage,indexPage,myProfilePage,robotsTxtPage,selfRegPage,siteTemplate. -
CustomTab:content,page. -
Dashboard:page. -
FlexiPage:value. -
HomePageComponent:page. -
LiveChatButton:chatPage,postChatPage,preChatFormPage. -
Layout:page. -
MutingPermissionSet:apexPage. -
PermissionSet:apexPage. -
Profile: page-access configuration through theProfileApexPageAccessstructure. -
QuickAction:page.
Documentation Inconsistencies
The ApexPage reference describes the accompanying metadata filename as PageName-meta.xml, but its sample uses SampleApexPage.page-meta.xml. The sample shows the paired-file convention with .page-meta.xml.
The same reference marks apiVersion as required, while its declarative metadata sample omits that element. Do not treat the sample's omission as making the field optional.
Reported Issues
-
A newly created page may need separate access configuration. In a 2015 Metadata API creation report, the page was accessible only through the creator's System Administrator profile. The answer directed the administrator to Page Security or
ProfileApexPageAccessin Profile metadata. This was a reported creation scenario, not a universal rule for newly created pages. Page access after API creation. -
A site deployment can fail because its landing page is absent. In a 2024 report, deploying
CustomSitewithindexPageset toCommunitiesLandingfailed because the destination had no matching page. Interactive site creation generated the page and related components, while the API deployment required including the Visualforce page and its controller. This does not establish a general automatic-creation rule for pages. Missing CommunitiesLanding during deployment. -
Initialization assumptions can cause rendering failures that are unrelated to page metadata. In a 2014 discussion, getters ran before an
apex:pageaction and encountered uninitialized data under one user-language setting. The answer treated action-versus-expression evaluation order as unspecified and recommended lazy initialization, meaning initialization when the value is first needed. The report does not establish a general language-specific execution rule. Page action and getter evaluation. -
Queued page messages may never appear if the controller fails before rendering completes. In a 2017 report, an unhandled null dereference prevented messages added through
ApexPagesfrom appearing. A message in a debug log therefore did not prove that the response rendered it. The diagnosed cause was controller code, not a missing message component, a refresh problem, or anApexPagemetadata flag. Messages hidden by a controller exception. -
A message added during getter evaluation may miss the initial message rendering. In a 2022 discussion involving a select-options getter, the answer reported that a message added in the getter did not appear on initial load, while a constructor-added message and a button-action message with explicit message-component rerendering did appear. This is a reported rendering scenario, not an
ApexPagesetting. Messages added from a getter.
Common Questions
How do I retrieve all Visualforce pages with Metadata API?
Use ApexPage as the type name in package.xml and * as its member. Pages use .page source files in the pages directory, with accompanying metadata files.
Why is my Visualforce page inaccessible after enabling confirmationTokenRequired?
Changing confirmationTokenRequired from false to true requires links to include a CSRF confirmation token. Check the incoming link as well as page-access configuration.
Does availableInTouch enable a Visualforce standard object tab override in mobile?
No. It controls availability of associated Visualforce tabs. The Salesforce mobile app displays the default object page instead of a Visualforce standard object tab override, even when availableInTouch is true.
Does deploying an ApexPage give every user access to it?
The page definition alone does not establish effective user access. Page Security, Profile page-access configuration, and applicable permission-set configuration must be considered separately.
Why does my site deployment say CommunitiesLanding is missing?
The destination may not contain the page referenced by CustomSite.indexPage. In the reported case, interactive site creation generated the page, but API deployment required including the Visualforce page and its controller.