Skip to content

Commit ff98127

Browse files
committed
validate
1 parent d124189 commit ff98127

10 files changed

Lines changed: 122 additions & 25 deletions

File tree

apps/docs/content/docs/en/tools/apollo.mdx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,16 @@ Enrich data for a single person using Apollo
8181
| `apiKey` | string | Yes | Apollo API key |
8282
| `first_name` | string | No | First name of the person |
8383
| `last_name` | string | No | Last name of the person |
84+
| `name` | string | No | Full name of the person \(alternative to first_name/last_name\) |
85+
| `id` | string | No | Apollo ID for the person |
86+
| `hashed_email` | string | No | MD5 or SHA-256 hashed email |
8487
| `email` | string | No | Email address of the person |
8588
| `organization_name` | string | No | Company name where the person works |
8689
| `domain` | string | No | Company domain \(e.g., "apollo.io", "acme.com"\) |
8790
| `linkedin_url` | string | No | LinkedIn profile URL |
8891
| `reveal_personal_emails` | boolean | No | Reveal personal email addresses \(uses credits\) |
89-
| `reveal_phone_number` | boolean | No | Reveal phone numbers \(uses credits\) |
92+
| `reveal_phone_number` | boolean | No | Reveal phone numbers \(uses credits, requires webhook_url\) |
93+
| `webhook_url` | string | No | Webhook URL for async phone number delivery \(required when reveal_phone_number is true\) |
9094

9195
#### Output
9296

@@ -106,7 +110,8 @@ Enrich data for up to 10 people at once using Apollo
106110
| `apiKey` | string | Yes | Apollo API key |
107111
| `people` | array | Yes | Array of people to enrich \(max 10\) |
108112
| `reveal_personal_emails` | boolean | No | Reveal personal email addresses \(uses credits\) |
109-
| `reveal_phone_number` | boolean | No | Reveal phone numbers \(uses credits\) |
113+
| `reveal_phone_number` | boolean | No | Reveal phone numbers \(uses credits, requires webhook_url\) |
114+
| `webhook_url` | string | No | Webhook URL for async phone number delivery \(required when reveal_phone_number is true\) |
110115

111116
#### Output
112117

@@ -397,14 +402,16 @@ Search your team
397402

398403
### `apollo_account_bulk_create`
399404

400-
Create up to 100 accounts at once in your Apollo database. Note: Apollo does not apply deduplication - duplicate accounts may be created if entries share similar names or domains. Master key required.
405+
Create up to 100 accounts at once in your Apollo database. Set run_dedupe=true to deduplicate by domain, organization_id, and name. Master key required.
401406

402407
#### Input
403408

404409
| Parameter | Type | Required | Description |
405410
| --------- | ---- | -------- | ----------- |
406411
| `apiKey` | string | Yes | Apollo API key \(master key required\) |
407-
| `accounts` | array | Yes | Array of accounts to create \(max 100\). Each account should include name \(required\), and optionally website_url, phone, owner_id |
412+
| `accounts` | array | Yes | Array of accounts to create \(max 100\). Each account should include name \(required\), and optionally domain, phone, owner_id |
413+
| `append_label_names` | array | No | Array of label names to add to ALL accounts in this request |
414+
| `run_dedupe` | boolean | No | When true, performs aggressive deduplication by domain, organization_id, and name \(defaults to false\) |
408415

409416
#### Output
410417

