Data Enrichment Pipeline Builder

API enrichment

by LeadMagic · MIT license · ★ 62 on GitHub

API enrichment cover

Build API-first enrichment pipelines — provider selection, batching, retries, rate limits, idempotency, webhooks, cost tracking, and CRM writes. Use when integrating enrichment APIs directly into GTM systems or replacing manual data…

---
name: api-enrichment
description: >-
  Build API-first enrichment pipelines — provider selection, batching, retries,
  rate limits, idempotency, webhooks, cost tracking, and CRM writes. Use when
  integrating enrichment APIs directly into GTM systems or replacing manual data
  workflows with programmatic pipelines.
license: MIT
compatibility: Claude Code, Codex, GitHub Copilot, Cursor, Gemini CLI, OpenCode, Goose, Hermes, Windsurf, Zed
metadata:
  version: "1.0.0"
  author: LeadMagic
  category: automation
  tags: [api, enrichment, automation, pipelines, data-quality]
  related_skills: [waterfall-enrichment, data-enrichment-strategy, crm-integration, campaign-analytics]
  frameworks: [REST API Best Practices, Bulk Enrichment Patterns, DAMA-DMBOK Data Quality Dimensions, Idempotent API Design]
---

Overview

API enrichment fails when teams treat it like a simple loop over contacts. The hard parts are not the HTTP calls — they are data quality, deduplication, retry safety, rate limiting, cost controls, and knowing when not to enrich.

Manual install (npx, ZIP)
Claude Codenpx skills add LeadMagic/gtm-skills --skill api-enrichment -g -a claude-code
Claude Code (degit)npx degit LeadMagic/gtm-skills/skills/automation/api-enrichment#main ~/.claude/skills/api-enrichment
Claude.ai / desktopZip the folder and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md6.7 KB
Read SKILL.md here
LeadMagic/main1 file shown
SKILL.md
Show the full text154 lines

API Enrichment

Overview

API enrichment fails when teams treat it like a simple loop over contacts. The hard parts are not the HTTP calls — they are data quality, deduplication, retry safety, rate limiting, cost controls, and knowing when not to enrich.

This skill builds a production-ready enrichment pipeline that can process leads, contacts, and accounts without silent failures or uncontrolled vendor spend.

When to Use

Use this skill when the user asks to: "build an enrichment API pipeline", "integrate enrichment directly into our app", "set up automated enrichment via API", "replace manual enrichment with API calls", "batch enrich contacts", "add enrichment to inbound routing", "push enriched data to CRM", or "handle enrichment retries and webhooks".

Do not use this for tool-specific no-code workflows. Use clay-automation or n8n-automation when the user wants a no-code platform.

Authoritative Foundations

REST API Best Practices — Idempotency and Retries

Any bulk enrichment job needs idempotent writes and retry-safe requests. A retry should never create duplicate contacts, duplicate CRM notes, or duplicate sequence enrollment.

DAMA-DMBOK — Data Quality Dimensions

Provider waterfalls improve coverage and cost control by trying the best-fit source first, then falling back only when needed. This avoids paying multiple providers for the same field.

Data Quality Management — Source Priority and Freshness

Fields need source attribution and timestamps. A title from two years ago should not override a title returned yesterday. Freshness and source priority are part of the data model.

Webhook Integration Patterns

Async jobs should call back when complete instead of forcing the client to poll. Webhooks need signature verification, retry handling, and event deduplication.

Prerequisites

  • Canonical record ID for every contact/account
  • Source-of-truth CRM fields
  • Provider API keys
  • Rate limits and pricing model for each provider
  • Field-level priority rules
  • Error logging destination
  • Webhook endpoint if processing async jobs

Step-by-Step Process

Phase 1: Define the Enrichment Contract
Field Type Examples Owner
Identity name, email, phone Enrichment pipeline
Company domain, size, industry, funding Enrichment pipeline
Sales context lifecycle stage, owner, next step CRM / rep
Compliance suppression, opt-out, consent Compliance system / CRM

Never let enrichment overwrite human-owned sales fields without explicit rules.

Phase 2: Build the Request Model

For every request, include external ID, input fields, provider selected, requested field set, idempotency key, timestamp, and callback URL if async. Use deterministic idempotency keys such as record_id + provider + field_set + date_bucket.

Phase 3: Design the Provider Waterfall
Step Use When Stop Condition
Primary provider Best cost/coverage for segment Required fields returned
Secondary provider Primary misses critical field Critical fields returned
Specialist provider Region/persona/company-type gap Specialist field returned
Manual review High-value account still incomplete Human decides

Do not call every provider for every record. Waterfall only when the previous step misses.

Phase 4: Implement Reliability Controls

