NetSuite / SuiteScript: Get Configuration Information via a RESTlet

Published on July 25, 2019.

Here's a follow-up to this post.

Here's an interesting RESTlet that I recently wrote that can be used to provide NetSuite account configuration information to external systems.

The RESTlet uses the SuiteScript 2.0 runtime module ("N/runtime") and provides the configuration information as a JSON-encoded response. Some of the information that is provided includes the environment type, NetSuite version, processor count, queue count, and more. This information can be helpful if you are troubleshooting a problem for a client.

Here's an example of the RESTlet's response:

{
  "accountId": "NSPRTR2311311",
  "envType": "PRODUCTION",
  "executionContext": "RESTLET",
  "processorCount": 15,
  "queueCount": 15,
  "version": "2019.2",
  "currentScript": {
    "id": "customscript_runtime_info_api",
    "deploymentId": "customdeploy_runtime_info_api",
    "logLevel": "DEBUG",
    "bundleIds": []
  },
  "currentSession": {},
  "currentUser": {
    "id": -5,
    "name": "Tim Dietrich",
    "email": "timdietrich@ironforge.software",
    "location": 0,
    "department": 7,
    "role": 2,
    "roleId": "administrator",
    "roleCenter": "BASIC",
    "subsidiary": 1
  }
}

Here's the script:

/**
* @NApiVersion 2.x
* @NScriptType Restlet
* @NModuleScope Public
*/

/* 

--------------------------------------------------------------------------------
Script Information
--------------------------------------------------------------------------------

Name:
Runtime Info API

ID:
_runtime_info_api

Description
Provides a Web API for getting runtime information.


--------------------------------------------------------------------------------
Developer(s)
--------------------------------------------------------------------------------

TD:
• Tim Dietrich
• timdietrich@me.com


--------------------------------------------------------------------------------
History
--------------------------------------------------------------------------------

20190712 - TD
• Initial version.
		
*/



var 	
	runtime;


define( [ 'N/runtime' ], main );


function main( runtimeModule ) {

	runtime = runtimeModule;
	
    return {
        get: getProcess
    }

}


function getProcess( request ) {

	return runtimeInfoGet();
	
}  


function runtimeInfoGet() {

	// Returns all information available from the runtime module.
		
	var runtimeInfo = {}
	runtimeInfo.accountId = runtime.accountId;
	runtimeInfo.envType = runtime.envType;
	runtimeInfo.executionContext = runtime.executionContext;
	runtimeInfo.processorCount = runtime.processorCount;
	runtimeInfo.queueCount = runtime.queueCount;
	runtimeInfo.version = runtime.version;	
	runtimeInfo.currentScript = runtime.getCurrentScript();
	runtimeInfo.currentSession = runtime.getCurrentSession();
	runtimeInfo.currentUser = runtime.getCurrentUser();		
	return runtimeInfo;
	
}

If you'd like to filter the information that is returned, simply adjust the "runtimeInfoGet" function. For example, you might want to exclude the Account ID or user information.

Feel free to reach out to me if you have any comments or questions about the script.

About Me

Hello, I’m Tim Dietrich. I design and build custom software for businesses running on NetSuite — from mobile apps and Web portals to Web APIs and integrations.

I’ve created several widely used open-source solutions for the NetSuite community, including the SuiteQL Query Tool and SuiteAPI, which help developers and businesses get more out of their systems.

I’m also the founder of SuiteStep, a NetSuite development studio focused on pushing the boundaries of what’s possible on the platform. Through SuiteStep, I deliver custom software and AI-driven solutions that make NetSuite more powerful, accessible, and future-ready.

Copyright © 2025 Tim Dietrich.