Filter Set Cache Refresh

When using an OAuth 2.0 access token to authenticate API requests, the API uses cached filter set information —information about objects which the authenticated user can access according to the filter set assigned to that user— to optimize performance. By default, read requests using a valid access token do not include objects created after the access token was issued, even if the user can access the new objects in the UI. If new objects are expected, you can clear and regenerate the cached filter set information.

To clear and regenerate the filter set cache, send a POST request to the filter set cache refresh endpoint. Subsequent GET requests to resource endpoints return the latest available data including any objects that were created recently.

Important:

Use requests to the filter set cache refresh endpoint sparingly to avoid performance deterioration. After you send a request to the filter set cache refresh endpoint, you should not send any further request to this endpoint unless you expect objects created after the filter set information cache was last generated in the response.

Each access token scope has its own filter set caching mechanism. If using the same access token with the REST, XML and SOAP API in your integration, clearing the cache for REST API requests does not clear the cache for XML API and SOAP API requests.

Request URL

https://<account-domain>/rest/v1/session/cache/refresh

Where:

  • <account-domain> is your account-specific domain. For more information about your account-specific domain, see Your Account URLs.

  • /rest/v1 is the service path for the REST API.

  • /session/cache/refresh is the path for the filter set cache refresh endpoint.

Request Headers

The request headers include:

  • Host — The account-specific domain is typically sent in the Host header.

  • Authorization — Requests must include the OAuth 2.0 bearer token in the Authorization header. See Authentication.

  • Content-Type — JSON ( application/json)

Request Body

The POST request must include the following JSON-encoded string as request body:

{"filterSet": true} 

Example

The following example clears and regenerates the cached filter set information.

POST /rest/v1/session/cache/refresh HTTP/1.1
Host: company-id.app.netsuitesuiteprojectspro.com
Content-Type: application/json
Authorization: Bearer <OAuth2_access_token>

{"filterSet": true}