Skip to content

Commit 3ed2297

Browse files
waleedlatif1claude
andcommitted
fix(apollo): align tools and block with live API docs
Final pass over the Apollo integration after a per-tool forensic audit against Apollo.io docs. Notable fixes: - organization_enrich: GET+querystring -> POST+JSON body (canonical, non master-key) - organization_bulk_enrich: ?domains[]= -> JSON body { organizations } - people_search: declare/forward organization_num_employees_ranges; fix contact_email_status placeholder ("likely to engage", with spaces) - account_bulk_create: surface failed_accounts and failed count - contact_bulk_create: expand documented per-contact fields (CRM IDs, phone_numbers, contact_emails, typed_custom_fields, etc.) - sequence_add_contacts: surface remaining documented filter params - task_create: confirm wire field name (note) and remap from task_notes - types: tighten params/responses for the above Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 3702b26 commit 3ed2297

10 files changed

Lines changed: 215 additions & 37 deletions

File tree

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ Create up to 100 accounts at once in your Apollo database. Set run_dedupe=true t
409409
| Parameter | Type | Required | Description |
410410
| --------- | ---- | -------- | ----------- |
411411
| `apiKey` | string | Yes | Apollo API key \(master key required\) |
412-
| `accounts` | array | Yes | Array of accounts to create \(max 100\). Each account should include name \(required\), and optionally domain, phone, owner_id |
412+
| `accounts` | array | Yes | Array of accounts to create \(max 100\). Each account should include a name, and may optionally include domain, phone, phone_status_cd, raw_address, owner_id, linkedin_url, facebook_url, twitter_url, salesforce_id, and hubspot_id. |
413413
| `append_label_names` | array | No | Array of label names to add to ALL accounts in this request |
414414
| `run_dedupe` | boolean | No | When true, performs aggressive deduplication by domain, organization_id, and name \(defaults to false\) |
415415

@@ -574,6 +574,13 @@ Add contacts to an Apollo sequence
574574
| `sequence_job_change` | boolean | No | Add contacts who recently changed jobs |
575575
| `sequence_active_in_other_campaigns` | boolean | No | Add contacts active in other campaigns |
576576
| `sequence_finished_in_other_campaigns` | boolean | No | Add contacts who finished other campaigns |
577+
| `sequence_same_company_in_same_campaign` | boolean | No | Add contacts even if others from the same company are in the sequence |
578+
| `contacts_without_ownership_permission` | boolean | No | Add contacts without ownership permission |
579+
| `add_if_in_queue` | boolean | No | Add contacts even if they are in the queue |
580+
| `contact_verification_skipped` | boolean | No | Skip contact verification when adding |
581+
| `user_id` | string | No | ID of the user performing the action |
582+
| `status` | string | No | Initial status for added contacts: "active" or "paused" |
583+
| `auto_unpause_at` | string | No | ISO 8601 datetime to automatically unpause contacts |
577584

578585
#### Output
579586

