속성 일괄 생성
POST/crm-core/v1/properties/bulk
한 번의 요청으로 여러 개의 속성을 일괄 생성한다. 각 속성은 개체(entityId) 단위로 저장되며 서로 다른 개체에 속한 속성을 섞어서 전달할 수도 있다. 배치 내부의 속성 name/key 중복, 기존 DB의 name 중복, 개체별 요금제 속성 한도(properties.maxPerEntity)가 모두 검증된다. 권한: OWNER 전용.
Body Params
| Name | Type | Required | Description |
|---|---|---|---|
| properties | Array | 생성할 속성 목록 (최소 1개, 최대 500개) | |
| properties[].entityId | string | 속성이 속할 개체 ID | |
| properties[].name | string | 속성 이름 (동일 개체 내에서 고유) | |
| properties[].fieldType | string | 속성 필드 유형 (TEXT, NUMBER, DATE, DROPDOWN 등) | |
| properties[].description | string | 속성 설명 | |
| properties[].propertyGroupId | string | 속성이 속할 속성 그룹 ID | |
| properties[].key | string | 속성 키 (영문 시작, 영문·숫자·언더스코어만, 최대 63자) | |
| properties[].isMasked | boolean | 개인정보 마스킹 여부 (기본 false) | |
| properties[].options | Array | DROPDOWN/RADIO/MULTI_CHECKBOX 유형에서 사용할 선택 옵션 목록 | |
| properties[].options[].label | string | 옵션 표시 레이블 | |
| properties[].options[].value | string | 옵션 저장 값 | |
| properties[].options[].priority | number | 옵션 정렬 우선순위 |
Response
| Name | Type | Required | Description |
|---|---|---|---|
| [] | Array | 생성된 속성 객체 배열 | |
| [].propertyId | string | 생성된 속성 ID | |
| [].entityId | string | 속성이 속한 개체 ID | |
| [].name | string | 속성 이름 | |
| [].fieldType | string | 속성 필드 유형 | |
| [].key | string | 속성 키 (지정한 경우) | |
| [].propertyGroupId | string | 속성 그룹 ID (지정한 경우) | |
| [].dateCreated | date | * | 생성 시각 |
Structure
코드 예제
const response = await fetch('https://api.solapi.com/crm-core/v1/properties/bulk', {
method: 'POST',
headers: { 'Authorization': 'Bearer ' + TOKEN, 'Content-Type': 'application/json' },
body: JSON.stringify({
properties: [
{ entityId: 'CRMET1260423081530123XYZ11122233', name: '계약 금액', fieldType: 'NUMBER', key: 'contract_amount' },
{ entityId: 'CRMET1260423081530123XYZ11122233', name: '담당자', fieldType: 'TEXT' }
]
})
});
const created = await response.json();
import requests
response = requests.post(
'https://api.solapi.com/crm-core/v1/properties/bulk',
headers={'Authorization': f'Bearer {TOKEN}'},
json={
'properties': [
{'entityId': 'CRMET1260423081530123XYZ11122233', 'name': '계약 금액', 'fieldType': 'NUMBER', 'key': 'contract_amount'},
{'entityId': 'CRMET1260423081530123XYZ11122233', 'name': '담당자', 'fieldType': 'TEXT'}
]
}
)
created = response.json()
curl -X POST 'https://api.solapi.com/crm-core/v1/properties/bulk' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"properties":[{"entityId":"CRMET1260423081530123XYZ11122233","name":"계약 금액","fieldType":"NUMBER","key":"contract_amount"}]}'
배치 내에서 동일한 개체·동일한 `name` 또는 동일한 개체·동일한 `key`를 가진 속성이 포함되어 있거나, 기존 DB에 동일 이름의 속성이 이미 존재하면 409 Conflict가 반환된다. 실패 시 어떤 속성도 생성되지 않는다(트랜잭션성 All-or-Nothing).
개체별 요금제 한도(`properties.maxPerEntity`)를 초과하면 403 Forbidden이 반환된다. 요청 실패 시 이미 증가된 사용량 카운터는 자동으로 롤백되므로 재시도해도 한도가 소진되지 않는다.