TwentyDEV icon

TwentyDEV

Consume the Twenty API

Actions252

Overview

This node allows you to retrieve detailed information about a single Opportunity object from an external service via its unique identifier. It is useful when you need to fetch specific data about one opportunity, such as in sales or CRM workflows where you want to display or process details of a particular deal.

For example, you might use this node to:

  • Fetch the current status and related data of a specific sales opportunity by its ID.
  • Retrieve nested related objects (like contacts or activities linked to the opportunity) up to two levels deep for comprehensive reporting or automation.

Properties

Name Meaning
Id The unique identifier of the Opportunity object you want to find.
Depth Determines how much related data to include:
- 0: Only the primary Opportunity data.
- 1: Primary Opportunity plus directly related objects.
- 2: Primary Opportunity, directly related objects, and their related objects.

Output

The node outputs a JSON object representing the Opportunity found by the given ID. The structure includes the Opportunity's fields and, depending on the Depth parameter, nested related objects up to two levels deep. This enables access to both the core Opportunity data and its associated entities in a single response.

If the API supports binary data for any related content, it would be included accordingly, but based on the provided code and properties, the output focuses on JSON data.

Dependencies

  • Requires an API key credential to authenticate requests to the external service hosting the Opportunity data.
  • The base URL for the API is configured via credentials.
  • The node uses an OpenAPI specification internally to build request properties and handle communication.

Troubleshooting

  • Invalid or missing Id: If the Id property is empty or incorrect, the node will fail to find the Opportunity. Ensure the ID is valid and corresponds to an existing record.
  • Authentication errors: Missing or invalid API credentials will cause authentication failures. Verify that the API key or token is correctly set up in the node credentials.
  • Depth parameter misuse: Setting an unsupported depth value may result in unexpected responses or errors. Use only 0, 1, or 2 as specified.
  • Network or API issues: Connectivity problems or API downtime can cause request failures. Check network access and API status if errors occur.

Links and References

  • Refer to the external service’s API documentation for detailed schema of Opportunity objects and related entities.
  • Consult n8n documentation on setting up API credentials and using HTTP request nodes for additional context.

Discussion