Skip to main content
The general utility APIs provide access to the current user’s information, Kintone environment details, dialog and notification UI, page URL generation, and keyboard shortcut management.

User information

Returns information about the currently logged-in user. Works for both regular and guest users.Available pages: All pages (desktop and mobile), including the plug-in settings page

Parameters

None

Return value

Returns an object with the following properties:
PropertyTypeDescription
idstringSystem-assigned user ID
codestringLogin name. For guest users, this is the email address.
namestringDisplay name. For guest users, this is the user’s name.
emailstringEmail address
urlstringProfile URL. Empty string for guest users.
employeeNumberstringEmployee ID. Empty string for guest users.
phonestringPhone number
mobilePhonestringMobile phone number. Empty string for guest users.
extensionNumberstringExtension number. Empty string for guest users.
timezonestringUser’s timezone
isGuestbooleantrue if the user is a guest user
languagestringUser’s display language: ja, en, zh, zh-TW, es, pt-BR, th. Unsupported locales return en.

Example

const user = kintone.getLoginUser();
console.log(user.name);     // "Jane Smith"
console.log(user.language); // "en"
console.log(user.isGuest);  // false
Use the REST API’s Get User endpoint if you need more detailed user profile information.
Returns the custom profile fields configured for a user. When retrieving fields for the currently logged-in user, private fields are also returned.Available pages: All pages (desktop and mobile). Not available on search, app store, or plug-in settings pages.
This is an async API that returns a Promise.

Parameters

ParameterTypeRequiredDescription
codestringNoLogin name of the user whose fields to retrieve. Omit to retrieve the logged-in user’s fields.

Return value

Returns a Promise that resolves to an array of objects:
PropertyTypeDescription
codestringField code
namestringField label
typestringField type: SINGLE_LINE_TEXT or USER_SELECT
valuestring | objectSaved value. String for SINGLE_LINE_TEXT; object for USER_SELECT.
value.codestringUser code (only for USER_SELECT type)
value.namestringUser display name (only for USER_SELECT type)
visibilitystringPUBLIC or PRIVATE

Example

kintone.events.on('app.record.index.show', async (event) => {
  const fields = await kintone.user.getCustomFields();
  fields.forEach((f) => console.log(f.code, f.value));
  return event;
});
This API fetches data from the server. Responses are cached until the next page navigation. If the per-user rate limit of 50 server requests per minute is exceeded, the returned Promise will be rejected.
Returns the groups (roles) that a user belongs to. When called from a guest space, only Everyone and Administrator groups are returned.Available pages: All pages (desktop and mobile). Not available on search, app store, or plug-in settings pages.
This is an async API that returns a Promise.

Parameters

ParameterTypeRequiredDescription
codestringNoLogin name of the user whose groups to retrieve. Omit to retrieve the logged-in user’s groups.

Return value

Returns a Promise that resolves to an array of objects:
PropertyTypeDescription
idstringGroup ID
codestringGroup code
namestringGroup name

Example

kintone.events.on('app.record.index.show', async (event) => {
  const groups = await kintone.user.getGroups();
  const isAdmin = groups.some((g) => g.code === 'Administrators');
  if (!isAdmin) {
    kintone.app.showAddRecordButton(false);
  }
  return event;
});
This API fetches data from the server. If the per-user rate limit of 50 server requests per minute is exceeded, the returned Promise will be rejected.
Returns the departments (organizations) that a user belongs to, including their title within each department. Values for fields that support multiple languages are returned in the language of the logged-in user.Available pages: All pages (desktop and mobile). Not available on search, app store, or plug-in settings pages.
This is an async API that returns a Promise.

Parameters

ParameterTypeRequiredDescription
codestringNoLogin name of the user whose departments to retrieve. Omit to retrieve the logged-in user’s departments.

Return value

Returns a Promise that resolves to an array of objects:
PropertyTypeDescription
organization.idstringDepartment ID
organization.codestringDepartment code
organization.namestringDepartment name
organization.primarybooleantrue if this is the user’s primary department
titleobject | nullThe user’s title within the department. null if not set.
title.idstringTitle ID
title.codestringTitle code
title.namestringTitle name

