Skip to content

Commit eb232db

Browse files
BloqAITeamclaude
andcommitted
Fix Apollo API auth: use X-Api-Key header instead of body param
Apollo.io now requires the API key in the X-Api-Key header, not in the request body. Updated _headers and _make_request accordingly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3077fb1 commit eb232db

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

backend/app/services/apollo.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def _headers(self) -> dict[str, str]:
3333
return {
3434
"Content-Type": "application/json",
3535
"Cache-Control": "no-cache",
36+
"X-Api-Key": self.api_key,
3637
}
3738

3839
async def _rate_limit(self) -> None:
@@ -78,15 +79,13 @@ async def _make_request(
7879

7980
url = f"{self.BASE_URL}/{endpoint}"
8081

81-
# Apollo uses api_key in the request body for POST requests
8282
if data is None:
8383
data = {}
84-
data["api_key"] = self.api_key
8584

8685
async with httpx.AsyncClient(timeout=30.0) as client:
8786
if method.upper() == "GET":
8887
response = await client.get(
89-
url, headers=self._headers, params={**(params or {}), "api_key": self.api_key}
88+
url, headers=self._headers, params=params
9089
)
9190
else:
9291
response = await client.post(

0 commit comments

Comments
 (0)