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

Platform Schema 

Access platform in the uiapi field.

Platform Field on UIAPI
1type UIAPI {
2  platform: Platform!
3}
4
5type Platform {
6  userPermissions(names: [String!]!): [UserPermission]!
7  customPermissions(names: [String!]!): [CustomPermission]!
8  contentAssetUrls(names: [String!]!): [ContentAssetUrl]!
9  resourceUrls(names: [String!]!): [ResourceUrl]!
10  i18n: I18nData
11  labels(
12    namespace: String = "c"
13    names: [String!]!
14    locale: String
15    fallback: LabelFallback
16  ): [LabelResult]!
17}

userPermissions and customPermissions Fields 

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.

Query userPermissions and customPermissions
1{
2  uiapi {
3    platform {
4      userPermissions(names: ["ManageUsers", "ViewSetup"]) {
5        name
6        hasAccess
7      }
8      customPermissions(names: ["My_Custom_Permission"]) {
9        name
10        hasAccess
11      }
12    }
13  }
14}

Permissions Schema 

Permissions Schema
1type Platform {
2  userPermissions(names: [String!]!): [UserPermission]!
3  customPermissions(names: [String!]!): [CustomPermission]!
4}
5
6type UserPermission {
7  name: String!
8  hasAccess: Boolean!
9}
10
11type CustomPermission {
12  name: String!
13  hasAccess: Boolean!
14}

UserPermissions Field 

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.

CustomPermissions Field 

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.

Example: Check User and Custom Permissions 

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

Check Multiple Permissions
1{
2  uiapi {
3    platform {
4      userPermissions(names: ["ManageUsers", "ViewSetup"]) {
5        name
6        hasAccess
7      }
8      customPermissions(names: ["My_Custom_Permission"]) {
9        name
10        hasAccess
11      }
12    }
13  }
14}

The response includes a result for each named permission.

Response for Permission Checks
1{
2  "data": {
3    "uiapi": {
4      "platform": {
5        "userPermissions": [
6          {
7            "name": "ManageUsers",
8            "hasAccess": false
9          },
10          {
11            "name": "ViewSetup",
12            "hasAccess": true
13          }
14        ],
15        "customPermissions": [
16          {
17            "name": "My_Custom_Permission",
18            "hasAccess": true
19          }
20        ]
21      }
22    }
23  },
24  "errors": []
25}

contentAssetUrls Field 

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.

Query contentAssetUrls
1{
2  uiapi {
3    platform {
4      contentAssetUrls(names: ["companyLogo", "acme__heroBanner"]) {
5        name
6        url
7      }
8    }
9  }
10}

contentAssetUrls Schema 

contentAssetUrls Schema
1type Platform {
2  contentAssetUrls(names: [String!]!): [ContentAssetUrl]!
3}
4
5type ContentAssetUrl {
6  name: String!
7  url: String!
8}

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.

Example: Get Content Asset URLs 

This example retrieves the URLs for two content assets.

Get Content Asset URLs
1{
2  uiapi {
3    platform {
4      contentAssetUrls(names: ["companyLogo", "acme__heroBanner"]) {
5        name
6        url
7      }
8    }
9  }
10}

The response includes the resolved URL for each named asset.

Response for contentAssetUrls
1{
2  "data": {
3    "uiapi": {
4      "platform": {
5        "contentAssetUrls": [
6          {
7            "name": "companyLogo",
8            "url": "https://example.my.salesforce.com/file-asset/companyLogo?v=1"
9          },
10          {
11            "name": "acme__heroBanner",
12            "url": "https://example.my.salesforce.com/file-asset/acme__heroBanner?v=3"
13          }
14        ]
15      }
16    }
17  },
18  "errors": []
19}

resourceUrls Field 

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.

Query resourceUrls
1{
2  uiapi {
3    platform {
4      resourceUrls(names: ["myResource", "acme__logo"]) {
5        name
6        url
7      }
8    }
9  }
10}

resourceUrls Schema 

resourceUrls Schema
1type Platform {
2  resourceUrls(names: [String!]!): [ResourceUrl]!
3}
4
5type ResourceUrl {
6  name: String!
7  url: String!
8}

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.

Example: Get Static Resource URLs 

This example retrieves the URLs for two static resources.

Get Static Resource URLs
1{
2  uiapi {
3    platform {
4      resourceUrls(names: ["myResource", "acme__logo"]) {
5        name
6        url
7      }
8    }
9  }
10}

The response includes the resolved URL for each named resource.

Response for resourceUrls
1{
2  "data": {
3    "uiapi": {
4      "platform": {
5        "resourceUrls": [
6          {
7            "name": "myResource",
8            "url": "/resource/1234567890000/myResource"
9          },
10          {
11            "name": "acme__logo",
12            "url": "/resource/1234567890001/acme__logo"
13          }
14        ]
15      }
16    }
17  },
18  "errors": []
19}

i18n Field 

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.

Query i18n
1{
2  uiapi {
3    platform {
4      i18n {
5        lang
6        locale
7        currency
8        timeZone
9        dateTime {
10          shortDateFormat
11          longDateTimeFormat
12        }
13        number {
14          currencySymbol
15          decimalSeparator
16          groupingSeparator
17        }
18      }
19    }
20  }
21}