Example

kintone.events.on('app.record.index.show', async (event) => {
  const orgs = await kintone.user.getOrganizations();
  const primary = orgs.find((o) => o.organization.primary);
  console.log('Primary department:', primary?.organization.name);
  return event;
});
This API fetches data from the server. If the per-user rate limit of 50 server requests per minute is exceeded, the returned Promise will be rejected.
Returns the type of the current page.Available pages: All pages (desktop and mobile)

Parameters

None

Return value

TypeDescription
stringThe current page type identifier

Example

const pageType = kintone.user.getPageType();
console.log(pageType);
Returns the icon URLs for a user.Available pages: All pages (desktop and mobile)

Parameters

None

Return value

TypeDescription
objectAn object containing user icon URLs

Example

const icons = kintone.user.getIcons();
console.log(icons);

Environment information

Returns the UI design version of the current page. Use this to detect whether the user is running the legacy or the revamped Kintone UI.Available pages: All pages (desktop and mobile), including the plug-in settings page

Parameters

None

Return value

TypeDescription
number1 — legacy desktop UI or mobile; 2 — revamped desktop UI

Example

const version = kintone.getUiVersion();
if (version === 2) {
  console.log('Running revamped UI');
}
Returns which other cybozu.com services are available in the current environment.Available pages: All pages (desktop and mobile). Not available on search, app store, or plug-in settings pages.
This is an async API that returns a Promise.

Parameters

None

Return value

Returns a Promise that resolves to an object:
PropertyTypeDescription
garoonbooleantrue if Garoon is available
officebooleantrue if Cybozu Office is available
mailwisebooleantrue if Mailwise is available

Example

kintone.events.on('app.record.index.show', async (event) => {
  const services = await kintone.getAvailableServices();
  if (services.garoon) {
    console.log('Garoon integration is available');
  }
  return event;
});
Returns the domain information for the current Kintone environment.Available pages: All pages (desktop and mobile), including the plug-in settings page. Not available on search or app store pages.
This is an async API that returns a Promise.

Parameters

None

Return value

Returns a Promise that resolves to an object:
PropertyTypeDescription
subdomainstringThe subdomain name
baseDomainstringThe base domain: cybozu.com, cybozu.cn, or kintone.com

Example

kintone.events.on('app.record.index.show', async (event) => {
  const domain = await kintone.getDomain();
  console.log(`${domain.subdomain}.${domain.baseDomain}`);
  return event;
});
Returns which API types are available in the current environment. Use this to detect whether the Wide Plan APIs are available.Available pages: All pages (desktop and mobile), including the plug-in settings page. Not available on search or app store pages.
This is an async API that returns a Promise.

Parameters

None

Return value

Returns a Promise that resolves to an array of strings. Order is not guaranteed.
ValueDescription
COREGenerally available APIs
WIDEAPIs exclusive to the Wide Plan

Example

kintone.events.on('app.record.index.show', async (event) => {
  const types = await kintone.getAvailableApiTypes();
  if (types.includes('WIDE')) {
    console.log('Wide plan APIs are available');
  }
  return event;
});
Returns whether the user accessed Kintone using client certificate authentication.Available pages: All pages (desktop and mobile)

Parameters

None

Return value

TypeDescription
booleantrue if the current session uses client certificate authentication

Example

if (kintone.isAccessWithClientCertificateAuthentication()) {
  console.log('Client certificate authentication is active');
}
Returns whether the current page is a Kintone mobile app page.Available pages: All pages (desktop and mobile)

Parameters

None

Return value

TypeDescription
booleantrue if the current page is a mobile app page

Example

if (kintone.isMobileApp()) {
  console.log('Running in mobile app');
}
Returns whether the current page is any mobile Kintone page.Available pages: All pages (desktop and mobile)

Parameters

None

Return value

TypeDescription
booleantrue if the current page is a mobile page

Example

if (kintone.isMobilePage()) {
  // Apply mobile-specific customization
}
Returns the current user’s personal preference settings.Available pages: All pages (desktop and mobile)

Parameters

None

Return value

TypeDescription
objectAn object containing user preference settings

