SDKs // TypeScript // Resources
client.contact
Last verified
Use client.contact in the Reverse Contact TypeScript SDK to find emails and phone numbers or verify addresses, with job results, costs and safe retries.
Start jobs to find email addresses or phone numbers, or verify an email address.
| Method | Endpoint | Cost |
|---|---|---|
client.contact.findEmail() | Find Email | 3 credits when a professional email is found, 5 for a personal one, regardless of emailType. An any lookup costs 3, 5 or 8 (8 when it finds both). A lookup that finds none is free. |
client.contact.verifyEmail() | Verify Email | 1 credit per verdict, regardless of the outcome. A check that fails is refunded. |
client.contact.findPhone() | Find Phone | 20 credits when a phone number is found. A lookup that finds none is free. |
Create client by following Install and configure. The @reverse-contact/sdk package exports Body, Data, Query and the other types used in the signatures.
JSON responses contain data and optional quotas and metadata. They also include the original response, with its body already read. See First call for response handling.
HTTP errors use the APIError subclasses and retry rules: BadRequestError, AuthenticationError, InsufficientCreditsError, PermissionDeniedError, NotFoundError, ConflictError, GoneError, UnprocessableEntityError, RateLimitError, DailyLimitError, KeyCreditLimitError, UnavailableForLegalReasonsError and InternalServerError, according to the API response. Other statuses use APIError.
Contact methods generate an Idempotency-Key for each call and reuse that key on automatic retries. Save an explicit idempotencyKey to retry after restarting. See Safe retries.
findEmail()
Provide url or id. You can also use fullName with companyDomain, or firstName and lastName with companyDomain. If you supply both URL and id, id takes precedence. emailType defaults to professional.
Signature
client.contact.findEmail(
params: Body<"findContactEmail">,
options?: IdempotentRequestOptions
): Promise<Job<ContactValue[]>>Parameters
| Name | Type | Description |
|---|---|---|
params required | Body<"findContactEmail"> | Request body. See the fields and their requirements below. |
params.url conditional | string | Public Social profile URL, such as https://www.social.com/in/janedoe. Use this to look up a person by URL. |
params.id conditional | string | Reverse Contact person id from a previous response, such as prs_01jbd5vewyenebxgaz869ffe5t. Use this to look up a person by id. |
params.fullName conditional | string | Person's full name, such as Jane Doe. Use this with companyDomain. |
params.firstName conditional | string | Person's first name. Use this with lastName and companyDomain instead of fullName. |
params.lastName conditional | string | Person's last name. Use this with firstName and companyDomain instead of fullName. |
params.companyDomain conditional | string | Company domain, such as acme.com. Required when you look up a person by name. |
params.emailType | string | Kind of email to find: professional (default), personal, or any to accept either. Omit it to find professional emails. |
params.webhookUrl | string | HTTPS URL that receives the callback. Omit it to retrieve the result by polling instead. |
options | IdempotentRequestOptions | Optional per-request timeout, maxRetries, headers and signal. See Client options. Also accepts idempotencyKey. The SDK generates a key if you omit it. |
Returns
A Job<ContactValue[]>, with the webhookId in job.id. Call await job.wait() to get data.result, an array of { value, type } email entries. Waiting is free. See Async jobs for wait() options and webhook delivery.
Errors
Calls can raise the HTTP APIError subclasses listed above. Network failures or cancellation raise APIConnectionError, and attempt timeouts raise APITimeoutError. ReverseContactError reports invalid SDK options or an invalid successful JSON response. Waiting raises JobFailedError for an errored job and JobTimeoutError when the overall deadline expires. If you supply an invalid idempotency key, the SDK raises ReverseContactError before sending a request.
Example
Example
const job = await client.contact.findEmail({ fullName: "Jane Doe", companyDomain: "acme.com" });
console.log("Save job id:", job.id);
const done = await job.wait();
for (const email of done.data.result ?? []) console.log(email.value, email.type);verifyEmail()
Provide the email address to verify. Addresses returned by Find Email are already verified.
Signature
client.contact.verifyEmail(
params: Body<"verifyContactEmail">,
options?: IdempotentRequestOptions
): Promise<Job<EmailVerification>>Parameters
| Name | Type | Description |
|---|---|---|
params required | Body<"verifyContactEmail"> | Request body. See the fields and their requirements below. |
params.email required | string | The email address to check, such as jane@acme.com. |
params.webhookUrl | string | HTTPS URL that receives the result, including error outcomes. Omit it to poll for the verdict instead. |
options | IdempotentRequestOptions | Optional per-request timeout, maxRetries, headers and signal. See Client options. Also accepts idempotencyKey. The SDK generates a key if you omit it. |
Returns
A Job<EmailVerification>, with the webhookId in job.id. Call await job.wait() to get data.result with email and status. The status is valid, risky, invalid or unknown. Waiting is free. See Async jobs for wait() options and webhook delivery.
Errors
Calls can raise the HTTP APIError subclasses listed above. Network failures or cancellation raise APIConnectionError, and attempt timeouts raise APITimeoutError. ReverseContactError reports invalid SDK options or an invalid successful JSON response. Waiting raises JobFailedError for an errored job and JobTimeoutError when the overall deadline expires. If you supply an invalid idempotency key, the SDK raises ReverseContactError before sending a request.
Example
Example
const job = await client.contact.verifyEmail({ email: "jane@acme.com" });
console.log("Save job id:", job.id);
const done = await job.wait();
console.log(done.data.result?.status);findPhone()
Provide url or id. You can also use fullName with companyDomain, or firstName and lastName with companyDomain. If you supply both URL and id, id takes precedence.
Signature
client.contact.findPhone(
params: Body<"findContactPhone">,
options?: IdempotentRequestOptions
): Promise<Job<ContactValue[]>>Parameters
| Name | Type | Description |
|---|---|---|
params required | Body<"findContactPhone"> | Request body. See the fields and their requirements below. |
params.url conditional | string | Public Social profile URL, such as https://www.social.com/in/janedoe. Use this to look up a person by URL. |
params.id conditional | string | Reverse Contact person id from a previous response, such as prs_01jbd5vewyenebxgaz869ffe5t. Use this to look up a person by id. |
params.fullName conditional | string | Person's full name, such as Jane Doe. Use this with companyDomain. |
params.firstName conditional | string | Person's first name. Use this with lastName and companyDomain instead of fullName. |
params.lastName conditional | string | Person's last name. Use this with firstName and companyDomain instead of fullName. |
params.companyDomain conditional | string | Company domain, such as acme.com. Required when you look up a person by name. |
params.webhookUrl | string | HTTPS URL that receives the callback. Omit it to retrieve the result by polling instead. |
options | IdempotentRequestOptions | Optional per-request timeout, maxRetries, headers and signal. See Client options. Also accepts idempotencyKey. The SDK generates a key if you omit it. |
Returns
A Job<ContactValue[]>, with the webhookId in job.id. Call await job.wait() to get data.result, an array of { value, type } phone entries. Waiting is free. See Async jobs for wait() options and webhook delivery.
Errors
Calls can raise the HTTP APIError subclasses listed above. Network failures or cancellation raise APIConnectionError, and attempt timeouts raise APITimeoutError. ReverseContactError reports invalid SDK options or an invalid successful JSON response. Waiting raises JobFailedError for an errored job and JobTimeoutError when the overall deadline expires. If you supply an invalid idempotency key, the SDK raises ReverseContactError before sending a request.
Example
Example
const job = await client.contact.findPhone({ url: "https://social.com/in/janedoe" });
console.log("Save job id:", job.id);
const done = await job.wait();
for (const phone of done.data.result ?? []) console.log(phone.value, phone.type);Related guides
Async jobs, Errors and retries. Return to the TypeScript SDK overview.
FAQ
Does client.contact return email results immediately?
Contact methods return a Job acknowledgement. Call job.wait() to read the final result in data.result.
Which SDK method verifies an email address?
client.contact.verifyEmail() starts a verification job. The result contains email and a status of valid, risky, invalid or unknown.
How do I avoid duplicate contact jobs during retries?
Contact methods generate an Idempotency-Key per call and reuse that key on automatic retries. Save an explicit idempotencyKey to retry after restarting.