@@ -429,6 +436,7 @@ Update up to 1000 existing accounts at once in your Apollo database (higher limi
429436
| `name` | string | No | When using account_ids, apply this name to all accounts |
430437
| `owner_id` | string | No | When using account_ids, apply this owner to all accounts |
431438
| `account_attributes` | json | No | Array of account objects with individual updates \(each must include id\). Example: \[\{"id": "acc1", "name": "Acme", "owner_id": "u1", "account_stage_id": "s1", "typed_custom_fields": \{"field_id": "value"\}\}\] |
439+
| `async` | boolean | No | When true, processes the update asynchronously. Only supported when using account_ids; returns 422 if used with account_attributes. |
432440

433441
#### Output
434442

@@ -590,9 +598,9 @@ Create one or more tasks in Apollo (one task per contact_id, master key required
590598
| `apiKey` | string | Yes | Apollo API key \(master key required\) |
591599
| `user_id` | string | Yes | ID of the Apollo user the task is assigned to |
592600
| `contact_ids` | array | Yes | Array of contact IDs. One task is created per contact. |
593-
| `priority` | string | No | Task priority: "high", "medium", or "low" \(defaults to "medium"\) |
601+
| `priority` | string | Yes | Task priority: "high", "medium", or "low" |
594602
| `due_at` | string | Yes | Due date/time in ISO 8601 format \(e.g., "2024-12-31T23:59:59Z"\) |
595-
| `type` | string | Yes | Task type: "call", "outreach_manual_email", "linkedin_step_message", or "action_item" |
603+
| `type` | string | Yes | Task type: "call", "outreach_manual_email", or "action_item" |
596604
| `status` | string | Yes | Task status: "scheduled", "completed", or "archived" |
597605
| `note` | string | No | Free-form note providing context for the task |
598606

apps/sim/app/(landing)/integrations/data/integrations.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@
862862
},
863863
{
864864
"name": "Bulk Create Accounts",
865-
"description": "Create up to 100 accounts at once in your Apollo database. Note: Apollo does not apply deduplication - duplicate accounts may be created if entries share similar names or domains. Master key required."
865+
"description": "Create up to 100 accounts at once in your Apollo database. Set run_dedupe=true to deduplicate by domain, organization_id, and name. Master key required."
866866
},
867867
{
868868
"name": "Bulk Update Accounts",

apps/sim/tools/apollo/account_bulk_create.ts

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const apolloAccountBulkCreateTool: ToolConfig<
1111
id: 'apollo_account_bulk_create',
1212
name: 'Apollo Bulk Create Accounts',
1313
description:
14-
'Create up to 100 accounts at once in your Apollo database. Note: Apollo does not apply deduplication - duplicate accounts may be created if entries share similar names or domains. Master key required.',
14+
'Create up to 100 accounts at once in your Apollo database. Set run_dedupe=true to deduplicate by domain, organization_id, and name. Master key required.',
1515
version: '1.0.0',
1616

1717
params: {
@@ -26,7 +26,20 @@ export const apolloAccountBulkCreateTool: ToolConfig<
2626
required: true,
2727
visibility: 'user-or-llm',
2828
description:
29-
'Array of accounts to create (max 100). Each account should include name (required), and optionally website_url, phone, owner_id',
29+
'Array of accounts to create (max 100). Each account should include name (required), and optionally domain, phone, owner_id',
30+
},
31+
append_label_names: {
32+
type: 'array',
33+
required: false,
34+
visibility: 'user-only',
35+
description: 'Array of label names to add to ALL accounts in this request',
36+
},
37+
run_dedupe: {
38+
type: 'boolean',
39+
required: false,
40+
visibility: 'user-or-llm',
41+
description:
42+
'When true, performs aggressive deduplication by domain, organization_id, and name (defaults to false)',
3043
},
3144
},
3245

@@ -38,9 +51,16 @@ export const apolloAccountBulkCreateTool: ToolConfig<
3851
'Cache-Control': 'no-cache',
3952
'X-Api-Key': params.apiKey,
4053
}),
41-
body: (params: ApolloAccountBulkCreateParams) => ({
42-
accounts: params.accounts.slice(0, 100),
43-
}),
54+
body: (params: ApolloAccountBulkCreateParams) => {
55+
const body: Record<string, unknown> = {
56+
accounts: params.accounts.slice(0, 100),
57+
}
58+
if (params.append_label_names?.length) {
59+
body.append_label_names = params.append_label_names
60+
}
61+
if (params.run_dedupe !== undefined) body.run_dedupe = params.run_dedupe
62+
return body
63+
},
4464
},
4565

4666
transformResponse: async (response: Response) => {

apps/sim/tools/apollo/account_bulk_update.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ export const apolloAccountBulkUpdateTool: ToolConfig<
4747
description:
4848
'Array of account objects with individual updates (each must include id). Example: [{"id": "acc1", "name": "Acme", "owner_id": "u1", "account_stage_id": "s1", "typed_custom_fields": {"field_id": "value"}}]',
4949
},
50+
async: {
51+
type: 'boolean',
52+
required: false,
53+
visibility: 'user-only',
54+
description:
55+
'When true, processes the update asynchronously. Only supported when using account_ids; returns 422 if used with account_attributes.',
56+
},
5057
},
5158

5259
request: {
@@ -87,6 +94,7 @@ export const apolloAccountBulkUpdateTool: ToolConfig<
8794
'Apollo account bulk update requires account_ids (with name/owner_id) or account_attributes (with embedded ids).'
8895
)
8996
}
97+
if (params.async !== undefined) body.async = params.async
9098
return body
9199
},
92100
},

apps/sim/tools/apollo/organization_enrich.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ export const apolloOrganizationEnrichTool: ToolConfig<
3030

