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 { HttpMethod } from '@activepieces/pieces-common';
import { createAction, Property } from '@activepieces/pieces-framework';
import { proxycurlAuth } from '../../index';
import { proxycurlApiCall } from '../common/client';

export const lookupPersonEmailAction = createAction({
  name: 'lookup_person_email',
  displayName: 'Lookup Person Email',
  description: 'Lookup the work email address for a LinkedIn person profile.',
  audience: 'both',
  aiMetadata: { description: 'Resolve the work email address for a person from their LinkedIn profile URL via Proxycurl. Choose this when you have a profile URL and specifically need a contact email rather than the full profile. Requires the public LinkedIn profile URL; an optional callback URL receives an async completion webhook. Read-only lookup, safe to repeat.', idempotent: true },
  auth: proxycurlAuth,
  props: {
    linkedin_profile_url: Property.ShortText({
      displayName: 'LinkedIn Profile URL',
      description: 'Public LinkedIn profile URL to enrich.',
      required: true,
    }),
    callback_url: Property.ShortText({
      displayName: 'Callback URL',
      description: 'Optional webhook URL for async completion callbacks from Proxycurl.',
      required: false,
    }),
  },
  async run(context) {
    return proxycurlApiCall({
      apiKey: context.auth.secret_text,
      method: HttpMethod.GET,
      resourceUri: '/linkedin/profile/email',
      query: {
        linkedin_profile_url: context.propsValue.linkedin_profile_url,
        callback_url: context.propsValue.callback_url,
      },
    });
  },
});