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¶
GenerateSummaryRequestSchema—account_id(required),push_to_salesforce(bool, defaultfalse).WebWatchingRequestSchema— any ofaccount_id,company_name,website_url,linkedin_url,linkedin_company_id, pluscountry(e.g.fr,es,be,ca),linkedin_pages(default5),push_to_salesforce. Ifaccount_idis supplied, Salesforce data fills in the missing fields.BatchRequestSchema—account_ids(list, required),push_to_salesforce(defaulttrue),include_account_summary(defaulttrue),include_web_watching(defaulttrue).SearchAccountsRequestSchema—query(required),limit(default10).SlackMessagesRequestSchema—account_id(required).
Webhook request payloads¶
WebhookRequestSchema—account_id(required),async_mode(defaulttrue).DustWebhookRequestSchema—account_id(required),assistant_id(default"dust").
Notable response payloads¶
WebhookJobResponseSchema—job_id,status,created_at,started_at,completed_at,result(nestedWebhookResultSchema),error.WebhookResultSchema—success,account_id,summary_updated,web_watching_updated,trigger_flag_reset,error.JobStatusResponseSchema—job_id,status, timestamps, genericresultdict,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=truewebhook requests.
Code reference¶
{{ package_reference("apps.eu_tools.sales_prospecting.api") }}