Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

1.6 KB
Raw Blame
import { createAction, Property } from '@activepieces/pieces-framework';
import { HttpMethod } from '@activepieces/pieces-common';
import { aiprise } from '../common';
import { aipriseAuth } from '../common/auth';

export const getBusinessProfileAction = createAction({
  auth: aipriseAuth,
  name: 'get_business_profile',
  classification: 'READ',
  displayName: 'Get Business Profile',
  description:
    'Fetches a business profile from AiPrise by its ID — including the stored company details, addresses, tags, linked verification sessions, and metadata.',
  audience: 'both',
  aiMetadata: {
    description:
      'Fetches a single business (company) profile by its ID, returning the stored company details, addresses, tags, linked verification sessions, and metadata. Use this to read back a business profile you created or referenced. Requires the business_profile_id. Read-only and idempotent.',
    idempotent: true,
  },
  props: {
    business_profile_id: Property.ShortText({
      displayName: 'Business Profile ID',
      description:
        'The ID of the business profile to retrieve. You can get this from the output of the **Create Business Profile** action, or from the `business_profile_id` field in any webhook payload from AiPrise.',
      required: true,
    }),
  },
  async run(context) {
    const { business_profile_id } = context.propsValue;
    return aiprise.makeRequest<Record<string, unknown>>({
      auth: context.auth.props,
      method: HttpMethod.GET,
      path: `/verify/get_business_profile/${encodeURIComponent(business_profile_id)}`,
    });
  },
});