TwentyDEV icon

TwentyDEV

Consume the Twenty API

Actions252

Overview

This node operation allows users to create multiple "Opportunity" records in bulk. It is useful when you need to add many sales opportunities at once into a system that tracks potential deals or sales leads. For example, a sales team importing a list of new leads from a marketing campaign can use this operation to quickly populate their CRM with all the new opportunities.

Properties

Name Meaning
Depth Determines how much related nested data is included in the response:
- 0: Only the primary opportunity object.
- 1: The opportunity plus its directly related objects.
- 2: The opportunity, its related objects, and their related objects.
Body JSON representation of an opportunity to create. This includes fields like stage (e.g., "NEW"), name (the opportunity's name), and amount (with subfields for amount in micros and currency code). Multiple such objects can be sent to create many opportunities.

Output

The output JSON contains the created opportunity objects, including any nested related objects depending on the selected depth level. Each opportunity will reflect the data as stored after creation, potentially enriched with IDs or additional metadata assigned by the backend system.

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

Dependencies

  • Requires an API key credential or similar authentication token configured in n8n to authorize requests to the external service managing opportunities.
  • The node uses a base URL provided via credentials to send HTTP requests.
  • The request content type is JSON, and responses are expected in JSON format.

Troubleshooting

  • Invalid JSON in Body: If the JSON provided in the "Body" property is malformed, the node will fail to parse it. Ensure the JSON syntax is correct.
  • Authentication Errors: Missing or invalid API credentials will cause authorization failures. Verify that the API key or token is correctly set up in n8n credentials.
  • Depth Parameter Misuse: Setting an unsupported depth value may result in unexpected responses or errors. Use only 0, 1, or 2 as specified.
  • API Limits or Quotas: Creating many opportunities at once might hit rate limits or payload size restrictions imposed by the external API. Consider batching requests if errors occur.

Links and References

  • No direct links available from the source code. For more details, consult the documentation of the external API managing opportunities or the n8n community forums for usage examples.

Discussion