To authenticate a LinkedIn profile enrichment API with an API key, send the key in a request header on every call. With ProfileHunt, that is either Authorization: Bearer <key> or x-api-key: <key>, both accepted on every endpoint. A missing, wrong or revoked key gets 401 with {"error":"unauthorized"} and costs nothing. This post covers how that check works, what a key looks like, what a 401 is telling you, and how to test a key. If you are new to profile APIs, start with what a LinkedIn profile API is.
Key takeaways
- Two headers, one key.
Authorization: Bearer <key>andx-api-key: <key>do the same thing. Pick one and use it everywhere. - Keys start with
ph_live_. Copy the whole value from the Keys page; anything else is a wrong key. - 401 means the key, nothing else. Running out of credits is
402and too many requests is429, so a 401 points only at the key. - Keys belong to a workspace. Every key in a workspace shares its credits; the rate limit of 60 requests a minute is per key.
- Testing a key takes one call. One lookup in the playground or with
POST /v1/profileanswers401for a bad key, and the Usage page shows every request the key made.

Bearer or x-api-key: which header to use
Both headers authenticate the same way. Use Authorization: Bearer when your tool has a built-in "Bearer token" option, and x-api-key when it only lets you add a custom header name and value.
curl -X POST https://api.profilehunt.dev/v1/profile \
-H "Authorization: Bearer $PROFILEHUNT_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://www.linkedin.com/in/williamhgates" }'
curl -X POST https://api.profilehunt.dev/v1/profile \
-H "x-api-key: $PROFILEHUNT_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://www.linkedin.com/in/williamhgates" }'
The Bearer scheme comes from RFC 6750, which defines how a token travels in the Authorization header. x-api-key is a common custom header that many API gateways and no-code tools already know.
| Header | Format | Best for |
|---|---|---|
Authorization | Bearer ph_live_… | Code, Postman's Bearer Token auth, n8n Header Auth (settings per client) |
x-api-key | ph_live_… (no prefix word) | Tools that only take a header name and value |
The key never goes in the URL or the JSON body. Send it in one of these two headers, which also keeps it out of access logs that record URLs.
What a ProfileHunt API key looks like
A ProfileHunt API key starts with ph_live_. The Keys page lists each key by name, with the start of the key, its creation date and the date it was last used.
That recognisable prefix matters in two ways:
- A damaged key is a wrong key. A key with a stray quote, a missing character or a leading
Bearerinsidex-api-keygets401, like any wrong key. - Leaks are easy to scan for. Searching for
ph_live_finds a key in a repository or a log. The guide on how developers should store credentials covers what to do with a match.
Workspace owners and admins can copy a key again from the Keys page later, so there is no need to paste it into a note.
What a 401 means, and what it doesn't
A 401 from ProfileHunt means one thing: the request did not carry a valid, active key. The body is always {"error":"unauthorized"}, and RFC 9110 defines 401 as exactly this, missing or failed credentials.
Each error code points at one thing, which is what makes a 401 easy to read:
- The key:
401 unauthorized - The per-key rate limit:
429 rate_limited - The profile URL:
422 invalid_url - The workspace's credits:
402 insufficient_credits
So a 401 says nothing about your body, your URL or your balance. And because a missing, wrong or revoked key always gets 401, any other answer, such as a 422 or a 402, means the key was accepted. Every one of these errors is free; the errors reference lists each code with when to retry.
The usual causes of a 401
| Cause | What it looks like | Fix |
|---|---|---|
| No header at all | Header name typo, or the tool dropped it | Check the exact header name in your client's request log |
Bearer missing | Authorization: ph_live_… | Add Bearer and one space before the key |
Bearer inside x-api-key | x-api-key: Bearer ph_live_… | x-api-key takes the bare key |
| Truncated or padded key | Copied part of the key, or with quotes | Copy again from the Keys page |
| Empty environment variable | Bearer followed by nothing | Check the variable is set in the process that runs the call |
| Revoked key | Worked yesterday, fails today | Use another active key from the workspace |
A revoked key gets 401. Create a new one on the Keys page and update the caller.
What Most Guides Get Wrong About API Key Authentication
Most guides treat authentication as a one-line header and stop there. Three points get missed.
"Sending both headers is safer." It isn't. Two key headers make a request harder to debug, especially when a tool adds a default Authorization header you forgot about. Send one header, so it's always clear which key made the call.
"A 401 might be a credit problem." It isn't. Running out of credits is 402 insufficient_credits, and too many requests is 429 rate_limited. Treating every non-200 as "auth broke" sends people rotating keys that were fine.
"Each key needs its own credits." Keys don't hold credits. Every key in a workspace draws from the same balance, so creating a key for a new app doesn't need a top-up. What a key does own is its rate limit: 60 requests a minute, counted per key.
Myth vs Reality
| Myth | Reality |
|---|---|
| You need a LinkedIn login or OAuth flow to call a LinkedIn profile API. | ProfileHunt uses only its own API key. No LinkedIn account, cookie or seat is involved. See enrichment without login credentials. |
Bearer keys and x-api-key keys are different kinds of key. | It is the same key. The header only changes how it is sent. |
| A failed request with a bad key still uses a credit. | A 401 is never charged. Only a found profile (status: "ok") uses a credit. |
| Checking a key needs a special endpoint. | One normal lookup does it: 401 means the key is bad, anything else means it was accepted (see below). |
| Revoking one key stops every app. | Revoking affects only that key. Other keys in the workspace keep working, which is why one key per app pays off. |

