NetSuite REST icon

NetSuite REST

Call NetSuite SuiteTalk REST operations.

Actions979

Email Template → Insert or update record

AI-generated

Summary

Create or replace a NetSuite Email Template via the REST API; sends a POST for a new record or a PUT if an ID is provided, returning the saved template data and optional request/response details.

Inputs

  • isDebugMode — If true, the output includes full HTTP request and response information.
  • id — External identifier of an existing Email Template to update; leave blank to create a new template.
  • additionalFields — Fields that map to properties of the Email Template record, such as content, name, subject, scriptid, etc. Provide any subset of the available properties; omitted fields are left unchanged during update.
  • customFields — User‑defined fields on the Email Template record; each item requires a field name, type, and value. These are sent as sub‑objects in the request body.
  • Prefer — Optional header to request asynchronous execution (respond‑async).

Output shape

Array of objects containing the created/updated Email Template record properties. If isDebugMode is true, each item additionally contains a "debug" object with full HTTP request and response data.

The response includes all fields returned by NetSuite, which may include internal identifiers and system defaults. Pagination is not applicable for single record operations.

Examples

Example 1: Insert a new email template

Set resource to 'Email Template', operation to 'Insert or update record', leave id empty; fill content, name and subject in Additional Fields. Disable debug mode.

Example 2: Update an existing template

Provide the external id of the template in the Id field, change the subject via Additional Fields. Disable debug mode.

Example 3: Debug the request and response

Enable Debug Mode, provide any of the fields above. The output will include HTTP request and response bodies and headers detailing the API call.

Discussion