# Apollo.io에서 마이그레이션

이 가이드는 Apollo.io의 People Enrichment(`POST /api/v1/people/match`) 및 Bulk People Enrichment(`POST /api/v1/people/bulk_match`) 엔드포인트를 Tomba에 매핑합니다. Apollo.io API 동작은 2026-09-30에 [Apollo.io API 참조](https://docs.apollo.io/reference/people-enrichment)를 기준으로 확인했습니다.

## 시작하기 전에

- API 키(`ta_…`)와 시크릿 키(`ts_…`)를 발급받습니다. [인증](/authentication)을 참고합니다.
- 각 엔드포인트의 비용은 [크레딧 비용](/usage-and-quotas#credit-costs)에서, 사용 중인 플랜의 스로틀링은 [플랜별 한도](/rate-limits#limits-by-plan)에서 확인합니다.
- Apollo.io는 보내는 식별자가 무엇이든 그것으로 인물을 매칭합니다. Tomba는 입력마다 엔드포인트가 하나씩 있으므로, 가지고 있는 식별자(이름과 회사, LinkedIn URL, 이메일 주소)에 따라 엔드포인트를 선택합니다.
- HTTP 클라이언트 타임아웃을 180초 이상으로 설정합니다. Tomba는 전화번호를 포함한 완성된 결과를 응답으로 반환합니다.

## 엔드포인트 매핑

기본 URL `https://api.apollo.io/api/v1`을 `https://api.tomba.io/v1`으로 바꿉니다. Apollo.io는 `POST` 요청을 받지만, Tomba 조회는 쿼리 매개변수를 사용하는 `GET` 요청입니다.

| Apollo.io                                                            | Tomba                                               | 참고                                                                                      |
| -------------------------------------------------------------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| 이름과 `domain` 또는 `organization_name`을 사용하는 `POST /people/match` | [`GET /v1/email-finder`](/api/finder#email-finder)  | 인물의 업무용 주소를 반환합니다.                                                         |
| `linkedin_url`을 사용하는 `POST /people/match`                             | [`GET /v1/linkedin`](/api/finder#linkedin-finder)   | Email Finder와 같은 필드를 반환합니다.                                               |
| `email`을 사용하는 `POST /people/match`                                    | [`GET /v1/people/find`](/api/enrichment#person-api) | 인물 정보를 Clearbit 형식으로 반환합니다. [보강](/attributes/enrichment)을 참고합니다. |
| `reveal_phone_number`를 사용하는 `POST /people/match`                      | [`GET /v1/phone-finder`](/api/phone#phone-finder)   | 또는 Email Finder나 LinkedIn Finder 요청에 `enrich_mobile=true`를 추가합니다.                |
| `POST /people/bulk_match`                                            | 대량 작업                                           | [대량 작업 및 비동기 작업](#bulk-and-async-jobs)을 참고합니다.                                           |

## 인증 변경 사항

Apollo.io는 `x-api-key` 헤더나 OAuth 2.0 Bearer 토큰에서 키를 읽습니다. Tomba에는 `X-Tomba-Key`와 `X-Tomba-Secret` 헤더 두 개가 필요합니다. Tomba도 OAuth 2.0을 지원합니다. [OAuth 2.0](/authentication#oauth-20)을 참고합니다.

```bash
# Apollo.io
curl -X POST "https://api.apollo.io/api/v1/people/match?first_name=Jane&last_name=Doe&domain=stripe.com" \
  -H "x-api-key: $APOLLO_API_KEY"

# Tomba
curl "https://api.tomba.io/v1/email-finder?first_name=Jane&last_name=Doe&domain=stripe.com" \
  -H "X-Tomba-Key: $TOMBA_API_KEY" \
  -H "X-Tomba-Secret: $TOMBA_SECRET_KEY"
```

Tomba API 키에는 만료 기한이 있습니다. [키 만료](/authentication#key-expiry)를 참고해 키 교체 일정을 계획합니다.

## 매개변수 매핑

| Apollo.io                                    | Tomba                                                          | 참고                                                                                                                                                                        |
| -------------------------------------------- | -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `first_name`, `last_name`                    | `first_name`, `last_name`                                      | Email Finder에서 사용합니다.                                                                                                                                                                |
| `name`                                       | `full_name`                                                    | Email Finder에서 사용합니다. `first_name`과 `last_name` 중 하나라도 보내지 않을 때 사용됩니다.                                                                                                       |
| `domain`                                     | `domain`                                                       | Email Finder에서 사용합니다. 일회용 또는 웹메일 도메인은 `400 unknown_record`를 반환합니다.                                                                                                   |
| `organization_name`                          | `company`                                                      | Email Finder에서 사용합니다. Apollo.io는 이전 직장도 매칭하지만, Tomba는 보낸 회사를 검색합니다. 도메인을 보내면 더 나은 결과를 얻습니다.                                                |
| `linkedin_url`                               | [`GET /v1/linkedin`](/api/finder#linkedin-finder)의 `url`     |                                                                                                                                                                              |
| `email`                                      | [`GET /v1/people/find`](/api/enrichment#person-api)의 `email` |                                                                                                                                                                              |
| `reveal_phone_number`                        | `enrich_mobile=true`                                           | 번호는 같은 응답의 `data.phone_data`에 추가 비용으로 반환되며, 웹훅이 필요 없습니다.                                                                      |
| `webhook_url`                                | `webhook_url`                                                  | Tomba에서는 선택 사항입니다. 결과는 여전히 응답으로 반환되며, 조건을 충족하면 지정한 URL로도 POST됩니다. [요청별 콜백](/webhook#per-request-callbacks)을 참고합니다. |
| `id`, `hashed_email`                         | 대응 항목 없음                                                  |                                                                                                                                                                              |
| `reveal_personal_emails`                     | 대응 항목 없음                                                  | Tomba는 업무용 주소를 반환합니다.                                                                                                                                                |
| `run_waterfall_email`, `run_waterfall_phone` | 대응 항목 없음                                                  |                                                                                                                                                                              |
| `poll_only`                                  | 대응 항목 없음                                                  | 모든 Tomba 응답은 최종 결과입니다.                                                                                                                                               |

## 응답 필드 매핑

Apollo.io는 인물을 `person`에 반환합니다. Tomba의 Email Finder와 LinkedIn Finder는 이를 `data`에 반환하며, 필드는 [인물](/attributes/person)에 설명되어 있습니다.

| Apollo.io                                    | Tomba                               | 참고                                                                                                                  |
| -------------------------------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `person.email`                               | `data.email`                        | 주소를 찾지 못하면 `null`이며, 상태 코드는 여전히 `200`입니다.                                                            |
| `person.email_status`                        | `data.verification.status`          | [상태 매핑](#status-mapping)을 참고합니다.                                                                                 |
| `person.first_name`, `last_name`             | `data.first_name`, `data.last_name` |                                                                                                                        |
| `person.name`                                | `data.full_name`                    |                                                                                                                        |
| `person.title`                               | `data.position`                     |                                                                                                                        |
| `person.linkedin_url`                        | `data.linkedin`                     |                                                                                                                        |
| `person.country`                             | `data.country`                      | Tomba에서는 두 글자 국가 코드입니다.                                                                                    |
| `person.departments[]`                       | `data.department`                   | 부서 하나입니다. 부서 이름이 다릅니다.                                                                           |
| `person.organization`                        | `data.company`, `data.website_url`  | 회사 이름과 도메인입니다. 전체 회사 프로필이 필요하면 [`GET /v1/companies/find`](/api/enrichment#company-api)를 호출합니다. |
| `person.phone_numbers[].sanitized_number`    | `data.phone_data[].e164_format`     | `enrich_mobile=true`를 지정한 경우입니다. `line_type`은 번호 유형을 나타냅니다. [전화번호 응답](/attributes/phone)을 참고합니다.                 |
| `person.match_confidence`                    | `data.score`                        | 계산 방식이 다릅니다. 이 값에 적용하는 임계값을 다시 조정합니다.                                                       |
| `person.city`, `state`                       | 대응 항목 없음                       | Tomba에 해당 정보가 있으면 [`GET /v1/people/find`](/api/enrichment#person-api)가 `data.geo.city`와 `data.geo.state`를 반환합니다.  |
| `person.seniority`                           | 대응 항목 없음                       | Tomba에 해당 정보가 있으면 [`GET /v1/people/find`](/api/enrichment#person-api)가 `data.employment.seniority`를 반환합니다.             |
| `person.id`, `contact_id`, `organization_id` | 대응 항목 없음                       |                                                                                                                        |
| `person.headline`, `employment_history`      | 대응 항목 없음                       |                                                                                                                        |
| `request_id`, `waterfall`                    | 대응 항목 없음                       | Tomba는 `X-Request-ID` 헤더에 요청 ID를 반환합니다. [프로덕션 배포](/going-to-production)를 참고합니다.              |

Tomba는 `pattern`, `type`, `gender`, `accept_all`과 주소가 발견된 `sources`도 반환합니다. 이메일로 조회하는 경우 `GET /v1/people/find`는 `data.name`, `data.employment`, `data.geo`, `data.linkedin.handle`을 반환합니다. [보강](/attributes/enrichment)을 참고합니다.

## 상태 매핑

| Apollo.io `email_status` | Tomba `verification.status` |
| ------------------------ | --------------------------- |
| `verified`               | `valid`                     |

Tomba는 `accept_all`, `invalid`, `unknown`도 반환하며, 주소가 검증되지 않은 경우 `null`을 반환합니다. `status`는 대소문자를 구분하지 않고 비교합니다. 각 값의 정의는 [상태 값](/attributes/verifier#status-values)에 있습니다.

## 오류 매핑

Apollo.io는 `error` 문자열을 반환합니다. Tomba는 다음과 같이 `type`, `message`, `code`가 포함된 `errors` 객체를 반환합니다.

| Apollo.io                                              | Tomba                                                                                                                        | 조치                                                                                          |
| ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| `400` 유효성 검사 오류                                 | `422 params_invalid`                                                                                                         | 메시지에 명시된 매개변수를 수정합니다.                                                             |
| `400` `reveal_phone_number` 사용 시 `webhook_url` 누락 | 반환되지 않음                                                                                                                 | Tomba는 전화번호에 웹훅이 필요하지 않습니다.                                                     |
| `401` 잘못된 API 키                                  | `400 authentication_failed`(누락 또는 형식 오류), `400 api_key_expired`, `401 authentication_failed`(잘못된 키 또는 시크릿 키) | 두 헤더를 모두 확인하고, 만료된 키는 [교체](/authentication#rotate-keys)합니다.                           |
| `429` 속도 제한 초과                              | `429 rate_limit`                                                                                                             | `Retry-After` 지연 시간이 지난 후 재시도합니다. [429 응답 처리](/rate-limits#handle-429-responses)를 참고합니다. |

크레딧이 소진되었을 때의 `402 quota_exceeded`, Email Finder가 일회용 또는 웹메일 도메인을 받았을 때의 `400 unknown_record`, 주소 소유자가 Tomba에 처리 중단을 요청했을 때의 `451 claimed_email`도 처리합니다. Tomba에 해당 주소의 데이터가 없으면 `GET /v1/people/find`는 `not_found` 유형의 `errors` 객체가 포함된 `200`을 반환하므로 본문의 `errors`를 확인합니다. 오류 응답은 크레딧을 소비하지 않으며, 모든 유형은 [오류](/error-handling#error-types)에 나와 있습니다.

Apollo.io는 `x-rate-limit-*` 및 `x-*-requests-left` 헤더로 한도를 알려 줍니다. Tomba의 헤더는 [속도 제한 헤더](/rate-limits#rate-limit-headers)에 설명되어 있습니다.

## 대량 작업 및 비동기 작업

Apollo.io의 대량 엔드포인트는 `details[]`에 최대 10명을 받고 응답에 `matches[]`를 반환합니다. Tomba는 목록을 대량 작업으로 실행하며, 유형별 행 한도는 [대량 작업 유형](/bulks#bulk-types)에 있습니다.

| Apollo.io `details[]` 항목 | Tomba 대량 작업 유형                                                                                         |
| ----------------------------- | ------------------------------------------------------------------------------------------------------- |
| 이름과 `domain` 또는 회사  | `finder`: 이름 및 회사 열이 있는 CSV 파일. [Email Finder](/bulks#email-finder)를 참고합니다.            |
| `linkedin_url`                | `linkedin`: 프로필 URL의 JSON `list` 또는 CSV 파일. [LinkedIn Finder](/bulks#linkedin-finder)를 참고합니다. |
| `email`                       | `enrich`: 주소의 JSON `list` 또는 CSV 파일. [Email Enrichment](/bulks#email-enrichment)를 참고합니다.    |
| `reveal_phone_number`         | 작업에서 `phone`을 `true`로 설정합니다. 추가 비용이 발생합니다.                                                     |

각 작업은 생성, 실행, 폴링을 거쳐 CSV로 다운로드합니다. [수명 주기](/bulks#lifecycle)를 참고합니다. 작업이 끝날 때 알림을 받으려면 `webhook_url`을 설정합니다. [대량 작업 이벤트](/webhook#bulk-job-events)를 참고합니다. 작업 비용은 결과를 처음 다운로드할 때 청구됩니다. [청구](/bulks#billing)를 참고합니다.

대량 응답 필드 `total_requested_enrichments`, `unique_enriched_records`, `missing_records`, `credits_consumed`에는 대응 항목이 없습니다. 대신 작업 진행 상황을 폴링합니다.

## 코드 예제

이 함수는 이름과 회사 또는 LinkedIn URL로 수행하는 `people/match` 호출을 대체합니다. Apollo.io의 `person` 필드 이름을 반환하거나, Tomba가 주소를 찾지 못하면 `null`을 반환합니다. Node.js 18 이상이 필요합니다.

```js title="people-match.mjs"
const TOMBA_HEADERS = {
    "X-Tomba-Key": process.env.TOMBA_API_KEY,
    "X-Tomba-Secret": process.env.TOMBA_SECRET_KEY,
};

// Accepts Apollo.io's parameters: linkedin_url, or first_name + last_name
// (or name) with domain or organization_name.
async function peopleMatch(params) {
    let url;
    if (params.linkedin_url) {
        url = new URL("https://api.tomba.io/v1/linkedin");
        url.searchParams.set("url", params.linkedin_url);
    } else {
        url = new URL("https://api.tomba.io/v1/email-finder");
        const map = {
            first_name: "first_name",
            last_name: "last_name",
            name: "full_name",
            domain: "domain",
            organization_name: "company",
        };
        for (const [apollo, tomba] of Object.entries(map)) {
            if (params[apollo]) url.searchParams.set(tomba, params[apollo]);
        }
    }
    if (params.reveal_phone_number)
        url.searchParams.set("enrich_mobile", "true");

    const res = await fetch(url, { headers: TOMBA_HEADERS });
    const body = await res.json();
    if (body.errors) {
        throw new Error(
            `${res.status} ${body.errors.type}: ${body.errors.message}`,
        );
    }

    const found = body.data;
    if (!found.email) return null;
    const status = found.verification?.status?.toLowerCase() ?? null;
    return {
        first_name: found.first_name,
        last_name: found.last_name,
        name: found.full_name,
        email: found.email,
        // Apollo.io's "verified" is Tomba's "valid"; other statuses pass through.
        email_status: status === "valid" ? "verified" : status,
        title: found.position,
        linkedin_url: found.linkedin,
        country: found.country,
        phone_numbers: (found.phone_data ?? []).map((phone) => ({
            sanitized_number: phone.e164_format,
        })),
    };
}

console.log(
    await peopleMatch({
        first_name: "Jane",
        last_name: "Doe",
        domain: "stripe.com",
    }),
);
```

## 전환 체크리스트

1. Tomba 키와 시크릿 키를 `TOMBA_API_KEY`와 `TOMBA_SECRET_KEY`로 저장하고, `x-api-key` 대신 `X-Tomba-Key`와 `X-Tomba-Secret`으로 보냅니다.
2. 각 `people/match` 호출을 입력에 따라 라우팅합니다. 이름과 회사는 `/v1/email-finder`로, LinkedIn URL은 `/v1/linkedin`으로, 이메일 주소는 `/v1/people/find`로 보냅니다.
3. `reveal_phone_number`와 해당 웹훅을 `enrich_mobile=true`로 바꾸고, `data.phone_data`에서 번호를 읽습니다.
4. 응답 파싱을 수정합니다. `person` 대신 `data`를, `title` 대신 `position`을, `linkedin_url` 대신 `linkedin`을 읽고, `email_status`는 [상태 매핑](#status-mapping)에 따라 변환합니다.
5. 크레딧 소진 시의 `402`를 처리하고, `429`는 `Retry-After` 이후 재시도하며, `451`을 반환하는 주소는 제외합니다.
6. `bulk_match` 배치를 `finder`, `linkedin`, `enrich` 대량 작업으로 옮깁니다.
7. 프로덕션 트래픽을 전환하기 전에 같은 샘플 인물을 두 서비스에서 실행하고 결과를 비교합니다.
