New Attach and Detach Operations in REST Web Services - NetSuite

Discover new attach and detach operations for defining relationships in REST Web Services in NetSuite 2026.1, improving data connectivity.

·2 min read·NetSuite 2026.1·View Oracle Docs

Starting in NetSuite 2026.1, the REST Web Services now support new operations for attaching and detaching records, allowing users to easily define or remove relationships between record instances. This enhancement simplifies the integration process for developers and improves the management of data relations in NetSuite, particularly for contact and file records.

Overview of Attach and Detach Operations

The new attach and detach operations enable developers to connect two records by defining relationships programmatically. For instance, you can attach a contact to a partner record or a file to an opportunity record. Currently, these operations are limited to contact and file records, but they offer a streamlined method for managing relationships within the system.

How to Use Attach and Detach Operations

These operations are executed using specific URL actions within the REST Web Services framework. The syntax generally follows this pattern:

/services/rest/record/v1/{recordType}/{recordId}/!{operation}/{relatedRecordType}/{relatedRecordId}
  • Attach a Record: To add a relationship (attach), you would use the !attach action in your URL. For example:
POST /services/rest/record/v1/customer/660/!attach/contact/106
  • Detach a Record: To remove an existing relationship (detach), replace !attach with !detach. For example:
POST /services/rest/record/v1/customer/660/!detach/contact/106

Request Body and Attributes

When attaching records, the request body can include optional attributes, such as record roles. For example, when attaching a contact, you can specify their role:

POST /services/rest/record/v1/customer/660/!attach/contact/106
Content-Type: application/json
{
  "role": {
    "id": "-10"
  }
}

Alternatively, you may send an empty request body if no optional attributes are needed:

POST /services/rest/record/v1/opportunity/379/!attach/file/398
Content-Type: application/json
{}

External ID Support

The attach and detach operations are also compatible with external IDs, allowing for more flexibility when managing relationships with external systems.

Who This Affects

  • Developers: Leveraging the new attach and detach capabilities in integrations.
  • Administrators: Managing and overseeing the relationships between records.
  • Accountants and CRM Users: Utilizing improved functionalities for data management related to customers and opportunities.

Key Takeaways

  • New attach and detach operations in REST Web Services enhance record relationship management in NetSuite.
  • Support is currently limited to contact and file records.
  • Developers can easily establish or remove links using POST requests with specific URL formats.
  • Optional attributes can customize the relationship, such as specifying roles for contacts.
  • Operations support external IDs for greater integration versatility.

Frequently Asked Questions (4)

Are the new attach and detach operations available for all records in NetSuite?
No, the new attach and detach operations are currently limited to contact and file records.
Do I need to modify the request body when attaching a contact with a specific role?
Yes, when attaching a contact with a specific role, you should include the 'role' attribute in the JSON request body.
Can I use external IDs with the attach and detach operations in REST Web Services?
Yes, these operations support external IDs, providing flexibility in managing relationships with external systems.
What URL pattern is used for attach and detach operations in REST Web Services?
The URL pattern is /services/rest/record/v1/{recordType}/{recordId}/!{operation}/{relatedRecordType}/{relatedRecordId}. Replace '{operation}' with '!attach' or '!detach' to perform the respective action.

Weekly Update History (1)

SuiteTalk Web Servicesupdated

Updated 2025.2 SOAP Schema Browser that the 2025.2 SOAP Schema Browser is now available.

View Oracle Docs
Source: New Attach and Detach Operations in REST Web Services Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?