TwentyDEV icon

TwentyDEV

Consume the Twenty API

Actions252

Overview

This node operation updates a single Opportunity record in an external system via an API. It allows users to modify various fields of an existing opportunity, such as its name, stage, close date, amount, and related entities like company or point of contact. This is useful in sales automation workflows where opportunity details need to be kept current based on new information or progress in the sales pipeline.

Practical examples include:

  • Automatically updating the stage of an opportunity when a sales call is completed.
  • Adjusting the expected close date or amount after negotiations.
  • Changing the assigned point of contact or company linked to the opportunity.

Properties

Name Meaning
Id The unique identifier of the opportunity to update (required).
Depth Level of nested related objects to include in the response: 0 = only primary object, 1 = primary + directly related, 2 = primary + related + related of related.
Created By JSON object representing the creator of the record.
Close Date The date when the opportunity is expected to close.
Stage Current stage of the opportunity. Options: NEW, SCREENING, MEETING, PROPOSAL, CUSTOMER.
Position Numeric position or order of the opportunity record.
Name The name/title of the opportunity.
Company Id Identifier of the company associated with the opportunity.
Amount JSON object representing the monetary amount related to the opportunity.
Point Of Contact Id Identifier of the main contact person for the opportunity.

Output

The node outputs a JSON object representing the updated Opportunity record. The structure includes all fields sent in the update plus any additional data returned by the API, potentially including nested related objects depending on the Depth parameter.

If binary data were involved (not indicated here), it would typically represent attachments or files related to the opportunity, but this node focuses on JSON data only.

Dependencies

  • Requires an API key credential for authenticating requests to the external service managing Opportunities.
  • The base URL and authentication details must be configured in the node credentials.
  • The node uses HTTP requests with JSON payloads to interact with the API.

Troubleshooting

  • Missing or invalid Id: The update will fail if the Id property is not provided or does not correspond to an existing opportunity. Ensure the correct ID is used.
  • Invalid JSON in properties like Created By or Amount: These fields expect valid JSON strings; malformed JSON will cause errors. Validate JSON formatting before input.
  • API authentication errors: Check that the API key credential is correctly set up and has sufficient permissions.
  • Unsupported stage values: Only the predefined stages are accepted; using other values may result in validation errors.
  • Network or timeout issues: Ensure network connectivity and that the API endpoint is reachable.

Links and References

  • Refer to the external API documentation for Opportunities management for detailed field definitions and constraints.
  • JSON validation tools can help ensure proper formatting of complex fields like Created By and Amount.

Discussion