Use Platform Capabilities

AVAILABLE API VERSION
API v67.0 and later

The platform field on the UIAPI type provides capabilities to complement the RecordQuery type. Use platform capabilities to:

  • Check specific permissions for the current user
  • Resolve authenticated file-asset URLs for Salesforce content assets in batch
  • Resolve canonical URLs for static resources
  • Get the current user’s internationalization properties
  • Resolve custom and standard label values in the current user’s locale

Access platform in the uiapi field.

The userPermissions and customPermissions fields return permission grants for the calling user. Use these fields to determine whether the current user has specific permissions without querying the User object or making more API calls. This functionality mirrors the LWC @salesforce/userPermission and @salesforce/customPermission imports.

Pass permission names as a list in the names argument to return the grant status for each named permission in a single request. You can pass up to 25 permission names per call. A failure on one name doesn’t cause the operation to fail. Partial successes show failed names in the returned errors object.

The userPermissions field returns a list of UserPermission types, one per name in the names argument.

  • names - A list of user permission API names to check for the calling user. This argument is required.

The UserPermission type contains these fields.

  • name - The API name of the user permission.
  • hasAccess - Indicates whether the calling user has the permission.

The customPermissions field returns a list of CustomPermission types, one per name in the names argument.

  • names - A list of custom permission API names to check for the calling user. This argument is required.

The CustomPermission type contains these fields.

  • name - The API name of the custom permission.
  • hasAccess - Indicates whether the calling user has the permission.

This example checks whether the current user has two user permissions and one custom permission.

The response includes a result for each named permission.

The contentAssetUrls field returns resolved URLs for content assets in the calling org. Use this field to retrieve the URL for one or more content assets by name without constructing URLs manually. This functionality mirrors the LWC @salesforce/contentAssetUrl import.

Pass asset names as a list in the names argument to return the URL for each asset in a single request. A failure on one name doesn’t cause the operation to fail. Partial successes show failed names in the returned errors object.

The contentAssetUrls field returns a list of ContentAssetUrl types, one per name in the names argument.

  • names - A list of up to 25 content asset names to resolve. Use the same canonical form as the LWC import. Unmanaged assets use the developer name. Managed package assets include the namespace prefix, such as <namespace>__<developerName>. This argument is required.

The ContentAssetUrl type contains these fields.

  • name - The name of the content asset.
  • url - The authenticated file-asset servlet URL for the content asset.

This example retrieves the URLs for two content assets.

The response includes the resolved URL for each named asset.

The resourceUrls field returns resolved URLs for static resources in the calling org. Use this field to retrieve the URL for one or more static resources by name without constructing URLs manually. This functionality mirrors the LWC @salesforce/resourceUrl import.

Pass resource names as a list in the names argument to return the URL for each resource in a single request. A failure on one name doesn’t cause the operation to fail. Partial successes show failed names in the returned errors object.

The resourceUrls field returns a list of ResourceUrl types, one per name in the names argument.

  • names - A list of up to 25 static resource names to resolve. Use the same canonical form as the LWC import. Unmanaged assets use the developer name. Managed package assets include the namespace prefix, such as <namespace>__<developerName>. This argument is required.

The ResourceUrl type contains these fields.

  • name - The name of the static resource.
  • url - The resolved URL for the static resource.

This example retrieves the URLs for two static resources.

The response includes the resolved URL for each named resource.

The i18n field returns internationalization (i18n) data for the current user, mirroring the values available through LWC @salesforce/i18n imports. Use this field to get locale, currency, time zone, and date and number format data for the calling user in a single request.

