Your first request
From a workspace key to a work email.
Start with one known person. This guide walks through authentication, a single email lookup and the response branches your application needs to handle.
Create a named API key.
Step 01- Create an account or log in to your existing workspace.
- Open Dashboard → Developers and create a key named for this integration.
- Save the full key when it is displayed. Keep it in your secret manager; it cannot be retrieved again.
Use a separate key for each integration so you can revoke one without disrupting the others. The free plan includes 20 emails and 5 business-phone results; see pricing for the current plans.
Configure your backend environment.
Step 02Set these values in your server’s environment. The production base URL is shown below. Load your actual key from secret storage.
TARGETWISE_BASE_URL=https://targetwise.ai/api/v1
TARGETWISE_API_KEY=YOUR_TARGETWISE_KEYThe snippet lists environment values; configure them through your deployment settings or environment loader. It does not set them in your current shell. Keep the key out of source control and client-side code.
Request one work email.
Step 03Use the first and last name with a company domain, as shown below. Alternatively, send only linkedin_url. Replace these illustrative values with a real test record you are permitted to process.
curl --fail-with-body "$TARGETWISE_BASE_URL/contacts/find-work-email" \
-H "Authorization: Bearer $TARGETWISE_API_KEY" \
-H "Content-Type: application/json" \
--data '{"first_name":"Alex","last_name":"Reed","company_domain":"example.com"}'This endpoint requests email only. For both email and phone, use contact enrichment and set the field switches explicitly.
Handle the result before using the field.
Step 04An HTTP 200 confirms that the lookup completed. It does not guarantee that an email exists. Add this branch after the JavaScript request example above.
const email = result.data?.work_email;
if (result.status === "not_found") {
console.log("No email found for this identifier.");
} else if (typeof email === "string" && email.length > 0) {
// Apply identity and merge rules before storing the email.
// Avoid logging the email or full contact record.
console.log("Work email available.", result.request_id);
} else {
console.log("Required field unavailable.", result.request_id);
// Keep unresolved_fields with the application event.
}| Check | Expected behavior |
|---|---|
| A known, well-identified person | Inspect the identity and returned field before accepting the value. |
| A person with an unavailable email | Handle partial or not_found without inventing a value. |
| Invalid or incomplete identifiers | Handle HTTP 400 and correct the input before retrying. |
| An invalid or revoked key | Handle HTTP 401 and replace the key; do not retry unchanged. |
Open Usage in your dashboard to inspect workspace activity after testing. Retain the response’s request_id for troubleshooting.
Extend the workflow when the first call works.
Find people first
Search within company domains, select a candidate, then enrich using their LinkedIn URL or name and company.
Contact search →Add company context
Resolve one website or legal identifier into a company profile for routing, research or account review.
Company enrichment →Connect an AI host
Use the same workspace key to discover TargetWise’s eleven MCP tools and inspect structured results.
MCP setup →Build an integration
Apply the request to a concrete trigger, with duplicate handling and explicit merge rules.
Integration recipes →If the first request does not work.
| Symptom | Check first |
|---|---|
| Sign-in page or HTML response | The configured origin must be reachable by external clients. Use https://targetwise.ai/api/v1 for REST requests. |
| HTTP 400 | Use one identifier pattern. Do not combine LinkedIn, company name and company domain. |
| HTTP 401 | Check the bearer header and whether the key is active. |
| HTTP 402 | Check workspace credits in the dashboard. |
| HTTP 429 | Respect Retry-After when present and check workspace limits. |
| HTTP 503 | The service connection needs configuration; changing the test person will not fix it. |
| HTTP 200 with no email | Read status and unresolved_fields; not_found is a valid outcome. |
For other responses, use the error reference.