@@ -598,10 +605,10 @@ Create one or more tasks in Apollo (one task per contact_id, master key required
598605
| `apiKey` | string | Yes | Apollo API key \(master key required\) |
599606
| `user_id` | string | Yes | ID of the Apollo user the task is assigned to |
600607
| `contact_ids` | array | Yes | Array of contact IDs. One task is created per contact. |
601-
| `priority` | string | Yes | Task priority: "high", "medium", or "low" |
608+
| `priority` | string | No | Task priority: "high", "medium", or "low" \(defaults to "medium"\) |
602609
| `due_at` | string | Yes | Due date/time in ISO 8601 format \(e.g., "2024-12-31T23:59:59Z"\) |
603-
| `type` | string | Yes | Task type: "call", "outreach_manual_email", or "action_item" |
604-
| `status` | string | Yes | Task status: "scheduled", "completed", or "archived" |
610+
| `type` | string | Yes | Task type: "call", "outreach_manual_email", "linkedin_step_connect", "linkedin_step_message", "linkedin_step_view_profile", "linkedin_step_interact_post", or "action_item" |
611+
| `status` | string | Yes | Task status: "scheduled", "completed", or "skipped" |
605612
| `note` | string | No | Free-form note providing context for the task |
606613

607614
#### Output

apps/sim/blocks/blocks/apollo.ts

Lines changed: 73 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
103103
id: 'contact_email_status',
104104
title: 'Contact Email Status',
105105
type: 'code',
106-
placeholder: '["verified", "unverified", "likely_to_engage"]',
106+
placeholder: '["verified", "unverified", "likely to engage"]',
107107
condition: { field: 'operation', value: 'people_search' },
108108
mode: 'advanced',
109109
},
@@ -213,9 +213,10 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
213213
},
214214
{
215215
id: 'organizations',
216-
title: 'Organizations (JSON Array of domain objects)',
216+
title: 'Organizations (JSON Array)',
217217
type: 'code',
218-
placeholder: '[{"domain": "companya.com"}, {"domain": "companyb.com"}]',
218+
placeholder:
219+
'[{"name": "Company A", "domain": "companya.com"}, {"name": "Company B", "domain": "companyb.com"}]',
219220
condition: { field: 'operation', value: 'organization_bulk_enrich' },
220221
required: true,
221222
},
@@ -258,7 +259,7 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
258259
title: 'Employee Count Ranges',
259260
type: 'code',
260261
placeholder: '["1,10", "11,50", "51,200"]',
261-
condition: { field: 'operation', value: 'organization_search' },
262+
condition: { field: 'operation', value: ['organization_search', 'people_search'] },
262263
mode: 'advanced',
263264
},
264265
{
@@ -709,6 +710,61 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
709710
condition: { field: 'operation', value: 'sequence_add' },
710711
mode: 'advanced',
711712
},
713+
{
714+
id: 'sequence_same_company_in_same_campaign',
715+
title: 'Allow Same Company in Same Campaign',
716+
type: 'switch',
717+
condition: { field: 'operation', value: 'sequence_add' },
718+
mode: 'advanced',
719+
},
720+
{
721+
id: 'contacts_without_ownership_permission',
722+
title: 'Add Contacts Without Ownership Permission',
723+
type: 'switch',
724+
condition: { field: 'operation', value: 'sequence_add' },
725+
mode: 'advanced',
726+
},
727+
{
728+
id: 'add_if_in_queue',
729+
title: 'Add If In Queue',
730+
type: 'switch',
731+
condition: { field: 'operation', value: 'sequence_add' },
732+
mode: 'advanced',
733+
},
734+
{
735+
id: 'contact_verification_skipped',
736+
title: 'Skip Contact Verification',
737+
type: 'switch',
738+
condition: { field: 'operation', value: 'sequence_add' },
739+
mode: 'advanced',
740+
},
741+
{
742+
id: 'sequence_user_id',
743+
title: 'Acting User ID',
744+
type: 'short-input',
745+
placeholder: 'Apollo user ID',
746+
condition: { field: 'operation', value: 'sequence_add' },
747+
mode: 'advanced',
748+
},
749+
{
750+
id: 'sequence_status',
751+
title: 'Initial Status',
752+
type: 'dropdown',
753+
options: [
754+
{ label: 'Active', id: 'active' },
755+
{ label: 'Paused', id: 'paused' },
756+
],
757+
condition: { field: 'operation', value: 'sequence_add' },
758+
mode: 'advanced',
759+
},
760+
{
761+
id: 'auto_unpause_at',
762+
title: 'Auto Unpause At',
763+
type: 'short-input',
764+
placeholder: 'ISO 8601 (e.g., 2024-12-31T23:59:59Z)',
765+
condition: { field: 'operation', value: 'sequence_add' },
766+
mode: 'advanced',
767+
},
712768

