Profile

Represents a user profile. A profile defines a user’s permission to perform different functions within Salesforce.

In API version 29.0 and later, you can retrieve and deploy access settings for these managed components in profiles and permission sets:

  • Apex classes
  • Apps
  • Custom field permissions
  • Custom object permissions
  • Custom tab settings
  • External data sources
  • Record types
  • Visualforce pages

In API version 51.0 and later, you can retrieve and deploy access settings for login flows. For more information, see Managed Component Access in the Components in a Module section of Sample package.xml Manifest Files.

As of API version 50.0 and later, only users with correct permissions can view profile names other than their own if the Profile Filtering setting is enabled.

Profile names are also exposed when users with permissions to perform the following tasks take these actions:

  • Create a tab or record type with a wizard step that includes the assignment of tabs and record types to profiles.
  • Configure a login flow where viewing profile lists is required to make flow associations.
  • Set up delegated admins where looking up profiles is needed to identify assignable profiles.
  • Administer an org as a delegated customer admin.
  • Administer an org as a delegated admin to view and assign profiles of the delegated group.

This type extends Metadata and inherits its fields.

The file suffix is .profile. There’s one file for each profile, stored in the profiles folder in the corresponding package directory.

Profiles are available in API version 10.0 and later.

As of Summer ’20 and later, Customer Portal and Partner Portal users can’t access this type.

To view the following settings, assignments, and permissions for standard and custom objects in a specified profile, the View Setup and Configuration permission is required.

  • Client settings
  • Field permissions
  • Layout assignments
  • Object permissions
  • Permission dependencies
  • Permission set tab settings
  • Permission set group components
  • Record types
  • Type: ProfileAgentAccess[]
  • Required: No
  • Introduced: API version 63.0
  • Description: Indicates which agents are visible to users assigned to this profile.
  • Type: ProfileApplicationVisibility[]
  • Required: No
  • Description: Indicates which apps are visible to users assigned to this profile. In API version 29.0 and earlier, this field supports custom apps only. In API version 30.0 and later, this field supports both standard and custom apps.
  • Type: ProfileCategoryGroupVisibility[]
  • Required: No
  • Introduced: API version 41.0
  • Description: Indicates which data category groups are visible to users assigned to this profile.
  • Type: ProfileApexClassAccess[]
  • Required: No
  • Description: Indicates which top-level Apex classes have methods that users assigned to this profile can execute.
  • Type: boolean
  • Required: No
  • Introduced: API version 30.0
  • Description: Indicates whether the profile is a custom (true) or standard (false) profile.
  • Type: ProfileCustomMetadataTypeAccess[]
  • Required: No
  • Introduced: API version 47.0
  • Description: Indicates the custom metadata types that are read-accessible to a user assigned to this profile.
  • Type: ProfileCustomPermissions[]
  • Required: No
  • Introduced: API version 31.0
  • Description: Indicates which custom permissions are available to users assigned to this profile.
  • Type: ProfileCustomSettingAccess[]
  • Required: No
  • Introduced: API version 47.0
  • Description: Indicates the custom settings that are read-accessible to a user assigned to this profile.
  • Type: string
  • Required: No
  • Introduced: API version 30.0
  • Description: The profile description. Limit: 255 characters.
  • Type: ProfileExternalDataSourceAccess[]
  • Required: No
  • Introduced: API version 27.0
  • Description: Indicates which data sources with identity type of Per User are available to users assigned to this profile.
  • Type: ProfileFieldLevelSecurity[]
  • Required: No
  • Description: Indicates which fields are visible to a user assigned to this profile, and the kind of access available (editable or hidden). This field is available in API version 22.0 and earlier.
  • Type: ProfileFieldLevelSecurity[]
  • Required: No
  • Introduced: API version 23.0
  • Description: Indicates which fields are visible to a user assigned to this profile, and the kind of access available (editable or readable).
  • Type: ProfileFlowAccess[]
  • Required: No
  • Introduced: API version 47.0
  • Description: Indicates which flows can be accessed by a user assigned to this profile.
  • Type: string

  • Required: No

  • Description: The name can only contain characters, letters, and the underscore (_) character. The name must start with a letter, and can’t end with an underscore or contain two consecutive underscore characters.

    Inherited from the Metadata component, this field isn’t defined in the WSDL for this component. It must be specified when creating, updating, or deleting. See create() to see an example of this field specified for a call.

  • Type: LoginFlow[]
  • Required: No
  • Description: Indicates a business process that you direct users to before they access Salesforce.
  • Type: ProfileLoginHours
  • Required: No
  • Introduced: API version 25.0
  • Description: Indicates the hours within which a user with this profile can log in. If not specified, the profile doesn’t restrict a user’s login hours.
  • Type: ProfileLoginIpRange[]
  • Required: No
  • Introduced: API version 17.0
  • Description: The list of IP address ranges from which users with a particular profile can log in.
  • Type: ProfileObjectPermissions[]

  • Required: No

  • Description: Indicates which objects are accessible to a user assigned to this profile, and the kind of access available (create, read, edit, delete, and so on). In API version 28.0 and later, this field is only retrieved when allowRead is true.

    In API version 50.0 and later, editing standard objects on standard profiles is disabled.

  • Type: ProfileApexPageAccess[]
  • Required: No
  • Description: Indicates which Visualforce pages that users assigned to this profile can execute.
  • Type: ProfileActionOverride[]
  • Required: No
  • Version: This field is available in API versions 37.0 to 44.0.
  • Description: A list of the Lightning Experience Home page action overrides that are assigned to this profile. When a user logs in with a profile, a matching ProfileActionOverride assignment takes precedence over existing overrides for the Home tab specified in ActionOverride.
  • Type: ProfileRecordTypeVisibility[]
  • Required: No
  • Description: Indicates the visibility of record types for users assigned to this profile. In API version 29.0 and later, this field isn’t retrieved or deployed for inactive record types.
  • Type: ProfileServicePresenceStatusAccess[]
  • Required: No
  • Introduced: API version 64.0
  • Description: Indicates which Service presence statuses that the user assigned to this profile can execute.
  • Type: ProfileTabVisibility[]
  • Required: No
  • Description: Indicates which record types are visible to a user assigned to this profile, and therefore which tabs within an app are visible.
  • Type: string
  • Required: No
  • Introduced: API version 17.0
  • Description: The User License for the profile. A user license determines the baseline of features that the user can access. Every user must have exactly one user license.
  • Type: ProfileUserPermission[]
  • Required: No
  • Introduced: API version 29.0
  • Description: Specifies a user permission (such as “API Enabled”) and whether it’s enabled for this profile. This field retrieves only enabled user permissions.

