Developer documentation Create API Key
Developers/Quickstart

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 your API key.

Step 01
  1. Create and verify an account or log in. You will go directly to the key-creation screen.
  2. In Dashboard → Create API Key, optionally name your integration, then click Create API Key.
  3. Click Copy key and save it in your secret manager before closing. The full key is shown once and cannot be retrieved again. Your backend or agent uses it independently without a dashboard session, within your workspace’s access and usage limits.

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.

For guided agent setup and connection settings, follow the agent quickstart.

Configure your backend environment.

Step 02

Set these values in your server’s environment. The production base URL is shown below. Load your actual key from secret storage.

Production base URL · key placeholder
TARGETWISE_BASE_URL=https://targetwise.ai/api/v1
TARGETWISE_API_KEY=YOUR_TARGETWISE_KEY

The 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 03

Use 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
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 04

An HTTP 200 confirms that the lookup completed. It does not guarantee that an email exists. Add this branch after the JavaScript request example above.

Handle a work-email result · JavaScript
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.
}
CheckExpected behavior
A known, well-identified personInspect the identity and returned field before accepting the value.
A person with an unavailable emailHandle partial or not_found without inventing a value.
Invalid or incomplete identifiersHandle HTTP 400 and correct the input before retrying.
An invalid or revoked keyHandle 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.

If the first request does not work.

SymptomCheck first
Sign-in page or HTML responseThe configured origin must be reachable by external clients. Use https://targetwise.ai/api/v1 for REST requests.
HTTP 400Use one identifier pattern. Do not combine LinkedIn, company name and company domain.
HTTP 401Check the bearer header and whether the key is active.
HTTP 402Check workspace credits in the dashboard.
HTTP 429Respect Retry-After when present and check workspace limits.
HTTP 503The service connection needs configuration; changing the test person will not fix it.
HTTP 200 with no emailRead status and unresolved_fields; not_found is a valid outcome.

For other responses, use the error reference.

Common questions