713769
// Task Create Fields
714770
{
@@ -730,7 +786,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
730786
],
731787
value: () => 'medium',
732788
condition: { field: 'operation', value: 'task_create' },
733-
required: true,
734789
},
735790
{
736791
id: 'type',
@@ -739,6 +794,10 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
739794
options: [
740795
{ label: 'Call', id: 'call' },
741796
{ label: 'Outreach Manual Email', id: 'outreach_manual_email' },
797+
{ label: 'LinkedIn — Connect', id: 'linkedin_step_connect' },
798+
{ label: 'LinkedIn — Message', id: 'linkedin_step_message' },
799+
{ label: 'LinkedIn — View Profile', id: 'linkedin_step_view_profile' },
800+
{ label: 'LinkedIn — Interact with Post', id: 'linkedin_step_interact_post' },
742801
{ label: 'Action Item', id: 'action_item' },
743802
],
744803
value: () => 'action_item',
@@ -752,7 +811,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
752811
options: [
753812
{ label: 'Scheduled', id: 'scheduled' },
754813
{ label: 'Completed', id: 'completed' },
755-
{ label: 'Archived', id: 'archived' },
814+
{ label: 'Skipped', id: 'skipped' },
756815
],
757816
value: () => 'scheduled',
758817
condition: { field: 'operation', value: 'task_create' },
@@ -1056,6 +1115,14 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes
10561115
parsedParams.label_names = parsedParams.sequence_add_label_names
10571116
}
10581117
parsedParams.sequence_add_label_names = undefined
1118+
if (rest.sequence_user_id !== undefined && rest.sequence_user_id !== '') {
1119+
parsedParams.user_id = rest.sequence_user_id
1120+
}
1121+
parsedParams.sequence_user_id = undefined
1122+
if (rest.sequence_status !== undefined && rest.sequence_status !== '') {
1123+
parsedParams.status = rest.sequence_status
1124+
}
1125+
parsedParams.sequence_status = undefined
10591126
}
10601127

10611128
if (params.operation === 'task_create') {

apps/sim/tools/apollo/account_bulk_create.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ 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 domain, phone, owner_id',
29+
'Array of accounts to create (max 100). Each account should include a name, and may optionally include domain, phone, phone_status_cd, raw_address, owner_id, linkedin_url, facebook_url, twitter_url, salesforce_id, and hubspot_id.',
3030
},
3131
append_label_names: {
3232
type: 'array',
@@ -76,15 +76,18 @@ export const apolloAccountBulkCreateTool: ToolConfig<
7676
? data.accounts
7777
: []
7878
const existingAccounts = Array.isArray(data.existing_accounts) ? data.existing_accounts : []
79+
const failedAccounts = Array.isArray(data.failed_accounts) ? data.failed_accounts : []
7980

8081
return {
8182
success: true,
8283
output: {
8384
created_accounts: createdAccounts,
8485
existing_accounts: existingAccounts,
85-
total_submitted: createdAccounts.length + existingAccounts.length,
86+
failed_accounts: failedAccounts,
87+
total_submitted: createdAccounts.length + existingAccounts.length + failedAccounts.length,
8688
created: createdAccounts.length,
8789
existing: existingAccounts.length,
90+
failed: failedAccounts.length,
8891
},
8992
}
9093
},
@@ -98,9 +101,13 @@ export const apolloAccountBulkCreateTool: ToolConfig<
98101
type: 'json',
99102
description: 'Array of existing accounts returned by Apollo (when duplicates are detected)',
100103
},
104+
failed_accounts: {
105+
type: 'json',
106+
description: 'Array of accounts that failed to be created, with reasons for failure',
107+
},
101108
total_submitted: {
102109
type: 'number',
103-
description: 'Total number of accounts in the response (created + existing)',
110+
description: 'Total number of accounts in the response (created + existing + failed)',
104111
},
105112
created: {
106113
type: 'number',
@@ -110,5 +117,9 @@ export const apolloAccountBulkCreateTool: ToolConfig<
110117
type: 'number',
111118
description: 'Number of existing accounts found',
112119
},
120+
failed: {
121+
type: 'number',
122+
description: 'Number of accounts that failed to be created',
123+
},
113124
},
114125
}

