API

조건 매칭 기반 관계 일괄 연결

작성일 2026.04.23 | 수정일 2026.04.23

POST/crm-core/v1/relationships/bulk-match
소스 레코드의 이름 또는 특정 속성값을 기준으로 대상 개체의 레코드를 자동 매칭하여 관계를 생성한다. 예를 들어 "이메일 값이 같은 고객 ↔ 회사 담당자"를 일괄 연결하는 용도. 권한 요구: MEMBER 이상.

Body Params

NameTypeRequiredDescription
sourceEntityIdstring소스 개체 ID
relationshipTypeIdstring관계 유형 ID
sourceRecordIdsArray소스 레코드 ID 목록. 최대 500개. sourceFilter와 택일
sourceFilterObject필터 조건으로 소스 레코드 선택 (최대 5,000건)
sourceFilter.keywordstring레코드 이름 부분 일치 키워드
sourceFilter.filtersstring속성값 필터 JSON 문자열
sourceFilter.segmentIdstring세그먼트 기반 필터
criteriaArray매칭 기준 목록. 최소 1개 이상
criteria[].myFieldObject소스 레코드에서 비교할 필드
criteria[].myField.typestringname 또는 property
criteria[].myField.propertyIdstringtype=property일 때 사용할 속성 ID
criteria[].counterFieldObject대상 레코드에서 비교할 필드
criteria[].counterField.typestringname 또는 property
criteria[].counterField.propertyIdstringtype=property일 때 사용할 속성 ID
matchModestringFIRST(첫 번째 매칭만) 또는 ALL(모든 매칭)

Response

NameTypeRequiredDescription
matchednumber매칭에 성공한 소스 레코드 수
creatednumber생성된 관계 수
skippednumber*매칭 실패 또는 중복으로 건너뛴 수

Structure

코드 예제

const response = await fetch('https://api.solapi.com/crm-core/v1/relationships/bulk-match', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer ' + TOKEN,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    sourceEntityId: 'CRMET1260423081530123XYZ11122233',
    relationshipTypeId: 'CRMRT1260423091530123RTP11122233',
    sourceRecordIds: ['CRMRC1260423081530123REC11122233'],
    criteria: [
      {
        myField: { type: 'property', propertyId: 'CRMPP1260423091530123PPP11122233' },
        counterField: { type: 'property', propertyId: 'CRMPP1260423091530124PPP11122234' }
      }
    ],
    matchMode: 'FIRST'
  })
});
const data = await response.json();
import requests

response = requests.post(
'https://api.solapi.com/crm-core/v1/relationships/bulk-match',
headers={'Authorization': f'Bearer {TOKEN}'},
json={
'sourceEntityId': 'CRMET1260423081530123XYZ11122233',
'relationshipTypeId': 'CRMRT1260423091530123RTP11122233',
'sourceRecordIds': ['CRMRC1260423081530123REC11122233'],
'criteria': [
{
'myField': {'type': 'property', 'propertyId': 'CRMPP1260423091530123PPP11122233'},
'counterField': {'type': 'property', 'propertyId': 'CRMPP1260423091530124PPP11122234'}
}
],
'matchMode': 'FIRST'
}
)
data = response.json()

curl -X POST 'https://api.solapi.com/crm-core/v1/relationships/bulk-match' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"sourceEntityId":"CRMET1260423081530123XYZ11122233","relationshipTypeId":"CRMRT1260423091530123RTP11122233","sourceRecordIds":["CRMRC1260423081530123REC11122233"],"criteria":[{"myField":{"type":"name"},"counterField":{"type":"name"}}],"matchMode":"FIRST"}'

lightbulb

`matchMode`가 `FIRST`이면 소스 1건당 첫 매칭 대상 1건에만 관계를 생성한다. `ALL`이면 매칭되는 모든 대상 레코드와 관계를 만들어 대상 개체에서 fan-out이 커질 수 있으니 주의.

lightbulb

`criteria`는 AND로 결합된다. 여러 기준을 모두 만족하는 대상 레코드만 매칭되며, 동일 조합의 관계가 이미 있으면 중복 생성되지 않고 `skipped`로 집계된다.