LoginFlow represents a business process that you direct users to before they access Salesforce. You can use Metadata API to define existing flows as login flows and to edit login flow definitions. To delete login flow definitions, use the Login Flow page.

  • Type: string

  • Required: No

  • Description: Required only if the uiLoginFlowType is VisualWorkflow. The fullName of the Flow.

    Before you can deploy the LoginFlow, the Flow referenced here must be deployed in your org and its status must be Active.

  • Type: LoginFlowType (enumeration of type string)
  • Required: Yes
  • Description: Required. The value is UI.
  • Type: string
  • Required: Yes
  • Description: Required. The name of the LoginFlow.
  • Type: UiLoginFlowType (enumeration of type string)
  • Required: Yes
  • Description: Required. The type of login flow. These are valid values.
  • Possible values:
    • VisualWorkflow — Indicates a Salesforce Flow. You can create these flows using Flow Builder.
    • VisualForce — Indicates a flow created using Visualforce.
  • Type: boolean
  • Required: No
  • Description: Indicates if Lightning Runtime is used (true) or not (false (default)). Used only if uiLoginFlowType is VisualWorkflow.
  • Type: string
  • Required: No
  • Description: Required only if the uiLoginFlowType is VisualForce. The name of the VisualForce page.
  • Type: string
  • Required: No
  • Description: Required only if the uiLoginFlowType is VisualForce. The name of the VisualForce page.

ProfileAgentAccess represents the agent access configuration for users assigned through a profile.

  • Type: string
  • Required: Yes
  • Description: Required. The name of the employee agent.
  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether users assigned to this profile can use the Agentforce Employee Agent (true) or not (false).