apps/sim/tools/apollo/contact_bulk_create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const apolloContactBulkCreateTool: ToolConfig<
2626
required: true,
2727
visibility: 'user-or-llm',
2828
description:
29-
'Array of contacts to create (max 100). Each contact may include first_name, last_name, email, title, organization_name, owner_id, contact_stage_id, linkedin_url, phone_numbers, and contact_emails',
29+
'Array of contacts to create (max 100). Each contact may include first_name, last_name, email, title, organization_name, account_id, owner_id, contact_stage_id, linkedin_url, phone (single string) or phone_numbers (array of {raw_number, position}), contact_emails, typed_custom_fields, and CRM IDs (salesforce_contact_id, hubspot_id, team_id) for cross-system matching',
3030
},
3131
append_label_names: {
3232
type: 'array',

apps/sim/tools/apollo/organization_bulk_enrich.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,22 @@ export const apolloOrganizationBulkEnrichTool: ToolConfig<
2424
type: 'array',
2525
required: true,
2626
visibility: 'user-or-llm',
27-
description: 'Array of organizations to enrich (max 10)',
27+
description:
28+
'Array of organizations to enrich (max 10). Each item requires `name` and may include `domain` (e.g., [{"name": "Example Corp", "domain": "example.com"}])',
2829
},
2930
},
3031

3132
request: {
32-
url: (params: ApolloOrganizationBulkEnrichParams) => {
33-
const domains = params.organizations
34-
.slice(0, 10)
35-
.map((o) => o.domain)
36-
.filter((d): d is string => Boolean(d))
37-
const qs = domains.map((d) => `domains[]=${encodeURIComponent(d)}`).join('&')
38-
return `https://api.apollo.io/api/v1/organizations/bulk_enrich${qs ? `?${qs}` : ''}`
39-
},
33+
url: 'https://api.apollo.io/api/v1/organizations/bulk_enrich',
4034
method: 'POST',
4135
headers: (params: ApolloOrganizationBulkEnrichParams) => ({
36+
'Content-Type': 'application/json',
4237
'Cache-Control': 'no-cache',
4338
'X-Api-Key': params.apiKey,
4439
}),
40+
body: (params: ApolloOrganizationBulkEnrichParams) => ({
41+
organizations: params.organizations.slice(0, 10),
42+
}),
4543
},
4644

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

apps/sim/tools/apollo/organization_enrich.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,20 @@ export const apolloOrganizationEnrichTool: ToolConfig<
2929
},
3030