Example

const prefs = kintone.getUserPreference();
console.log(prefs);
Returns whether the logged-in user has Users & System Administrator privileges.Available pages: All pages (desktop and mobile)

Parameters

None

Return value

TypeDescription
booleantrue if the user has Users & System Administrator privileges

Example

if (kintone.isUsersAndSystemAdministrator()) {
  // Show admin controls
}
Returns whether the current page is using the revamped Kintone UI. This is an alternative to checking kintone.getUiVersion() === 2.Available pages: All pages (desktop and mobile)

Parameters

None

Return value

TypeDescription
booleantrue if the revamped UI is active

Example

if (kintone.isRevampedUI()) {
  // Apply revamped-UI-specific styling
}

Dialogs and notifications

Displays a confirmation dialog with OK and Cancel buttons.Available pages: Desktop only. Not available on search or app store pages.

Parameters

ParameterTypeRequiredDescription
optionsobjectYesDialog configuration
options.titlestringNoDialog title
options.messagestringNoDialog body message

Return value

TypeDescription
Promise<string>Resolves with OK or CANCEL based on the user’s selection

Example

kintone.events.on('app.record.detail.delete.submit', async (event) => {
  const result = await kintone.showConfirmDialog({
    title: 'Delete record',
    message: 'Are you sure you want to delete this record?',
  });
  if (result !== 'OK') {
    // Cancel the delete
    return false;
  }
  return event;
});
Creates a fully customizable dialog. The dialog content is defined by a DOM element you provide, giving you full control over the layout and interaction.Available pages: Desktop only. Not available on search or app store pages.
This is an async API that returns a Promise.

Parameters

ParameterTypeRequiredDescription
optionsobjectYesDialog configuration
options.titlestringNoDialog title. Omitted if not set.
options.bodyElementNoDOM element to render as the dialog body. Omitted if not set.
options.showOkButtonbooleanNoShow an OK button. Defaults to true.
options.okButtonTextstringNoLabel for the OK button. Defaults to the localized “OK”.
options.showCancelButtonbooleanNoShow a Cancel button. Defaults to false.
options.cancelButtonTextstringNoLabel for the Cancel button. Defaults to the localized “Cancel”.
options.showCloseButtonbooleanNoShow a close (X) button. Defaults to false. When false, the Escape key is also disabled.
options.beforeClosefunctionNoCallback invoked before the dialog closes. Receives one of OK, CANCEL, or CLOSE. Return false (or a Promise resolving to false) to prevent the dialog from closing.

Return value

Returns a Promise that resolves to an object:
PropertyTypeDescription
showfunctionAsync function that displays the dialog. Returns a Promise that resolves with the user’s action: OK, CANCEL, CLOSE, or FUNCTION.
closefunctionCloses the dialog programmatically. No arguments or return value.

Example

kintone.events.on('app.record.detail.show', async (event) => {
  const bodyEl = document.createElement('p');
  bodyEl.textContent = 'Do you want to delete this record?';

  const dialog = await kintone.createDialog({
    title: 'Confirm',
    body: bodyEl,
    okButtonText: 'Delete',
    showCancelButton: true,
    cancelButtonText: 'Cancel',
    showCloseButton: true,
    beforeClose: (action) => {
      if (action === 'OK') {
        console.log('Delete confirmed');
      }
    },
  });

  const result = await dialog.show();
  console.log('Dialog closed with:', result);
  return event;
});
The options.body Element is embedded directly in the dialog DOM. Sanitize any user-generated content before passing it as the body.
Displays a brief notification message to the user.Available pages: Desktop only. Not available on search or app store pages.

Parameters

ParameterTypeRequiredDescription
optionsobjectYesNotification configuration
options.textstringYesThe message to display
options.typestringNoNotification style: success, danger, or infoDialog

Return value

undefined

Example

kintone.events.on('app.record.create.submit.success', (event) => {
  kintone.showNotification({
    text: 'Record saved successfully.',
    type: 'success',
  });
  return event;
});
Toggles the full-screen loading overlay.Available pages: Desktop only

Parameters