Minimum controls: exponential backoff, dead-letter queue, rate-limit budget, cost ceiling, field source attribution, hash-based dedupe before CRM write, webhook signature verification.

Phase 5: Monitor the Pipeline

Track coverage by field, match rate by provider, cost per enriched record, error rate by provider, latency p50/p95, CRM write success rate, and duplicate rate.

Output Format

# API Enrichment Pipeline Plan

## Fields Owned
| Field | Source Priority | Freshness Rule | CRM Write Rule |
|---|---|---|---|

## Provider Waterfall
| Step | Provider Type | Trigger | Stop Condition | Cost Guardrail |
|---|---|---|---|---|

## Request Contract
- Required inputs:
- Idempotency key:
- Retry policy:
- Webhook policy:

## Monitoring
- Coverage:
- Cost:
- Errors:
- Latency:

Quality Check

Before delivering, verify:

  • Every field has source attribution
  • Retry logic is idempotent
  • Provider calls stop when required fields are found
  • CRM writes cannot duplicate records
  • Rate limits and cost ceilings are defined
  • Webhooks include verification and dedupe
  • Monitoring covers coverage, cost, errors, latency, and CRM writes

Common Pitfalls

  1. Looping over contacts without idempotency. Retries create duplicates. Fix: idempotency keys and upserts.
  2. Calling all providers every time. Costs explode. Fix: waterfall by stop condition.
  3. Overwriting rep-owned fields. Enrichment corrupts active deals. Fix: field ownership rules.
  4. Silent failures. Missing data looks like no match. Fix: explicit error states and dead-letter queue.
  5. No freshness rule. Old data overwrites newer CRM data. Fix: compare timestamps and source priority.
  6. Polling huge jobs. Polling wastes compute and API calls. Fix: signed webhooks with retry handling.

Execution Artifacts

  • references/framework-notes.md — named frameworks, citation anchors, and operating assumptions
  • templates/output-template.md — copy-paste deliverable structure for the user
  • scripts/check-output.py — local checklist validator for required sections This skill includes lightweight artifacts the agent can load on demand: Use the artifacts when the user asks for an implementation-ready deliverable, a repeatable workflow, or a quality check rather than generic advice.
  • waterfall-enrichment — multi-provider enrichment design
  • data-enrichment-strategy — source selection and data quality
  • crm-integration — CRM writes and lifecycle fields
  • campaign-analytics — measuring enrichment impact on pipeline