3131
request: {
32-
url: (params: ApolloOrganizationEnrichParams) => {
32+
url: 'https://api.apollo.io/api/v1/organizations/enrich',
33+
method: 'POST',
34+
headers: (params: ApolloOrganizationEnrichParams) => ({
35+
'Content-Type': 'application/json',
36+
'Cache-Control': 'no-cache',
37+
'X-Api-Key': params.apiKey,
38+
}),
39+
body: (params: ApolloOrganizationEnrichParams) => {
3340
const domain = params.domain?.trim()
3441
if (!domain) {
3542
throw new Error('domain is required for organization enrichment')
3643
}
37-
return `https://api.apollo.io/api/v1/organizations/enrich?domain=${encodeURIComponent(domain)}`
44+
return { domain }
3845
},
39-
method: 'GET',
40-
headers: (params: ApolloOrganizationEnrichParams) => ({
41-
'Cache-Control': 'no-cache',
42-
'X-Api-Key': params.apiKey,
43-
}),
4446
},
4547

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

apps/sim/tools/apollo/people_search.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,19 @@ export const apolloPeopleSearchTool: ToolConfig<
6868
description:
6969
'Employer domain names (e.g., ["apollo.io", "microsoft.com"]) — up to 1,000, no www. or @',
7070
},
71+
organization_num_employees_ranges: {
72+
type: 'array',
73+
required: false,
74+
visibility: 'user-or-llm',
75+
description:
76+
'Employee count ranges for the person\'s current employer. Each entry is "min,max" (e.g., ["1,10", "250,500", "10000,20000"])',
77+
},
7178
contact_email_status: {
7279
type: 'array',
7380
required: false,
7481
visibility: 'user-or-llm',
7582
description:
76-
'Email statuses to filter by: verified, unverified, likely to engage, unavailable',
83+
'Email statuses to filter by: "verified", "unverified", "likely to engage", "unavailable"',
7784
},
7885
q_keywords: {
7986
type: 'string',
@@ -133,6 +140,12 @@ export const apolloPeopleSearchTool: ToolConfig<
133140
if (params.q_organization_domains_list && params.q_organization_domains_list.length > 0) {
134141
body.q_organization_domains_list = params.q_organization_domains_list
135142
}
143+
if (
144+
params.organization_num_employees_ranges &&
145+
params.organization_num_employees_ranges.length > 0
146+
) {
147+
body.organization_num_employees_ranges = params.organization_num_employees_ranges
148+
}
136149
if (params.contact_email_status && params.contact_email_status.length > 0) {
137150
body.contact_email_status = params.contact_email_status
138151
}

apps/sim/tools/apollo/sequence_add_contacts.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,48 @@ export const apolloSequenceAddContactsTool: ToolConfig<
8383
visibility: 'user-only',
8484
description: 'Add contacts who finished other campaigns',
8585
},
86+
sequence_same_company_in_same_campaign: {
87+
type: 'boolean',
88+
required: false,
89+
visibility: 'user-only',
90+
description: 'Add contacts even if others from the same company are in the sequence',
91+
},
92+
contacts_without_ownership_permission: {
93+
type: 'boolean',
94+
required: false,
95+
visibility: 'user-only',
96+
description: 'Add contacts without ownership permission',
97+
},
98+
add_if_in_queue: {
99+
type: 'boolean',
100+
required: false,
101+
visibility: 'user-only',
102+
description: 'Add contacts even if they are in the queue',
103+
},
104+
contact_verification_skipped: {
105+
type: 'boolean',
106+
required: false,
107+
visibility: 'user-only',
108+
description: 'Skip contact verification when adding',
109+
},
110+
user_id: {
111+
type: 'string',
112+
required: false,
113+
visibility: 'user-only',
114+
description: 'ID of the user performing the action',
115+
},
116+
status: {
117+
type: 'string',
118+
required: false,
119+
visibility: 'user-only',
120+
description: 'Initial status for added contacts: "active" or "paused"',
121+
},
122+
auto_unpause_at: {
123+
type: 'string',
124+
required: false,
125+
visibility: 'user-only',
126+
description: 'ISO 8601 datetime to automatically unpause contacts',
127+
},
86128
},
87129

88130
request: {
@@ -124,6 +166,19 @@ export const apolloSequenceAddContactsTool: ToolConfig<
124166
if (params.sequence_finished_in_other_campaigns !== undefined) {
125167
body.sequence_finished_in_other_campaigns = params.sequence_finished_in_other_campaigns
126168
}
169+
if (params.sequence_same_company_in_same_campaign !== undefined) {
170+
body.sequence_same_company_in_same_campaign = params.sequence_same_company_in_same_campaign
171+
}
172+
if (params.contacts_without_ownership_permission !== undefined) {
173+
body.contacts_without_ownership_permission = params.contacts_without_ownership_permission
174+
}
175+
if (params.add_if_in_queue !== undefined) body.add_if_in_queue = params.add_if_in_queue
176+
if (params.contact_verification_skipped !== undefined) {
177+
body.contact_verification_skipped = params.contact_verification_skipped
178+
}
179+
if (params.user_id) body.user_id = params.user_id
180+
if (params.status) body.status = params.status
181+
if (params.auto_unpause_at) body.auto_unpause_at = params.auto_unpause_at
127182
return body
128183
},
129184
},

0 commit comments

Comments
 (0)