i18n Schema 

i18n Schema
1type Platform {
2  i18n: I18nData
3}
4
5type I18nData {
6  lang: String
7  dir: String
8  locale: String
9  currency: String
10  timeZone: String
11  firstDayOfWeek: Int
12  showJapaneseCalendar: Boolean
13  isEasternNameStyle: Boolean
14  defaultCalendar: String
15  defaultNumberingSystem: String
16  calendarData: JSON
17  dateTime: I18nDateTimeData
18  number: I18nNumberData
19  common: I18nCommonData
20}
21
22type I18nDateTimeData {
23  shortDateFormat: String
24  mediumDateFormat: String
25  longDateFormat: String
26  shortDateTimeFormat: String
27  mediumDateTimeFormat: String
28  longDateTimeFormat: String
29  shortTimeFormat: String
30  longTimeFormat: String
31}
32
33type I18nNumberData {
34  currencyFormat: String
35  currencySymbol: String
36  decimalSeparator: String
37  exponentialSign: String
38  groupingSeparator: String
39  infinity: String
40  minusSign: String
41  nan: String
42  numberFormat: String
43  perMilleSign: String
44  percentFormat: String
45  percentSign: String
46  plusSign: String
47  superscriptExponentSign: String
48}
49
50type I18nCommonData {
51  calendarData: JSON
52  digits: JSON
53}

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.

I18nDateTimeData Type 

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.

I18nNumberData Type 

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.

I18nCommonData Type 

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.

Example: Get Locale and Date Format Data 

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

Get User Locale and Date Formats
1{
2  uiapi {
3    platform {
4      i18n {
5        lang
6        locale
7        timeZone
8        firstDayOfWeek
9        dateTime {
10          shortDateFormat
11          mediumDateFormat
12          longDateFormat
13          shortTimeFormat
14        }
15        number {
16          currencySymbol
17          decimalSeparator
18          groupingSeparator
19        }
20      }
21    }
22  }
23}

The response includes the i18n data for the current user.

Response for i18n Query
1{
2  "data": {
3    "uiapi": {
4      "platform": {
5        "i18n": {
6          "lang": "en",
7          "locale": "en_US",
8          "timeZone": "America/Los_Angeles",
9          "firstDayOfWeek": 0,
10          "dateTime": {
11            "shortDateFormat": "M/d/yyyy",
12            "mediumDateFormat": "MMM d, yyyy",
13            "longDateFormat": "MMMM d, yyyy",
14            "shortTimeFormat": "h:mm a"
15          },
16          "number": {
17            "currencySymbol": "$",
18            "decimalSeparator": ".",
19            "groupingSeparator": ","
20          }
21        }
22      }
23    }
24  },
25  "errors": []
26}

labels Field 

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.

Query labels
1{
2  uiapi {
3    platform {
4      labels(names: ["greeting", "submit_button"]) {
5        namespace
6        name
7        value
8        resolvedLocale
9        wasFallback
10      }
11    }
12  }
13}

Labels Schema 

Labels Schema
1type Platform {
2  labels(
3    namespace: String = "c"
4    names: [String!]!
5    locale: String
6    fallback: LabelFallback
7  ): [LabelResult]!
8}
9
10type LabelResult {
11  namespace: String!
12  name: String!
13  value: String
14  resolvedLocale: String
15  wasFallback: Boolean!
16}
17
18enum LabelFallback {
19  USER_DEFAULT
20  BASE_VALUE
21  NONE
22}

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.

LabelResult Type 

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.

LabelFallback Enum 

The LabelFallback enumeration controls how the API handles missing translations.

LabelFallback Enum
1enum LabelFallback {
2  USER_DEFAULT
3  BASE_VALUE
4  NONE
5}
  • 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.

Example: Get Labels in a Specific Locale 

This example fetches two custom labels in French.

Get Labels in French
1{
2  uiapi {
3    platform {
4      labels(names: ["greeting", "submit_button"], locale: "fr", fallback: USER_DEFAULT) {
5        namespace
6        name
7        value
8        resolvedLocale
9        wasFallback
10      }
11    }
12  }
13}

The response includes the resolved label value and the locale.

Response for Labels Query
1{
2  "data": {
3    "uiapi": {
4      "platform": {
5        "labels": [
6          {
7            "namespace": "c",
8            "name": "greeting",
9            "value": "Bonjour",
10            "resolvedLocale": "fr",
11            "wasFallback": false
12          },
13          {
14            "namespace": "c",
15            "name": "submit_button",
16            "value": "Submit",
17            "resolvedLocale": "en",
18            "wasFallback": true
19          }
20        ]
21      }
22    }
23  },
24  "errors": []
25}

Example: Get Standard Framework Labels 

This example fetches labels from the LightningForm framework namespace.

Get Standard Framework Labels
1{
2  uiapi {
3    platform {
4      labels(namespace: "LightningForm", names: ["edit", "save"]) {
5        name
6        value
7        resolvedLocale
8      }
9    }
10  }
11}