1---
2name: api-enrichment
3description: >-
4 Build API-first enrichment pipelines — provider selection, batching, retries,
5 rate limits, idempotency, webhooks, cost tracking, and CRM writes. Use when
6 integrating enrichment APIs directly into GTM systems or replacing manual data
7 workflows with programmatic pipelines.
8license: MIT
9compatibility: Claude Code, Codex, GitHub Copilot, Cursor, Gemini CLI, OpenCode, Goose, Hermes, Windsurf, Zed
10metadata:
11 version: "1.0.0"
12 author: LeadMagic
13 category: automation
14 tags: [api, enrichment, automation, pipelines, data-quality]
15 related_skills: [waterfall-enrichment, data-enrichment-strategy, crm-integration, campaign-analytics]
16 frameworks: [REST API Best Practices, Bulk Enrichment Patterns, DAMA-DMBOK Data Quality Dimensions, Idempotent API Design]
17---
18 
19# API Enrichment
20 
21## Overview
22 
23API enrichment fails when teams treat it like a simple loop over contacts. The hard parts are not the HTTP calls — they are data quality, deduplication, retry safety, rate limiting, cost controls, and knowing when not to enrich.
24 
25This skill builds a production-ready enrichment pipeline that can process leads, contacts, and accounts without silent failures or uncontrolled vendor spend.
26 
27## When to Use
28 
29Use this skill when the user asks to: "build an enrichment API pipeline", "integrate enrichment directly into our app", "set up automated enrichment via API", "replace manual enrichment with API calls", "batch enrich contacts", "add enrichment to inbound routing", "push enriched data to CRM", or "handle enrichment retries and webhooks".
30 
31Do not use this for tool-specific no-code workflows. Use `clay-automation` or `n8n-automation` when the user wants a no-code platform.
32 
33## Authoritative Foundations
34 
35### REST API Best Practices — Idempotency and Retries
36Any bulk enrichment job needs idempotent writes and retry-safe requests. A retry should never create duplicate contacts, duplicate CRM notes, or duplicate sequence enrollment.
37 
38### DAMA-DMBOK — Data Quality Dimensions
39Provider waterfalls improve coverage and cost control by trying the best-fit source first, then falling back only when needed. This avoids paying multiple providers for the same field.
40 
41### Data Quality Management — Source Priority and Freshness
42Fields need source attribution and timestamps. A title from two years ago should not override a title returned yesterday. Freshness and source priority are part of the data model.
43 
44### Webhook Integration Patterns
45Async jobs should call back when complete instead of forcing the client to poll. Webhooks need signature verification, retry handling, and event deduplication.
46 
47## Prerequisites
48 
49- Canonical record ID for every contact/account
50- Source-of-truth CRM fields
51- Provider API keys
52- Rate limits and pricing model for each provider
53- Field-level priority rules
54- Error logging destination
55- Webhook endpoint if processing async jobs
56 
57## Step-by-Step Process
58 
59### Phase 1: Define the Enrichment Contract
60 
61| Field Type | Examples | Owner |
62|---|---|---|
63| Identity | name, email, phone | Enrichment pipeline |
64| Company | domain, size, industry, funding | Enrichment pipeline |
65| Sales context | lifecycle stage, owner, next step | CRM / rep |
66| Compliance | suppression, opt-out, consent | Compliance system / CRM |
67 
68Never let enrichment overwrite human-owned sales fields without explicit rules.
69 
70### Phase 2: Build the Request Model
71 
72For every request, include external ID, input fields, provider selected, requested field set, idempotency key, timestamp, and callback URL if async. Use deterministic idempotency keys such as `record_id + provider + field_set + date_bucket`.
73 
74### Phase 3: Design the Provider Waterfall
75 
76| Step | Use When | Stop Condition |
77|---|---|---|
78| Primary provider | Best cost/coverage for segment | Required fields returned |
79| Secondary provider | Primary misses critical field | Critical fields returned |
80| Specialist provider | Region/persona/company-type gap | Specialist field returned |
81| Manual review | High-value account still incomplete | Human decides |
82 
83Do not call every provider for every record. Waterfall only when the previous step misses.
84 
85### Phase 4: Implement Reliability Controls
86 
87Minimum controls: exponential backoff, dead-letter queue, rate-limit budget, cost ceiling, field source attribution, hash-based dedupe before CRM write, webhook signature verification.
88 
89### Phase 5: Monitor the Pipeline
90 
91Track coverage by field, match rate by provider, cost per enriched record, error rate by provider, latency p50/p95, CRM write success rate, and duplicate rate.
92 
93## Output Format
94 
95```markdown
96# API Enrichment Pipeline Plan
97 
98## Fields Owned
99| Field | Source Priority | Freshness Rule | CRM Write Rule |
100|---|---|---|---|
101 
102## Provider Waterfall
103| Step | Provider Type | Trigger | Stop Condition | Cost Guardrail |
104|---|---|---|---|---|
105 
106## Request Contract
107- Required inputs:
108- Idempotency key:
109- Retry policy:
110- Webhook policy:
111 
112## Monitoring
113- Coverage:
114- Cost:
115- Errors:
116- Latency:
117```
118 
119## Quality Check
120 
121Before delivering, verify:
122 
123- [ ] Every field has source attribution
124- [ ] Retry logic is idempotent
125- [ ] Provider calls stop when required fields are found
126- [ ] CRM writes cannot duplicate records
127- [ ] Rate limits and cost ceilings are defined
128- [ ] Webhooks include verification and dedupe
129- [ ] Monitoring covers coverage, cost, errors, latency, and CRM writes
130 
131## Common Pitfalls
132 
1331. **Looping over contacts without idempotency.** Retries create duplicates. Fix: idempotency keys and upserts.
1342. **Calling all providers every time.** Costs explode. Fix: waterfall by stop condition.
1353. **Overwriting rep-owned fields.** Enrichment corrupts active deals. Fix: field ownership rules.
1364. **Silent failures.** Missing data looks like no match. Fix: explicit error states and dead-letter queue.
1375. **No freshness rule.** Old data overwrites newer CRM data. Fix: compare timestamps and source priority.
1386. **Polling huge jobs.** Polling wastes compute and API calls. Fix: signed webhooks with retry handling.
139 
140## Execution Artifacts
141 
142- `references/framework-notes.md` — named frameworks, citation anchors, and operating assumptions
143- `templates/output-template.md` — copy-paste deliverable structure for the user
144- `scripts/check-output.py` — local checklist validator for required sections
145This skill includes lightweight artifacts the agent can load on demand:
146Use the artifacts when the user asks for an implementation-ready deliverable, a repeatable workflow, or a quality check rather than generic advice.
147 
148## Related Skills
149 
150- `waterfall-enrichment` — multi-provider enrichment design
151- `data-enrichment-strategy` — source selection and data quality
152- `crm-integration` — CRM writes and lifecycle fields
153- `campaign-analytics` — measuring enrichment impact on pipeline
154 
View all files on GitHub →