The I18nData type contains top-level locale and user preferences.

  • lang - The language code for the current user’s language, for example, en.
  • dir - The text direction for the current user’s language, either ltr (left-to-right) or rtl (right-to-left).
  • locale - The locale code for the current user, for example, en_US.
  • currency - The ISO 4217 currency code for the current user, for example, USD.
  • timeZone - The IANA time zone name for the current user, for example, America/Los_Angeles.
  • firstDayOfWeek - The first day of the week for the user’s locale, where 0 is Sunday and 1 is Monday.
  • showJapaneseCalendar - Indicates whether the Japanese calendar is used for this user’s locale.
  • isEasternNameStyle - Indicates whether the user’s locale uses eastern name style (family name before given name).
  • defaultCalendar - The default calendar system for the user’s locale, for example, gregorian.
  • defaultNumberingSystem - The default numbering system for the user’s locale, for example, latn.
  • calendarData - More calendar data for the user’s locale as a JSON object.
  • dateTime - Date and time format strings for the current user’s locale. See I18nDateTimeData.
  • number - Number format strings and symbols for the current user’s locale. See I18nNumberData.
  • common - Supplementary calendar and digit data for the user’s locale. See I18nCommonData.

The I18nDateTimeData type contains date and time format strings for the current user’s locale.

  • shortDateFormat - Short date format pattern, for example, M/d/yyyy.
  • mediumDateFormat - Medium date format pattern, for example, MMM d, yyyy.
  • longDateFormat - Long date format pattern.
  • shortDateTimeFormat - Short date and time format pattern.
  • mediumDateTimeFormat - Medium date and time format pattern.
  • longDateTimeFormat - Long date and time format pattern.
  • shortTimeFormat - Short time format pattern, for example, h:mm a.
  • longTimeFormat - Long time format pattern.

The I18nNumberData type contains number format strings and symbols for the current user’s locale.

  • currencyFormat - Currency format pattern, for example, ¤#,##0.00.
  • currencySymbol - The currency symbol, for example, $.
  • decimalSeparator - The character used as the decimal separator, for example, ..
  • exponentialSign - The character used to denote exponential notation.
  • groupingSeparator - The character used as the grouping (thousands) separator, for example, ,.
  • infinity - The string representing infinity.
  • minusSign - The character used as the minus sign.
  • nan - The string representing not-a-number.
  • numberFormat - General number format pattern.
  • perMilleSign - The character used for parts-per-thousand notation.
  • percentFormat - Percent format pattern.
  • percentSign - The character used as the percent sign.
  • plusSign - The character used as the plus sign.
  • superscriptExponentSign - The character used as the superscript exponent sign.

The I18nCommonData type contains supplementary calendar and digit data.

  • calendarData - Supplementary calendar data as a JSON object.
  • digits - Locale-specific digit characters as a JSON object.

This example fetches the current user’s locale, time zone, and date format patterns.

The response includes the i18n data for the current user.

The labels field returns resolved custom label values for the calling user. Use this field to get one or more custom labels by name, optionally specifying a locale and a fallback strategy if a translation isn’t available. This functionality mirrors the LWC @salesforce/label import.

The labels field has these arguments.

  • namespace - The namespace for custom labels or framework section name, such as LightningForm, for standard labels. Defaults to c to resolve unmanaged custom labels.
  • names - A list of up to 100 custom label API names to retrieve. This argument is required.
  • locale - The locale to use when resolving label translations, for example, fr. Defaults to the calling user’s locale.
  • fallback - The fallback behavior when a translation isn’t available for the requested locale. Defaults to USER_DEFAULT. See LabelFallback.

The LabelResult type represents a resolved custom label value.

  • namespace - The namespace of the custom label.
  • name - The API name of the custom label.
  • value - The resolved label value for the requested locale, or null if the label doesn’t exist and fallback is NONE.
  • resolvedLocale - The locale that was used to resolve the label value. This locale can differ from the requested locale if a fallback occurred.
  • wasFallback - Indicates whether a fallback resolved the value rather than a direct translation match.

The LabelFallback enumeration controls how the API handles missing translations.

  • USER_DEFAULT - Falls back first to the user’s default language translation, then to the base label value if no language-level translation is available. This value is the default.
  • BASE_VALUE - Falls back directly to the base label value, skipping the user’s language.
  • NONE - Doesn’t fall back. If a translation for the requested locale is missing, value is null and the response includes a GraphQL error.

This example fetches two custom labels in French.

The response includes the resolved label value and the locale.

This example fetches labels from the LightningForm framework namespace.