ProfileApexClassAccess determines which top-level Apex classes have methods that users assigned to this profile can execute.

  • Type: string
  • Required: Yes
  • Description: Required. The Apex class name.
  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether users assigned to this profile can execute methods in the top-level class (true) or not (false).

ProfileApexPageAccess determines which Visualforce pages that users assigned to this profile can execute.

  • Type: string
  • Required: Yes
  • Description: Required. The Visualforce page name.
  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether users assigned to this profile can execute the Visualforce page (true) or not (false).

ProfileApplicationVisibility determines whether an app is visible to a user assigned to this profile.

  • Type: string
  • Required: Yes
  • Description: Required. The name of the app.
  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether the app is the default app (true) or not (false). Only one app per profile can be set to true.
  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether this app is visible to users assigned to this profile (true) or not (false).

ProfileCategoryGroupVisibility determines whether a data category group is visible to a user assigned to this profile.

Introduced in API version 41.0.

  • Type: string[]
  • Required: No
  • Description: Array of one or more data category names.
  • Type: string
  • Required: Yes
  • Description: Required. The name of the data category group.
  • Type: CategoryGroupVisibility (enumeration of type string)
  • Required: Yes
  • Description: Required. Indicates the visibility of the data category.
  • Possible values:
    • ALL
    • CUSTOM
    • NONE

ProfileCustomMetadataTypeAccess represents the custom metadata type access for users assigned to a profile.

Introduced in API version 47.0.

  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether the records for this custom metadata type are readable (true) or not (false).
  • Type: string
  • Required: Yes
  • Description: Required. The custom metadata type name.

ProfileCustomPermissions represents the custom permissions access for users assigned to a profile. Only enabled custom permissions are retrieved.

  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether the custom permission is enabled (true) or not (false).
  • Type: string
  • Required: Yes
  • Description: Required. The custom permission name.
  • Type: boolean
  • Required: Yes
  • Type: string
  • Required: Yes

ProfileCustomSettingAccesses represents the custom setting access for users assigned to a profile.

Introduced in API version 47.0.

  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether the records for this custom setting are readable (true) or not (false).
  • Type: string
  • Required: Yes
  • Description: Required. The custom setting name.

ProfileExternalDataSourceAccess represents the data source access for users with identity type of Available in API version 27.0 and later.Per User.

  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether the data source is enabled (true) or not (false).
  • Type: string
  • Required: Yes
  • Description: The name of the external data source.

ProfileFieldLevelSecurity represents the field level security for users assigned to a profile. In API version 30.0 and later, permissions for required fields can’t be retrieved or deployed.

  • Type: boolean

  • Required: Yes

  • Description: Required. Indicates whether this field is editable (true) or not (false).

    In API version 30.0 and later, when deploying a new custom field, this field is false by default.

  • Type: string

  • Required: Yes

  • Description: Required. Indicates the name of the field.

    When referencing shared Activity fields, specify Event or Task. For example, Event.Meeting__c.

  • Type: boolean

  • Required: No

  • Description: Indicates whether this field is hidden (true) or not (false). This field is available in API version 22.0 and earlier.

    For portal profiles, this field is set to true by default in API version 19.0 and later.

  • Type: boolean

  • Required: No

  • Introduced: API version 23.0

  • Description: Indicates whether this field is readable (true) or not (false). It replaces the hidden field.

    In API version 30.0 and later, when deploying a new custom field, this field is false by default.

    For portal profiles, this field is set to false by default.

ProfileFlowAccess represents which flows a profile grants access to.

Introduced in API version 47.0.

  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether users assigned this profile can access the flow (true) or not (false). The default value is false.
  • Type: string
  • Required: Yes
  • Description: Required. The name of the flow to which access is granted.

ProfileGenComputingSummaryDefAccess represents the enhanced summary access configuration for users assigned through a profile.

Introduced in API version 66.0.

  • Type: string
  • Required: Yes
  • Description: Required. The enhanced summary access configuration name given by the admin.
  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether the configuration is enabled (true) or not (false).
  • Type: string
  • Required: Yes
  • Type: string
  • Required: No

ProfileLayoutAssignments determines which layout to use for a profile and a given entity.

  • Type: string
  • Required: Yes
  • Description: Required. Indicates the layout for this particular entity.
  • Type: string
  • Required: No
  • Description: This field is optional. If the recordType of the record matches a layout assignment rule, it uses the specified layout.

