# ApexVerify - Email/Phone B2B Data Verification — ApexVerify

> Verify a single email address or phone number using ApexVerify. See the documentation

- Key: `apexverify-unit-verification`
- Type: Action (Write)
- Version: 0.0.2
- App: ApexVerify (`apexverify`) — https://pipedream.com/apps/apexverify.md
- This page (HTML): https://pipedream.com/apps/apexverify/actions/unit-verification
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/apexverify/actions/unit-verification/unit-verification.mjs

## Description

Verify a single email address or phone number using ApexVerify. [See the documentation](https://documentation.apexverify.com/api-reference/apex-verify-api/unit)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `type` | `string` | Yes | Which kind of contact data is being verified. Allowed values: email (verify an email address) or phone (verify a phone number). The value of unit must match this type — pass email here when unit is an email address, and phone when unit is a phone number. |
| `unit` | `string` | Yes | The single email address or phone number to verify. Format must match type: for type=email, pass a full RFC 5322 email like jane.doe@example.com. For type=phone, pass a number in E.164 format with the leading + and country code — e.g. +14155552671 (US) or +442071234567 (UK). Hyphens and spaces are tolerated but not required. Only one address/number per call. |
| `targetCountry` | `string` | Yes | Country against which the email or phone should be processed. |
| `targetAudience` | `string` | No | Optional target audience context for the verification. Accepted values include 1 for Agency / Consultants, 4 for Developers & Technical Leads, 8 for Founders & C-Level Executives, and 17 for Marketing & Sales Professionals. |
| `targetMarketIndustry` | `string` | No | Optional market industry context for the verification. Accepted values include 18 for Construction, 29 for Finance and Insurance, 42 for Health Care and Social Assistance, 46 for Information, and 91 for Retail Trade. |
| `targetObjective` | `string` | No | Optional campaign or business objective context for the verification. Accepted values include 4 for Customer Acquisition / Sales, 6 for Lead Generation (Top/Mid-Funnel), 12 for Sales-Ready Leads, and 16 for Website / App Traffic Acquisition. |
| `useAccountCache` | `boolean` | No | Use previous verification results from your ApexVerify account cache when available. |
| `maxAccountCacheBackoff` | `integer` | No | Maximum number of days to look back in account cache. Min: 1. Max: 180. |
| `useGlobalCache` | `boolean` | No | Use anonymized global cache results when available. |
| `maxGlobalCacheBackoff` | `integer` | No | Maximum number of days to look back in global cache. Min: 1. Max: 180. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "apexverify",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "apexverify-unit-verification",
  arguments: {
    type: "Data Type",
    unit: "Email or Phone to Verify",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "apexverify-unit-verification",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    apexverify: { authProvisionId: "apn_xxxxxxx" },
    type: "Data Type",
    unit: "Email or Phone to Verify",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "apexverify-unit-verification",
    "configured_props": {
      "apexverify": { "authProvisionId": "apn_xxxxxxx" },
      "type": "Data Type",
      "unit": "Email or Phone to Verify"
    }
  }'
```

---

- App: https://pipedream.com/apps/apexverify.md · All apps: https://pipedream.com/apps
