fix: correct API issues found by second codex review across 14 CLIs

Fixes from thorough codex review (o3 high reasoning, 5 parallel batches):

Validation fixes:
- customer-io: add ID validation for customer/campaign commands, event name check
- dub: fix links get to use /links/info endpoint, add --id validation
- google-search-console: fix countries to use ['country'] only, add --url validation
- mention-me: add --customer-id validation on referral/share/reward commands
- tolt: add --id validation for affiliates get/update

Auth & API fixes:
- apollo: move API key from header to JSON body, fix search endpoint path
- rewardful: change from Bearer to Basic auth
- hotjar: split OAuth URL (unversioned) from resource URL (v2)
- amplitude: wrap retention e param in JSON array
- snov: change list prospects from GET to POST with JSON body
- optimizely: change archive from DELETE to PATCH status=archived
- google-ads: fix budget body field from camelCase to snake_case
- resend: change webhook field from endpoint to url, add validation
- linkedin-ads: add required campaignGroup URN, fix numeric amount types

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Corey Haines
2026-02-17 14:31:29 -08:00
parent aad399682c
commit ebdf1dd2f1
14 changed files with 62 additions and 29 deletions
+4 -5
View File
@@ -9,17 +9,16 @@ if (!API_KEY) {
}
async function api(method, path, body) {
const authBody = body ? { ...body, api_key: API_KEY } : { api_key: API_KEY }
if (args['dry-run']) {
return { _dry_run: true, method, url: `${BASE_URL}${path}`, headers: { 'x-api-key': '***', 'Content-Type': 'application/json', 'Accept': 'application/json' }, body: body || undefined }
return { _dry_run: true, method, url: `${BASE_URL}${path}`, headers: { 'Content-Type': 'application/json' }, body: { ...authBody, api_key: '***' } }
}
const res = await fetch(`${BASE_URL}${path}`, {
method,
headers: {
'x-api-key': API_KEY,
'Content-Type': 'application/json',
'Accept': 'application/json',
},
body: body ? JSON.stringify(body) : undefined,
body: JSON.stringify(authBody),
})
const text = await res.text()
try {
@@ -67,7 +66,7 @@ async function main() {
if (args.seniorities) body.person_seniorities = args.seniorities.split(',')
if (args['employee-ranges']) body.organization_num_employees_ranges = args['employee-ranges'].split(',').map(r => r.trim())
if (args.keywords) body.q_keywords = args.keywords
result = await api('POST', '/mixed_people/api_search', body)
result = await api('POST', '/mixed_people/search', body)
break
}
case 'enrich': {