ProfileLoginHours restricts the days and times within which users with a particular profile can log in.

  • Type: string
  • Required: No
  • Type: string
  • Required: No
  • Type: string
  • Required: No
  • Type: string
  • Required: No
  • Type: string
  • Required: No
  • Type: string
  • Required: No
  • Type: string
  • Required: No
  • Type: string
  • Required: No
  • Type: string
  • Required: No
  • Type: string
  • Required: No
  • Type: string
  • Required: No
  • Type: string
  • Required: No
  • Type: string
  • Required: No
  • Type: string
  • Required: No

To delete login hour restrictions from a profile that previously had them, you must explicitly include an empty loginHours tag without any start or end times.

ProfileLoginIpRange IP defines an IP address range that users with a particular profile can log in from.

  • Type: string
  • Required: No
  • Introduced: API version 31.0
  • Description: Use this field to identify the purpose of the range, such as which part of a network corresponds to this range.
  • Type: string
  • Required: Yes
  • Description: Required. The end IP address for the range.
  • Type: string
  • Required: Yes
  • Description: Required. The start IP address for the range.

ProfileObjectPermissions represents a user’s access to objects.

  • In API version 18.0 and later, these permissions are disabled in new custom objects for any profiles where “View All Data” or “Modify All Data” is disabled.
  • In API version 50.0 and later, editing standard objects on standard profiles is disabled.

In API version 18.0 and later, these permissions are disabled in new custom objects for any profiles where “View All Data” or “Modify All Data” is disabled. In API version 50.0 and later, editing standard objects on standard profiles is disabled.

  • Type: boolean

  • Required: No

  • Description: Indicates whether the object referenced by the object field can be created by the users assigned to this profile (true) or not (false).

    This field is named revokeCreate before version 14.0 and the logic is reversed. The field name change and the update from true to false and the reverse is automatically handled between versions and doesn’t require any manual editing of existing XML component files.

  • Type: boolean

  • Required: No

  • Description: Indicates whether the object referenced by the object field can be deleted by the users assigned to this profile (true) or not (false).

    This field is named The field name change and the update from revokeDelete before version 14.0 and the logic is reversed. true to false and the reverse is automatically handled between versions and doesn’t require any manual editing of existing XML component files.

  • Type: boolean

  • Required: No

  • Description: Indicates whether the object referenced by the object field can be edited by the users assigned to this profile (true) or not (false).

    This field is named The field name change and the update from revokeEdit before version 14.0 and the logic is reversed. true to false and the reverse is automatically handled between versions and doesn’t require any manual editing of existing XML component files.

  • Type: boolean

  • Required: No

  • Description: Indicates whether the object referenced by the object field can be seen by the users assigned to this profile (true) or not (false).

    This field is named The field name change and the update from revokeRead before version 14.0 and the logic is reversed. true to false and the reverse is automatically handled between versions and doesn’t require any manual editing of existing XML component files.

  • Type: boolean
  • Required: No
  • Introduced: API version 15.0
  • Description: Indicates whether all records for the object referenced by the object field can be read, edited, or deleted by the users assigned to this profile (true) or not (false), regardless of the sharing settings for the object. This setting is equivalent to the Modify All Data user permission limited to the individual object level. This field isn’t available for all objects. Refer to the profile in the user interface to determine which objects currently support these permissions. Profiles with Modify All Data ignore modifyAllRecords entries in Metadata API and don’t return an error if Modify All Data is enabled on the profile.
  • Type: string
  • Required: Yes
  • Description: Required. The name of the object whose permissions are altered by this profile, for example, MyCustomObject__c.
  • Type: boolean
  • Required: No
  • Introduced: API version 63.0
  • Description: Indicates whether all fields and field data for the object referenced by the object field can be read by the users assigned to this profile (true) or not (false).
  • Type: boolean
  • Required: No
  • Introduced: API version 15.0
  • Description: Indicates whether all records for the object referenced by the object field can be read by the users assigned to this profile (true) or not (false), regardless of the sharing settings for the object. This setting includes private records (records with no parent object). This setting is equivalent to the View All Data user permission limited to the individual object level. This field isn’t available for all objects. Refer to the profile in the user interface to determine which objects currently support these permissions. Profiles with “View All Data” ignore viewAllRecords entries in the Metadata API and don’t return an error if View All Data is enabled on the profile.