Details

License
MIT
Stars on the repo
★ 62
Checked
Source
LeadMagic/gtm-skills ↗
Creator
LeadMagic · 129 listings
View creator

Similar skills

See all →
SkillAPI Interface Designaddyosmani/agent-skills · by addyosmaniGuides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.★ 98.7k GitHub starsAgentVersion-Specific Docs Lookupupstash/context7 · by upstashPulls up-to-date, version-specific library docs and code examples into the prompt so the AI stops inventing old APIs.★ 62.3k GitHub starsSkillAdaptyv Bio Foundry APIK-Dense-AI/scientific-agent-skills · by K-Dense-AIHow to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.★ 46k GitHub starsSkill.NET Backend Developerwshobson/agents · by wshobsonMaster C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications. Covers async/await, dependency injection, Entity Framework Core, Dapper, configuration, caching, and testing with xUnit. Use when developing .NET backends, reviewing C# code, or designing API architectures.★ 39.9k GitHub starsSkillGemini Agent API Guidegoogle/skills · by googleGuides the usage of Gemini Interactions API on Gemini Enterprise Agent Platform. Use when the user wants to use the stateful, server-managed Interactions API for multi-turn conversations, background execution, streaming, structured output, and function calling on the Agent Platform.★ 20.9k GitHub starsSkillGemini Notebook Automationteng-lin/notebooklm-py · by teng-linInstall, authenticate, troubleshoot, and operate Gemini Notebook through the notebooklm-py CLI or typed async Python API. Use for notebook and source management, grounded chat and research, and artifact generation or download when the user mentions Gemini Notebook, notebooklm-py, the notebooklm CLI, or its Python API. Do not use for the generic Gemini API or unrelated content creation.★ 19.6k GitHub stars

More from LeadMagic

SkillFirst-Party Analytics SetupLeadMagic/gtm-skills · by LeadMagicSet up first-party tracking and analytics — website pixels, conversion tracking, UTM architecture, cookie consent, server-side tagging vs client-side, 1P vs 3P data strategy, and identity resolution. Use when setting up tracking, implementing pixels, building attribution, or preparing for privacy-first measurement. Triggers on: "pixel", "tracking", "conversion tracking", "first-party data", server-side tagging", "UTM", "cookie consent", "1P vs 3P", "identity resolution", or any tracking implementation request.★ 62 GitHub starsSkillStrategic Account MarketingLeadMagic/gtm-skills · by LeadMagicRuns strategic 1-to-1 ABM for 5-15 high-value accounts: account plans, custom microsites, executive engagement, direct mail, and board-level connections. Use when a named enterprise account justifies bespoke content and executive time, or when the user needs a strategic account plan. Triggers on: "1-to-1 ABM", "strategic ABM", "custom ABM", "key account marketing", "named account".★ 62 GitHub starsSkillCluster Account MarketingLeadMagic/gtm-skills · by LeadMagicRuns ABM at scale (1-to-few) for 15-50 clustered accounts: industry or persona clusters, semi-custom campaigns, and cluster-level content. Use when named-account ABM needs to reach more accounts without bespoke work per account. Triggers on: "1-to-few ABM", "ABM scale", "cluster ABM", "industry ABM".★ 62 GitHub starsSkillProgrammatic Account TargetingLeadMagic/gtm-skills · by LeadMagicRuns programmatic 1-to-many ABM for 50-200+ accounts: automated personalization, scaled outbound, intent-based targeting, and lookalike expansion. Use when ABM coverage must grow without adding headcount or when the user wants automated account-based outreach. Triggers on: "1-to-many ABM", programmatic ABM", "scaled ABM", "automated ABM".★ 62 GitHub starsSkillAccount Strategy DesignerLeadMagic/gtm-skills · by LeadMagicDesigns an account-based marketing program: tier selection, account scoring, channel orchestration, BDR alignment (account-based sales development), and a measurement framework. Use when the user is launching or redesigning ABM, choosing between 1-to-1, 1-to-few, and 1-to-many, or building a target account program. Triggers on: "ABM strategy", "account based marketing", "ABM playbook", "design ABM", "target accounts", "ABSD", "account based sales development", "Lars Nilsson".★ 62 GitHub starsSkillTarget Account SelectorLeadMagic/gtm-skills · by LeadMagicBuilds and tiers a target account list: fit and intent scoring models, tier assignment, and TAM segmentation. Use when the user needs to decide which accounts to target, score or tier an account list, or prioritize a TAM for ABM or outbound. Triggers on: "account selection", "target account list", "tier accounts", "prioritize accounts", "TAM segmentation".★ 62 GitHub stars