Skip to main content
These APIs return information about the Kintone space that contains the current app. Use them in event handlers to read space metadata and check what the current user is permitted to do within the space.
Space APIs are available on both desktop and mobile. They return data only when the current app is inside a space. If the app is not in a space, these methods return null.

Space information

Returns information about the space the current app belongs to.Function
kintone.space.get()
ParametersNone.Return valueReturns a space object, or null if the app is not in a space.
PropertyTypeDescription
idstringThe space ID.
namestringThe space name.
isPrivatebooleantrue if the space is private.
isGuestbooleantrue if this is a guest space.
useMultiThreadbooleantrue if the space uses multiple threads.
fixedMemberbooleantrue if the space has a fixed member list.
coverTypestringCover image type: "BLOB", "PRESET", or "URL".
coverKeystringThe cover image key or URL depending on coverType.
coverUrlstringThe cover image URL.
bodystringThe space body HTML.
creatorobjectThe user who created the space (code and name).
modifierobjectThe user who last modified the space (code and name).
memberCountstringThe number of space members.
roleCountstringThe number of roles defined in the space.
threadCountstringThe number of threads in the space.
Available pages
  • Any page within an app that belongs to a space
Example
kintone.events.on('app.record.index.show', function(event) {
  var space = kintone.space.get();
  if (space) {
    console.log('Space name:', space.name);
    console.log('Private:', space.isPrivate);
  } else {
    console.log('This app is not in a space.');
  }
  return event;
});
Returns the current user’s permissions for the space the app belongs to.Function
kintone.space.getPermissions()
ParametersNone.Return valueReturns a permissions object, or null if the app is not in a space.
PropertyTypeDescription
hasReadPermissionbooleantrue if the user can view the space.
hasEditPermissionbooleantrue if the user can edit the space.
hasAdminPermissionbooleantrue if the user has administrative access to the space.
Available pages
  • Any page within an app that belongs to a space
Example
kintone.events.on('app.record.index.show', function(event) {
  var perms = kintone.space.getPermissions();
  if (perms) {
    if (perms.hasAdminPermission) {
      console.log('User is a space admin.');
    } else if (perms.hasEditPermission) {
      console.log('User can edit the space.');
    } else {
      console.log('User has read-only access.');
    }
  }
  return event;
});

Build docs developers (and LLMs) love