Skip to content

Sales Prospecting

Account summary, web-watching, and Dust-conversation tooling for Salesforce accounts.

Two blueprints

The module exposes two Flask blueprints with different authentication models:

Blueprint URL prefix Auth
Internal /sales-prospecting Session auth (default app context provider) — for the Alan internal UI and other in-app callers
Webhook /webhooks/sales-prospecting WebhookAuthContextProvider (secret) — for Salesforce/Zapier callbacks

Webhook auth

Property Value
Header X-Webhook-Secret
Secret config key SALES_PROSPECTING_WEBHOOK_SECRET
Auth principal salesforce-webhook@alan-eu-tools.iam.gserviceaccount.com (ServiceAccount)
Auth type WebhookAuthType.secret

The secret value is fetched from the config under SALES_PROSPECTING_WEBHOOK_SECRET and must be sent in the X-Webhook-Secret request header.


Endpoints

Internal blueprint (/sales-prospecting)

Method Path Request schema Response schema Purpose
POST /summary GenerateSummaryRequestSchema GenerateSummaryResponseSchema Generate a prospecting summary for one account.
POST /web-watching WebWatchingRequestSchema WebWatchingResponseSchema Generate a web-watching summary for a company (enriches from Salesforce when account_id is supplied).
POST /batch BatchRequestSchema BatchResponseSchema Generate summaries and/or web-watching for many accounts in one call.
GET /search SearchAccountsRequestSchema (query string) SearchAccountsResponseSchema Search Salesforce accounts by name (Turing with SF fallback). Requires query ≥ 3 chars.
GET /slack-messages SlackMessagesRequestSchema (query string) SlackMessagesResponseSchema Fetch Slack threads that reference the given Salesforce account.

Webhook blueprint (/webhooks/sales-prospecting)

Method Path Request schema Response schema Purpose
POST /summary WebhookRequestSchema WebhookJobResponseSchema Salesforce/Zapier entry point for summary generation. async_mode=true (default) returns a job_id with HTTP 202; async_mode=false blocks and returns HTTP 200.
POST /batch BatchRequestSchema BatchResponseSchema Same as the internal /batch, exposed for trusted external callers.
POST /dust DustWebhookRequestSchema DustWebhookResponseSchema Create a Dust AI conversation seeded with the account's prospecting context.
GET /job/<job_id> JobStatusResponseSchema Poll the status of an async webhook job until completed or failed.

Request / response schemas

All schemas are defined in api.py as marshmallow Schema classes. Key fields:

Internal request payloads

  • GenerateSummaryRequestSchemaaccount_id (required), push_to_salesforce (bool, default false).
  • WebWatchingRequestSchema — any of account_id, company_name, website_url, linkedin_url, linkedin_company_id, plus country (e.g. fr, es, be, ca), linkedin_pages (default 5), push_to_salesforce. If account_id is supplied, Salesforce data fills in the missing fields.
  • BatchRequestSchemaaccount_ids (list, required), push_to_salesforce (default true), include_account_summary (default true), include_web_watching (default true).
  • SearchAccountsRequestSchemaquery (required), limit (default 10).
  • SlackMessagesRequestSchemaaccount_id (required).

Webhook request payloads

  • WebhookRequestSchemaaccount_id (required), async_mode (default true).
  • DustWebhookRequestSchemaaccount_id (required), assistant_id (default "dust").

Notable response payloads

  • WebhookJobResponseSchemajob_id, status, created_at, started_at, completed_at, result (nested WebhookResultSchema), error.
  • WebhookResultSchemasuccess, account_id, summary_updated, web_watching_updated, trigger_flag_reset, error.
  • JobStatusResponseSchemajob_id, status, timestamps, generic result dict, error.

For the complete, authoritative list, see the code reference below.


Integrations

  • Salesforce API — account/contact/task/note retrieval and write-back of summaries.
  • Turing (Snowflake) — preferred read path for events and account search; falls back to SOQL when unavailable.
  • Dust AI — conversation creation seeded with prospecting context.
  • Slack — thread search by account.
  • RQ — async job queue backing async_mode=true webhook requests.

Code reference

{{ package_reference("apps.eu_tools.sales_prospecting.api") }}