How to test a key
The simplest key test is one real lookup. Run it with no code in the dashboard playground, or send it from the process that will use the key:
curl -i -X POST https://api.profilehunt.dev/v1/profile \
-H "Authorization: Bearer $PROFILEHUNT_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://www.linkedin.com/in/williamhgates" }'
| Response | Meaning |
|---|---|
200 with a status | The key is valid and active. A found profile uses one credit; gone and unavailable use none. |
401 {"error":"unauthorized"} | The key is missing, wrong or revoked. Never charged. |
Then open the Usage page: it lists every request from the last 30 days with its status and the key that made it, so you can confirm the call came from the key you meant. Run the same check after a deploy to prove the secret reached the process and is still live; at $0.50 per 1,000 profiles, one found profile costs $0.0005.
Advanced: Keys, Workspaces and Attribution at Scale
Once more than one app calls the API, the key becomes your unit of attribution and isolation. A few patterns hold up well.
- One key per caller, not per person. Name keys after the system that uses them:
backend-prod,n8n,clay-table. The Usage page shows which key made each request, so a spike traces straight to its source. - Per-key rate limits are a feature. Each key gets its own 60 requests a minute. A runaway Clay table on its own key hits its own limit and leaves your production backend's budget untouched. Use the batch API when one caller needs more than 60 profiles a minute: one request carries up to 100 URLs.
- Read the rate-limit headers. Counted requests return
X-RateLimit-LimitandX-RateLimit-Remaining; a429addsRetry-After. The rate limits page explains the per-minute window. - Rotation is create-then-revoke. Create the new key, deploy it, watch the old key's "Last used" date stop moving, then revoke it. The secure authentication pattern walks through this as part of a full design.
Where ProfileHunt Fits
ProfileHunt is a LinkedIn Profile API: a public LinkedIn profile URL in, structured JSON out. Authentication is one workspace API key in one header, the same for single lookups and the batch API, and it works from any HTTP client, including Clay, n8n, Make and Zapier.
The key is the only credential involved. ProfileHunt never asks for your LinkedIn login, cookie or Sales Navigator seat, and it returns the public view of a profile: what a logged-out visitor sees.
Getting Started
Sign in at profilehunt.dev/login with Google or an emailed link. Your workspace comes with a key named Default and free credits: 100 with a work email, 10 with a personal one. The API key setup walkthrough goes from sign-up to your first call in code, and the authentication docs are the short reference. For what the API returns once you're in, see what a LinkedIn profile API is.
Frequently asked questions
How do I pass an API key in a curl request?
Add -H "Authorization: Bearer $PROFILEHUNT_KEY" or -H "x-api-key: $PROFILEHUNT_KEY" to the command, with the key stored in an environment variable. Don't put the key in the URL; ProfileHunt takes it in these headers.
Why does my LinkedIn profile API return 401 unauthorized?
The request didn't carry a valid, active key: the header is missing, Bearer is missing or misplaced, the key was copied incompletely, the environment variable is empty, or the key was revoked. A 401 is never charged. The errors reference lists every other status.
Should I use Bearer or x-api-key for a LinkedIn profile API?
Either works with ProfileHunt and they behave the same. Use Authorization: Bearer when your tool has a Bearer token option, x-api-key when it only takes a custom header, and send just one of them.
How can I check if my API key works?
Run one lookup with it, in the dashboard playground or with POST /v1/profile. A 401 means the key is missing, wrong or revoked; any other answer means it was accepted, and the request appears on the Usage page. The lookup uses one credit only if the profile is found.
Do all API keys in a workspace share the same credits?
Yes. Credits belong to the workspace, and every key in it draws from the same balance. The 60-requests-a-minute limit, on the other hand, applies to each key separately.


