Skip to content

Commit fefe690

Browse files
committed
feat(apollo): expose account_stage_id uniform field for bulk update accounts
Apollo documents account_stage_id as a Body Param for /accounts/bulk_update ('when using account_ids, apply this account stage to all accounts'). Adds it to the tool params, body builder, type, block subBlock, and params mapper alongside name/owner_id.
1 parent 5c2dc94 commit fefe690

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

apps/sim/blocks/blocks/apollo.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,14 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
588588
condition: { field: 'operation', value: 'account_bulk_update' },
589589
mode: 'advanced',
590590
},
591+
{
592+
id: 'account_bulk_update_account_stage_id',
593+
title: 'Uniform Account Stage ID (used with Account IDs)',
594+
type: 'short-input',
595+
placeholder: 'Apollo account stage ID',
596+
condition: { field: 'operation', value: 'account_bulk_update' },
597+
mode: 'advanced',
598+
},
591599
{
592600
id: 'account_attributes',
593601
title: 'Account Attributes (JSON Array of Objects)',
@@ -1126,8 +1134,12 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes
11261134
if (rest.account_bulk_update_owner_id) {
11271135
parsedParams.owner_id = rest.account_bulk_update_owner_id
11281136
}
1137+
if (rest.account_bulk_update_account_stage_id) {
1138+
parsedParams.account_stage_id = rest.account_bulk_update_account_stage_id
1139+
}
11291140
parsedParams.account_bulk_update_name = undefined
11301141
parsedParams.account_bulk_update_owner_id = undefined
1142+
parsedParams.account_bulk_update_account_stage_id = undefined
11311143
}
11321144

11331145
if (params.operation === 'contact_create') {

apps/sim/tools/apollo/account_bulk_update.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ export const apolloAccountBulkUpdateTool: ToolConfig<
4040
visibility: 'user-or-llm',
4141
description: 'When using account_ids, apply this owner to all accounts',
4242
},
43+
account_stage_id: {
44+
type: 'string',
45+
required: false,
46+
visibility: 'user-or-llm',
47+
description: 'When using account_ids, apply this account stage to all accounts',
48+
},
4349
account_attributes: {
4450
type: 'json',
4551
required: false,
@@ -71,6 +77,7 @@ export const apolloAccountBulkUpdateTool: ToolConfig<
7177
}
7278
if (params.name) body.name = params.name
7379
if (params.owner_id) body.owner_id = params.owner_id
80+
if (params.account_stage_id) body.account_stage_id = params.account_stage_id
7481
if (params.account_attributes) {
7582
if (Array.isArray(params.account_attributes)) {
7683
if (params.account_attributes.length > 0) {
@@ -83,7 +90,8 @@ export const apolloAccountBulkUpdateTool: ToolConfig<
8390
body.account_attributes = params.account_attributes
8491
}
8592
}
86-
const hasUpdateFields = body.account_attributes || body.name || body.owner_id
93+
const hasUpdateFields =
94+
body.account_attributes || body.name || body.owner_id || body.account_stage_id
8795
if (!hasUpdateFields) {
8896
throw new Error(
8997
'Apollo account bulk update requires update fields. Provide account_attributes (array of per-account updates with id, or single object paired with account_ids), or pair account_ids with name/owner_id to apply uniformly.'

apps/sim/tools/apollo/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ export interface ApolloAccountBulkUpdateParams extends ApolloBaseParams {
468468
account_ids?: string[]
469469
name?: string
470470
owner_id?: string
471+
account_stage_id?: string
471472
account_attributes?: Array<{ id: string; [key: string]: unknown }> | Record<string, unknown>
472473
async?: boolean
473474
}

0 commit comments

Comments
 (0)