ParameterTypeRequiredDescription
visiblebooleanYestrue to show the loading overlay, false to hide it

Return value

undefined

Example

kintone.events.on('app.record.index.show', async (event) => {
  kintone.showLoading(true);
  try {
    await fetchExternalData();
  } finally {
    kintone.showLoading(false);
  }
  return event;
});
Generates a Kintone page URL. Guest space app pages automatically receive the correct guest space URL format. Use this instead of constructing URLs by hand.Available pages: All pages (desktop and mobile). Not available on search, app store, or plug-in settings pages.
This is an async API that returns a Promise. Response data is cached until the next page navigation. Exceeding 50 server requests per user per minute will cause the Promise to be rejected.

Parameters

ParameterTypeRequiredDescription
pagestringYesPage type identifier. See the table below for valid values.
paramsobjectYesParameters used to build the URL
params.appIdstringConditionalApp ID. Required for all app pages.
params.recordIdstringConditionalRecord ID. Required for detail, edit, and print pages.
params.viewIdstringNoView ID. Optional for list pages.
params.reportIdstringConditionalGraph ID. Required for graph pages.
params.spaceIdstringConditionalSpace ID. Required for space pages.
params.threadIdstringConditionalThread ID. Required for space thread pages.
params.userCodestringConditionalUser login name. Required for People and Message pages.

Page type values

ValueDescription
APP_INDEXRecord list (desktop)
APP_CREATERecord create (desktop)
APP_DETAILRecord detail (desktop)
APP_EDITRecord edit (desktop)
APP_PRINTRecord print (desktop)
APP_REPORTGraph (desktop)
APP_INDEX_MOBILERecord list (mobile)
APP_CREATE_MOBILERecord create (mobile)
APP_DETAIL_MOBILERecord detail (mobile)
APP_EDIT_MOBILERecord edit (mobile)
APP_REPORT_MOBILEGraph (mobile)
PORTAL_TOPPortal (desktop)
PORTAL_TOP_MOBILEPortal (mobile)
SPACE_PORTALSpace portal (desktop)
SPACE_THREADSpace thread (desktop)
SPACE_PORTAL_MOBILESpace portal (mobile)
SPACE_THREAD_MOBILESpace thread (mobile)
PEOPLE_TOPPeople profile (desktop)
PEOPLE_TOP_MOBILEPeople profile (mobile)
MESSAGE_TOPMessage (desktop)
MESSAGE_TOP_MOBILEMessage (mobile)
SEARCH_TOPSearch (desktop)
SEARCH_TOP_MOBILESearch (mobile)
NOTIFICATION_TOPNotifications (desktop)
APP_MARKETPLACE_TOPApp store (desktop)

Return value

Returns a Promise that resolves to a string containing the full page URL.

Example

kintone.events.on('app.record.detail.show', async (event) => {
  const url = await kintone.buildPageUrl('APP_INDEX', {
    appId: String(kintone.app.getId()),
  });
  console.log('List URL:', url);
  return event;
});

Keyboard shortcuts

Enables or disables specific keyboard shortcuts on the current page.Available pages: Desktop only. Available on record list, detail, create, and edit pages.

Parameters

ParameterTypeRequiredDescription
shortcutsobjectYesAn object where each key is a shortcut name and each value is a boolean to enable (true) or disable (false) it

Return value

undefined

Example

kintone.events.on('app.record.index.show', (event) => {
  kintone.setKeyboardShortcuts({
    SEARCH: false,
    NEW_RECORD: true,
  });
  return event;
});
Returns the current enabled/disabled state of all keyboard shortcuts available on the current page.Available pages: Desktop only. Available on record list, detail, create, and edit pages.
This is an async API that returns a Promise.

Parameters

None

Return value

Returns a Promise that resolves to an object where each key is a shortcut name and each value is a boolean indicating whether the shortcut is enabled. The shortcut names match the keys used in kintone.setKeyboardShortcuts().

Example

kintone.events.on('app.record.index.show', async (event) => {
  const shortcuts = await kintone.getKeyboardShortcuts();
  console.log('Shortcuts state:', shortcuts);
  return event;
});

Build docs developers (and LLMs) love