openapi: 3.2.0 info: title: LDM v3 Site Enrichment API description: 'Multi-tenant B2B outreach automation platform. Auth: JWT Bearer (15-min) or tenant API key (ldm_*) managed in CRM Settings → API Keys. All tenant-scoped endpoints require the X-Tenant-Id header.' version: 1.0.0 contact: {} servers: - url: https://api.live-direct-marketing.online description: Production - url: https://api.dev.live-direct-marketing.online description: Development - url: http://127.0.0.1:3000 description: Local tags: - name: Site Enrichment paths: /api/site-enrichment/detect-forms: post: operationId: SiteEnrichmentController_detectFormsRoute parameters: - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DetectFormsDto' responses: '200': description: '' security: - jwt: [] summary: '#968 detect forms on a page from HTML: hasForm — whether any form is present at…' tags: - Site Enrichment x-required-scope: - site-enrichment:read /api/site-enrichment/tasks: post: operationId: SiteEnrichmentController_create parameters: - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateSiteEnrichmentTaskDto' responses: '202': description: '' security: - jwt: [] summary: '#903/#889 enqueue the canonical site-crawl task (durable, DB is the source of…' tags: - Site Enrichment x-required-scope: - site-enrichment:write get: operationId: SiteEnrichmentController_findAll parameters: - name: page required: true in: query schema: type: string - name: pageSize required: true in: query schema: type: string - name: status required: true in: query schema: type: string - name: scoringTaskId required: true in: query schema: type: string - name: owned required: true in: query schema: type: string - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints responses: '200': description: '' security: - jwt: [] summary: '#953 list of site-crawl tasks: both linked to a scoring task (scoringTaskId)…' tags: - Site Enrichment x-required-scope: - site-enrichment:read /api/site-enrichment/tasks/preview: get: operationId: SiteEnrichmentController_preview parameters: - name: listId required: true in: query schema: type: string - name: domainField required: true in: query schema: type: string - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints responses: '200': description: '' security: - jwt: [] summary: '#955 preview list coverage WITHOUT starting a crawl: how many cards are in the…' tags: - Site Enrichment x-required-scope: - site-enrichment:read /api/site-enrichment/tasks/{id}: get: operationId: SiteEnrichmentController_findOne parameters: - name: id required: true in: path schema: type: string - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints responses: '200': description: '' security: - jwt: [] summary: Status/counters of a site-crawl task tags: - Site Enrichment /api/site-enrichment/tasks/{id}/events: get: operationId: SiteEnrichmentController_listEvents parameters: - name: id required: true in: path schema: type: string - name: cursor required: true in: query schema: type: string - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints responses: '200': description: '' security: - jwt: [] summary: '#903 task transition log, read from the DB, cursor=last received seq' tags: - Site Enrichment post: operationId: SiteEnrichmentController_addAgentNote parameters: - name: id required: true in: path schema: type: string - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateAgentNoteDto' responses: '201': description: '' security: - jwt: [] summary: '#1144 atom B: an agent note into the task journal (kind=agent_note, author…' tags: - Site Enrichment /api/site-enrichment/tasks/{id}/reason-summary: get: operationId: SiteEnrichmentController_reasonSummary parameters: - name: id required: true in: path schema: type: string - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints responses: '200': description: '' security: - jwt: [] summary: '#949 summary of failure reasons (for a clickable filter above the journal)' tags: - Site Enrichment /api/site-enrichment/tasks/{id}/stats: get: operationId: SiteEnrichmentController_stats parameters: - name: id required: true in: path schema: type: string - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints responses: '200': description: '' security: - jwt: [] summary: '#957/#969 unified task statistics read from durable rows: funnel (cards AND…' tags: - Site Enrichment /api/site-enrichment/tasks/{id}/items: get: operationId: SiteEnrichmentController_listItems parameters: - name: id required: true in: path schema: type: string - name: status required: true in: query schema: type: string - name: reasonCode required: true in: query schema: type: string - name: page required: true in: query schema: type: string - name: pageSize required: true in: query schema: type: string - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints responses: '200': description: '' security: - jwt: [] summary: '#952/#969 crawl task items: paginated, with a filter by outcome…' tags: - Site Enrichment /api/site-enrichment/tasks/{id}/raw: get: operationId: SiteEnrichmentController_rawFetch parameters: - name: id required: true in: path schema: type: string - name: companyId required: true in: query schema: type: string - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints responses: '200': description: '' security: - jwt: [] summary: '#965 diagnostic snapshot of the RAW visited page text(s) for ONE company…' tags: - Site Enrichment /api/site-enrichment/tasks/{id}/cancel: post: operationId: SiteEnrichmentController_cancel parameters: - name: id required: true in: path schema: type: string - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints responses: '201': description: '' security: - jwt: [] summary: Cancel a site-crawl task (durable — status in the DB, visible to any process) tags: - Site Enrichment /api/site-enrichment/tasks/{id}/pause: post: operationId: SiteEnrichmentController_pause parameters: - name: id required: true in: path schema: type: string - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints responses: '201': description: '' security: - jwt: [] summary: '#952 pause a crawl task (durable, non-terminal — resumed via .../resume)' tags: - Site Enrichment /api/site-enrichment/tasks/{id}/resume: post: operationId: SiteEnrichmentController_resume parameters: - name: id required: true in: path schema: type: string - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints responses: '201': description: '' security: - jwt: [] summary: '#952 resume a paused crawl task' tags: - Site Enrichment /api/site-enrichment/tasks/{id}/retry: post: operationId: SiteEnrichmentController_retry parameters: - name: id required: true in: path schema: type: string - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints responses: '201': description: '' security: - jwt: [] summary: Retry still-not-OK companies of a terminal task (FAILED/PARTIAL/CANCELLED) tags: - Site Enrichment /api/site-enrichment/backlog/stale-http-status: get: operationId: SiteEnrichmentController_staleOkBacklog parameters: - name: limit required: true in: query schema: type: string - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints responses: '200': description: '' security: - jwt: [] summary: '#969 backfill: count and ids of tenant cards where…' tags: - Site Enrichment x-required-scope: - site-enrichment:read /api/site-enrichment/backlog/stale-http-status/requeue: post: operationId: SiteEnrichmentController_requeueStaleOkBacklog parameters: - name: batchSize required: true in: query schema: type: string - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints responses: '201': description: '' security: - jwt: [] summary: '#969 backfill: a controlled BATCH re-crawl of flagged cards (batchSize…' tags: - Site Enrichment x-required-scope: - site-enrichment:write /api/site-enrichment/backlog/down-wait-timeout: get: operationId: SiteEnrichmentController_downBacklog parameters: - name: limit required: true in: query schema: type: string - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints responses: '200': description: '' security: - jwt: [] summary: '#1126: count and ids of tenant cards where customFields.site_status=''down'' AND…' tags: - Site Enrichment x-required-scope: - site-enrichment:read /api/site-enrichment/backlog/down-wait-timeout/requeue: post: operationId: SiteEnrichmentController_requeueDownBacklog parameters: - name: batchSize required: true in: query schema: type: string - name: X-Tenant-Id in: header required: false schema: type: string format: uuid description: Tenant UUID — required for all tenant-scoped endpoints responses: '201': description: '' security: - jwt: [] summary: '#1126: a controlled BATCH re-crawl of cards from backlog/down-wait-timeout…' tags: - Site Enrichment x-required-scope: - site-enrichment:write components: schemas: CreateAgentNoteDto: type: object properties: text: type: string maxLength: 4000 required: - text CreateSiteEnrichmentTaskDto: type: object properties: companyIds: minItems: 1 maxItems: 500 type: array items: type: string listId: type: string maxLength: 100 domainField: type: string maxLength: 150 limit: type: number minimum: 1 maximum: 500 timeoutMs: type: number minimum: 1000 maximum: 120000 maxAttempts: type: number minimum: 1 maximum: 5 saveScreenshot: type: boolean loadImages: type: boolean pageConcurrency: type: number minimum: 1 maximum: 4 visitPages: type: object scoringTaskId: type: string maxLength: 100 DetectFormsDto: type: object properties: html: type: string pageUrl: type: string maxLength: 2000 required: - html securitySchemes: jwt: scheme: bearer bearerFormat: JWT type: http description: JWT access token from /auth/login (Bearer ) tenant-api-key: scheme: bearer bearerFormat: JWT type: http description: Tenant API key (Bearer ldm_*) for MCP/A2A clients. Issued via CRM Settings → API Keys. rpa-service: scheme: bearer bearerFormat: JWT type: http description: Dedicated RPA service key. No tenant API-key or query-key authentication.