ProfileRecordTypeVisibility represents the visibility of record types for this profile. Record types let you offer different business processes, picklist values, and page layouts to different users.

  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether the record type is the default when users with this profile create records for this object (true) or not (false).
  • Type: boolean

  • Required: No

  • Description: When Person Accounts is enabled, this field indicates whether the record type is this profile’s default person account record type (true) or not (false). When Person Accounts is disabled, this field’s value has no impact.

    Person accounts aren’t enabled by default in Salesforce. To request person accounts, contact Salesforce.

  • Type: string
  • Required: Yes
  • Description: Required. The record type name, for example Account.MyRecordType.
  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether this record type is visible to users assigned to this profile (true) or not (false).

Represents the presence statuses that reps assigned to this profile have access.

Introduced in API version 64.0.

  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether the rep assigned to this profile has access to the presence status (true) or not (false).
  • Type: string
  • Required: Yes
  • Description: Required. The name of Service Presence Status.

ProfileTabVisibility represents the visibility of tabs for this profile. For version 17.0 and later, ProfileTabVisibility supports visibility of tabs for standard objects. The manifest file must include the standard object corresponding to a standard tab to retrieve the tab visibility in a profile.

  • Type: string
  • Required: Yes
  • Description: Required. The name of the tab.
  • Type: TabVisibility (enumeration of type string)

  • Required: Yes

  • Description: Required. Indicates the visibility of the tab.

    In API version 36.0 and earlier, Hidden is returned only if visibility was set using the API. If it was set to Hidden from the profile in Salesforce, the API doesn’t return a visibility value. For version 37.0 and later, when tab visibility is set to hidden, the API returns Hidden, regardless of how the value was set.

  • Possible values:

    • DefaultOff — The tab is available on the All Tabs page. Users can individually customize their display to make the tab visible in any app.
    • DefaultOn — The tab is available on the All Tabs page and appears in the visible tabs for its associated app. Users can individually customize their display to hide the tab or make it visible in other apps.
    • Hidden — The tab isn’t available on the All Tabs page or visible in any apps.

ProfileUserPermission represents an app or system permission for a profile. Use one of these elements for each permission.

  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether the permission is enabled (true) or disabled (false).
  • Type: string
  • Required: Yes
  • Description: Required. The permission name.

The definition of a profile in an organization with a custom app, custom object, record type, tab, and user permission is:

This sample uses picklists, profiles, record types, and a custom app:

To create custom profiles, we recommend that you use the Profile object instead of the deploy() call on the Profile Metadata type. The Profile object allows you to create empty profiles that start without any permissions enabled except for required permissions for the profile’s user license.

When you use the retrieve() call to get information about profiles, the returned .profile files only include security settings for the other metadata types referenced in the retrieve request. Exceptions include user permissions, IP address ranges, and login hours, which are always retrieved. For example, the following package.xml file contains a types element that matches all custom objects. The returned profiles contain object and field permissions for all custom objects in your organization but don’t include permissions for standard objects, such as Account, and standard fields.

The wildcard “*” on CustomObject doesn’t match standard objects. This wildcard behavior helps you to avoid making unintended, high-impact profile changes. If you create a few custom objects in a Developer Edition organization, retrieve() the information, and later deploy() the custom objects to your production org, the profile and field-level security for all your standard objects and fields aren’t overwritten. You can only overwrite these standard objects and fields by explicitly creating separate types elements for the objects or fields.

Metadata API intentionally makes it difficult to include standard fields in retrieve() calls to prevent unexpected profile changes. But you can still retrieve and deploy profile permissions for custom and standard fields in standard objects, such as Account.

This package.xml file allows you to return profile permissions for Account standard and custom fields. Note how the standard Account object is defined in a types element by specifying it as a member of a CustomObject type.

This package.xml file allows you to return profile permissions for the MyCustomField__c custom field in the Account object.

To retrieve field permissions for relationship fields, remove the “Id” part of the field. For example, in this package.xml file, to retrieve field permissions for the AccountId field for Contacts, you reference this field as Contact.Account not Contact.AcccountId.

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.