TwentyDEV icon

TwentyDEV

Consume the Twenty API

Actions252

Overview

This node operation allows you to create a new Opportunity record in the connected system via an API. It is useful for automating sales or CRM workflows where new sales opportunities need to be programmatically added based on external triggers or data sources.

Common scenarios include:

  • Automatically creating an opportunity when a lead reaches a certain stage.
  • Importing opportunities from other systems or spreadsheets.
  • Integrating with marketing automation tools to track potential deals.

For example, you could use this node to create an opportunity with details such as its name, expected close date, stage in the sales pipeline, associated company and contact, and financial amount.

Properties

Name Meaning
Depth Determines how much nested related object data to include in the response: 0 (only primary object), 1 (primary + directly related objects), or 2 (primary + related + related of related).
Created By JSON object specifying the creator of the opportunity record.
Close Date The expected closing date of the opportunity.
Stage The current stage of the opportunity in the sales process. 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 string for the company associated with the opportunity.
Amount JSON object representing the monetary amount related to the opportunity.
Point Of Contact Id Identifier string for the main contact person related to the opportunity.

Output

The node outputs a JSON object representing the newly created Opportunity record. This includes all fields sent during creation plus any additional metadata or related objects depending on the Depth parameter.

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential configured in n8n to authenticate requests to the target system's API.
  • The base URL for the API is set dynamically from credentials.
  • The node uses standard HTTP headers for JSON content type.

Troubleshooting

  • Invalid or missing required fields: Ensure mandatory properties like name and stage are provided and valid.
  • Authentication errors: Verify that the API key credential is correctly configured and has sufficient permissions.
  • Malformed JSON inputs: For properties expecting JSON (e.g., createdBy, amount), ensure the input is valid JSON format.
  • API connectivity issues: Check network access and correct base URL configuration.
  • Unexpected response structure: Adjust the Depth property if related objects are missing or too deeply nested.

Links and References

Discussion