3131
request: {
3232
url: (params: ApolloOrganizationEnrichParams) => {
33-
if (!params.domain) {
33+
const domain = params.domain?.trim()
34+
if (!domain) {
3435
throw new Error('domain is required for organization enrichment')
3536
}
36-
return `https://api.apollo.io/api/v1/organizations/enrich?domain=${encodeURIComponent(params.domain.trim())}`
37+
return `https://api.apollo.io/api/v1/organizations/enrich?domain=${encodeURIComponent(domain)}`
3738
},
3839
method: 'GET',
3940
headers: (params: ApolloOrganizationEnrichParams) => ({

apps/sim/tools/apollo/people_bulk_enrich.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@ export const apolloPeopleBulkEnrichTool: ToolConfig<
3636
type: 'boolean',
3737
required: false,
3838
visibility: 'user-only',
39-
description: 'Reveal phone numbers (uses credits)',
39+
description: 'Reveal phone numbers (uses credits, requires webhook_url)',
40+
},
41+
webhook_url: {
42+
type: 'string',
43+
required: false,
44+
visibility: 'user-only',
45+
description:
46+
'Webhook URL for async phone number delivery (required when reveal_phone_number is true)',
4047
},
4148
},
4249

@@ -49,6 +56,9 @@ export const apolloPeopleBulkEnrichTool: ToolConfig<
4956
if (params.reveal_phone_number !== undefined) {
5057
qs.set('reveal_phone_number', String(params.reveal_phone_number))
5158
}
59+
if (params.webhook_url) {
60+
qs.set('webhook_url', params.webhook_url)
61+
}
5262
const query = qs.toString()
5363
return `https://api.apollo.io/api/v1/people/bulk_match${query ? `?${query}` : ''}`
5464
},

apps/sim/tools/apollo/people_enrich.ts

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,24 @@ export const apolloPeopleEnrichTool: ToolConfig<
2929
visibility: 'user-or-llm',
3030
description: 'Last name of the person',
3131
},
32+
name: {
33+
type: 'string',
34+
required: false,
35+
visibility: 'user-or-llm',
36+
description: 'Full name of the person (alternative to first_name/last_name)',
37+
},
38+
id: {
39+
type: 'string',
40+
required: false,
41+
visibility: 'user-or-llm',
42+
description: 'Apollo ID for the person',
43+
},
44+
hashed_email: {
45+
type: 'string',
46+
required: false,
47+
visibility: 'user-or-llm',
48+
description: 'MD5 or SHA-256 hashed email',
49+
},
3250
email: {
3351
type: 'string',
3452
required: false,
@@ -63,7 +81,14 @@ export const apolloPeopleEnrichTool: ToolConfig<
6381
type: 'boolean',
6482
required: false,
6583
visibility: 'user-only',
66-
description: 'Reveal phone numbers (uses credits)',
84+
description: 'Reveal phone numbers (uses credits, requires webhook_url)',
85+
},
86+
webhook_url: {
87+
type: 'string',
88+
required: false,
89+
visibility: 'user-only',
90+
description:
91+
'Webhook URL for async phone number delivery (required when reveal_phone_number is true)',
6792
},
6893
},
6994

@@ -76,6 +101,9 @@ export const apolloPeopleEnrichTool: ToolConfig<
76101
if (params.reveal_phone_number !== undefined) {
77102
qs.set('reveal_phone_number', String(params.reveal_phone_number))
78103
}
104+
if (params.webhook_url) {
105+
qs.set('webhook_url', params.webhook_url)
106+
}
79107
const query = qs.toString()
80108
return `https://api.apollo.io/api/v1/people/match${query ? `?${query}` : ''}`
81109
},
@@ -90,7 +118,10 @@ export const apolloPeopleEnrichTool: ToolConfig<
90118

91119
if (params.first_name) body.first_name = params.first_name
92120
if (params.last_name) body.last_name = params.last_name
121+
if (params.name) body.name = params.name
93122
if (params.email) body.email = params.email
123+
if (params.hashed_email) body.hashed_email = params.hashed_email
124+
if (params.id) body.id = params.id
94125
if (params.organization_name) body.organization_name = params.organization_name
95126
if (params.domain) body.domain = params.domain
96127
if (params.linkedin_url) body.linkedin_url = params.linkedin_url

apps/sim/tools/apollo/sequence_add_contacts.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,16 @@ export const apolloSequenceAddContactsTool: ToolConfig<
136136

137137
const data = await response.json()
138138

