The Companies API icon

The Companies API

Access company data, enrichment, analytics and more using The Companies API

Overview

This node interacts with "The Companies API" to fetch action records related to company data enrichment and job requests. Specifically, the Fetch actions operation retrieves a list of actions filtered by various criteria such as search terms, status, type, pagination, and identifiers.

Common scenarios where this node is beneficial include:

  • Monitoring the status of asynchronous enrichment jobs or data requests.
  • Retrieving completed or pending actions for auditing or reporting purposes.
  • Filtering actions by type (e.g., job requests or companies added) to analyze workflow progress.
  • Paginating through large sets of action records efficiently.

Practical example:

  • A user wants to fetch all completed job request actions from the last week to verify which enrichments succeeded.
  • Another use case is fetching failed actions to trigger retries or alerting mechanisms.

Properties

Name Meaning
Search A string to filter actions by a search term.
Full Boolean flag indicating whether to fetch full details of each action.
Page Number specifying the page of results to retrieve (pagination).
Size Number specifying how many actions to return per page.
Ids List of specific action IDs to fetch.
Status Filter actions by their status. Options: Active, Completed, Failed, Pending.
Type Filter actions by type. Options: Jobs:request, Companies:added.
List ID Numeric identifier to filter actions associated with a specific list.
Team ID Numeric identifier to filter actions associated with a specific team.

Output

The node outputs an array of JSON objects representing the fetched actions. Each object contains detailed information about an action, including its metadata and status.

  • The json output field holds the action data returned by the API.
  • If multiple input items are processed, the output pairs each result with the corresponding input item.
  • No binary data output is produced by this node.

Dependencies

  • Requires an API token credential for authenticating with The Companies API.
  • Uses the official SDK client from @thecompaniesapi/sdk.
  • The node expects proper configuration of the API token in n8n credentials.

Troubleshooting

  • Unknown operation error: If the operation parameter is incorrect or unsupported, the node throws an error stating "Unknown operation". Ensure the operation name is exactly "fetchActions" when using this functionality.
  • SDK method not found: If the SDK does not have the expected method, an error "SDK method ... not found" will occur. This indicates a mismatch between the node's operation and the SDK version.
  • Empty or invalid parameters: Passing empty strings or zero values for parameters may cause unexpected behavior. The node attempts to apply default values but verify inputs carefully.
  • API authentication errors: Invalid or missing API tokens will cause authentication failures. Confirm that the API token credential is correctly set up.
  • Pagination issues: Requesting pages beyond available data returns empty results; adjust page and size accordingly.

Links and References

Discussion