New Attach and Detach Operations in REST Web Services
Discover new attach and detach operations for defining relationships between records in NetSuite's REST web services.
The new attach and detach operations in NetSuite's REST web services allow developers to define or remove relationships between two record instances. For instance, you can now associate a contact record with a partner record or a file record with an opportunity record, enhancing the integration capabilities.
How Do Attach and Detach Operations Work?
To attach or detach records, users must specify the record type and IDs in the request. The typical format for such operations uses the special action identifiers, !attach and !detach. As of now, these operations are limited to contact and file records only.
Example of Attaching a Record
Here’s how to attach a contact record instance to a customer record instance:
1POST .../services/rest/record/v1/customer/660/!attach/contact/1062 3Content-Type: application/json4{5 "role": {6 "id": "-10"7 }8}This example shows the inclusion of an optional role attribute, though the request body can also be empty if there are no optional attributes to set.
Example of Attaching a File Record
To attach a file record to an opportunity record, you would use:
POST .../services/rest/record/v1/opportunity/379/!attach/file/398 Content-Type: application/json{}Key Considerations
- Only contact and file records can be attached or detached using this operation.
- This functionality streamlines the process of managing relationships within your NetSuite account, improving data consistency and usability.
Who This Affects
- Developers: Key enhancements for REST API integrations.
- Administrators: Improved ability to manage records and relationships dynamically through the API.
By effectively utilizing these attach and detach operations, developers can create more robust integrations, enhancing how record interactions are handled within NetSuite.
Key Takeaways
- New attach and detach operations allow defining or removing record relationships.
- Currently applicable only for contact and file records.
- Enhances the integration capabilities of your NetSuite instance, enabling more dynamic data management.
Source: This article is based on Oracle's official NetSuite documentation.
Frequently Asked Questions (4)
Are the new attach and detach operations available for all records in NetSuite?
Do I need to modify the request body when attaching a contact with a specific role?
Can I use external IDs with the attach and detach operations in REST Web Services?
What URL pattern is used for attach and detach operations in REST Web Services?
Weekly Update History (1)
Updated 2025.2 SOAP Schema Browser that the 2025.2 SOAP Schema Browser is now available.
View Oracle DocsWas this article helpful?
More in REST Web Services
- NetSuite Tool Permissions: Visibility and Access Essentials
Explore NetSuite MCP Standard Tools permissions affecting tool visibility.
- New Attach and Detach Operations in REST Web Services - NetSuite
New attach and detach operations in NetSuite 2026.1 allow record relationships with REST Web Services, enhancing data integration.
Advertising
Reach REST Web Services Professionals
Put your product in front of NetSuite experts who work with REST Web Services every day.
Sponsor This Category