세그먼트 삭제
/crm-core/v1/segments/{segmentId}세그먼트를 삭제합니다. 캐시된 멤버 정보(segment_members)는 함께 정리되며, 연결된 자동화는 더 이상 트리거되지 않습니다. MEMBER 이상 권한이 필요하며, 본인이 생성하지 않은 세그먼트는 OWNER 권한이 있어야 삭제할 수 있습니다.
Path Params
Response
Structure
코드 예제
const crypto = require('crypto');
const apiKey = 'NCSXXXXXXXXXXXXX';
const apiSecret = 'YOUR_API_SECRET';
const dateTime = new Date().toISOString();
const salt = crypto.randomBytes(16).toString('hex');
const signature = crypto.createHmac('sha256', apiSecret).update(dateTime + salt).digest('hex');
const authHeader = HMAC-SHA256 apiKey=${apiKey}, date=${dateTime}, salt=${salt}, signature=${signature};
const response = await fetch('https://api.solapi.com/crm-core/v1/segments/CRMSG1260423081530123SGM11122233', {
method: 'DELETE',
headers: { 'Authorization': authHeader, 'Content-Type': 'application/json' }
});
const data = await response.json();
import hmac, hashlib, secrets, requests
from datetime import datetime, timezone
api_key = 'NCSXXXXXXXXXXXXX'
api_secret = 'YOUR_API_SECRET'
date_time = datetime.now(timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')
salt = secrets.token_hex(16)
signature = hmac.new(api_secret.encode(), (date_time + salt).encode(), hashlib.sha256).hexdigest()
auth_header = f'HMAC-SHA256 apiKey={api_key}, date={date_time}, salt={salt}, signature={signature}'
response = requests.delete('https://api.solapi.com/crm-core/v1/segments/CRMSG1260423081530123SGM11122233', headers={
'Authorization': auth_header,
'Content-Type': 'application/json'
})
data = response.json()
API_KEY="NCSXXXXXXXXXXXXX"
API_SECRET="YOUR_API_SECRET"
DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
SALT=$(openssl rand -hex 16)
SIGNATURE=$(echo -n "${DATE}${SALT}" | openssl dgst -sha256 -hmac "${API_SECRET}" | awk '{print $NF}')
AUTH="HMAC-SHA256 apiKey=${API_KEY}, date=${DATE}, salt=${SALT}, signature=${SIGNATURE}"
curl -X DELETE 'https://api.solapi.com/crm-core/v1/segments/CRMSG1260423081530123SGM11122233' \
-H "Authorization: ${AUTH}" \
-H "Content-Type: application/json"
삭제 후에는 복구할 수 없습니다. 삭제 전에 세그먼트에 연결된 자동화가 있는지 확인하세요.
**401 응답**: `{ "errorCode": "Unauthorized", "errorMessage": "권한이 없습니다." }`