139-
const added = Array.isArray(data?.contacts?.added) ? data.contacts.added : []
140-
const skipped = Array.isArray(data?.contacts?.skipped) ? data.contacts.skipped : []
139+
// Apollo's response shape for this endpoint varies: some payloads return a flat
140+
// `contacts: [...]` array of successfully added contacts, others wrap under
141+
// `contacts: { added, skipped }`. Handle both defensively.
142+
const contactsField = data?.contacts
143+
const added = Array.isArray(contactsField)
144+
? contactsField
145+
: Array.isArray(contactsField?.added)
146+
? contactsField.added
147+
: []
148+
const skipped = Array.isArray(contactsField?.skipped) ? contactsField.skipped : []
141149
const rawSkippedIds = data?.skipped_contact_ids
142150
const skippedIds =
143151
Array.isArray(rawSkippedIds) || (rawSkippedIds && typeof rawSkippedIds === 'object')

apps/sim/tools/apollo/task_create.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ export const apolloTaskCreateTool: ToolConfig<ApolloTaskCreateParams, ApolloTask
2828
},
2929
priority: {
3030
type: 'string',
31-
required: false,
31+
required: true,
3232
visibility: 'user-or-llm',
33-
description: 'Task priority: "high", "medium", or "low" (defaults to "medium")',
33+
description: 'Task priority: "high", "medium", or "low"',
3434
},
3535
due_at: {
3636
type: 'string',
@@ -42,8 +42,7 @@ export const apolloTaskCreateTool: ToolConfig<ApolloTaskCreateParams, ApolloTask
4242
type: 'string',
4343
required: true,
4444
visibility: 'user-or-llm',
45-
description:
46-
'Task type: "call", "outreach_manual_email", "linkedin_step_message", or "action_item"',
45+
description: 'Task type: "call", "outreach_manual_email", or "action_item"',
4746
},
4847
status: {
4948
type: 'string',
@@ -71,11 +70,11 @@ export const apolloTaskCreateTool: ToolConfig<ApolloTaskCreateParams, ApolloTask
7170
const body: Record<string, unknown> = {
7271
user_id: params.user_id,
7372
contact_ids: params.contact_ids,
73+
priority: params.priority || 'medium',
7474
due_at: params.due_at,
7575
type: params.type,
7676
status: params.status,
7777
}
78-
if (params.priority) body.priority = params.priority
7978
if (params.note) body.note = params.note
8079
return body
8180
},
@@ -87,9 +86,13 @@ export const apolloTaskCreateTool: ToolConfig<ApolloTaskCreateParams, ApolloTask
8786
throw new Error(`Apollo API error: ${response.status} - ${errorText}`)
8887
}
8988

90-
const data = await response.json()
89+
const data = await response.json().catch(() => null)
9190
const tasks = Array.isArray(data?.tasks) ? data.tasks : []
92-
const created = data?.success === true || tasks.length > 0
91+
const created =
92+
data === true ||
93+
data?.success === true ||
94+
tasks.length > 0 ||
95+
(response.status >= 200 && response.status < 300)
9396

9497
return {
9598
success: true,

apps/sim/tools/apollo/types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,16 @@ export interface ApolloPeopleSearchResponse extends ToolResponse {
145145
export interface ApolloPeopleEnrichParams extends ApolloBaseParams {
146146
first_name?: string
147147
last_name?: string
148+
name?: string
149+
id?: string
150+
hashed_email?: string
148151
organization_name?: string
149152
email?: string
150153
domain?: string
151154
linkedin_url?: string
152155
reveal_personal_emails?: boolean
153156
reveal_phone_number?: boolean
157+
webhook_url?: string
154158
}
155159

156160
export interface ApolloPeopleEnrichResponse extends ToolResponse {
@@ -175,6 +179,7 @@ export interface ApolloPeopleBulkEnrichParams extends ApolloBaseParams {
175179
}>
176180
reveal_personal_emails?: boolean
177181
reveal_phone_number?: boolean
182+
webhook_url?: string
178183
}
179184

180185
export interface ApolloPeopleBulkEnrichResponse extends ToolResponse {
@@ -425,6 +430,8 @@ export interface ApolloAccountBulkCreateParams extends ApolloBaseParams {
425430
phone?: string
426431
owner_id?: string
427432
}>
433+
append_label_names?: string[]
434+
run_dedupe?: boolean
428435
}
429436

430437
export interface ApolloAccountBulkCreateResponse extends ToolResponse {
@@ -443,6 +450,7 @@ export interface ApolloAccountBulkUpdateParams extends ApolloBaseParams {
443450
name?: string
444451
owner_id?: string
445452
account_attributes?: Array<{ id: string; [key: string]: unknown }> | Record<string, unknown>
453+
async?: boolean
446454
}
447455

448456
export interface ApolloAccountBulkUpdateResponse extends ToolResponse {

0 commit comments

Comments
 (0)