> For the complete documentation index, see [llms.txt](https://tech.x2bee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tech.x2bee.com/api/back-office-api/marketing-bo-api/undefined-4.md). Agents can also search and read this documentation through its [MCP server](https://tech.x2bee.com/~gitbook/mcp).

# 세그먼트 관리

## 세그먼트 저장

> \## 기능설명\
> \* 세그먼트를 등록 · 수정하거나 상태를 바꿉니다. \`sgmtNo\` 가 비어 있으면 신규입니다.\
> \---\
> \## 상세설명\
> \* \`siteNo\` 는 화면이 입력한 값입니다 — 로그인 사이트에서 자동으로 뽑지 않습니다.\
> \* \*\*멱등합니다.\*\* 현재 값과 비교해 차이가 있을 때만 쓰므로 같은 요청을 다시 보내도 결과가 같습니다.\
> \* 현재 상태 = 요청 상태 → 내용 저장\
> &#x20; \* 신규 → 임시저장(\`10\`)만 가능\
> &#x20; \* 임시저장 → 모든 항목 저장. 조건(사이트 · 포함 · 제외)이 바뀌면 최근 계산을 비움\
> &#x20; \* 사용 → 세그먼트명 · 담당부서 · 설명만 저장. 사이트 · 조건이 다르면 거부\
> &#x20; \* 종료 → 아무것도 하지 않음\
> \* 현재 상태 ≠ 요청 상태 → \*\*상태만\*\* 변경, 요청의 다른 값은 무시\
> &#x20; \* 임시저장 → 사용: 최신 스냅샷일로 완료된 계산이 있어야 함\
> &#x20; \* 임시저장 · 사용 → 종료: 대상자 명단 삭제\
> &#x20; \* 그 외 전환은 거부\
> \* 응답: \`sgmtNo\` · 저장 후 \`sgmtStatCd\`<br>

```json
{"openapi":"3.1.0","info":{"title":"X2BEE BO API","version":"v1"},"servers":[{"url":"https://api-bo.x2bee.com/api/bo/","description":"prd"}],"security":[{"accessToken":[]}],"components":{"securitySchemes":{"accessToken":{"type":"http","name":"accessToken","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"SegmentSaveRequest":{"type":"object","description":"세그먼트 저장 요청","properties":{"siteNo":{"type":"string","description":"사이트번호 — 화면이 입력한 값. 세그먼트가 속할 사이트를 정한다","minLength":1},"sgmtNo":{"type":"string","description":"세그먼트번호 — 없거나 빈 문자열이면 신규"},"sgmtNm":{"type":"string","description":"세그먼트명","minLength":1},"sgmtDesc":{"type":"string","description":"세그먼트설명"},"deptCd":{"type":"string","description":"부서코드"},"sgmtStatCd":{"type":"string","description":"저장 목표 상태코드(MK023) 10 임시저장 / 20 사용 / 30 종료","minLength":1},"condJson":{"type":"string","description":"조건 JSON(화면이 보낸 원본 — 저장 전에 정규화한다)","minLength":1}},"required":["condJson","sgmtNm","sgmtStatCd","siteNo"]},"SegmentSaveResponse":{"type":"object","description":"세그먼트 저장 결과","properties":{"sgmtNo":{"type":"string","description":"세그먼트번호"},"sgmtStatCd":{"type":"string","description":"저장 후 세그먼트상태코드(MK023)"}}},"Response":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"result time"},"code":{"type":"string","description":"result code"},"message":{"type":"string","description":"result message"},"isProcess":{"type":"boolean","description":"process check"},"payload":{"description":"payload"},"error":{"type":"boolean","description":"is error"},"errors":{"type":"array","description":"validation error list","items":{"$ref":"#/components/schemas/ValidationError"}}}},"ValidationError":{"type":"object","properties":{"field":{"type":"string","description":"field"},"message":{"type":"string","description":"field message"}}}}},"paths":{"/v1/marketing/segmentMgmt/saveSegment":{"post":{"tags":["세그먼트 관리"],"summary":"세그먼트 저장","description":"## 기능설명\n* 세그먼트를 등록 · 수정하거나 상태를 바꿉니다. `sgmtNo` 가 비어 있으면 신규입니다.\n---\n## 상세설명\n* `siteNo` 는 화면이 입력한 값입니다 — 로그인 사이트에서 자동으로 뽑지 않습니다.\n* **멱등합니다.** 현재 값과 비교해 차이가 있을 때만 쓰므로 같은 요청을 다시 보내도 결과가 같습니다.\n* 현재 상태 = 요청 상태 → 내용 저장\n  * 신규 → 임시저장(`10`)만 가능\n  * 임시저장 → 모든 항목 저장. 조건(사이트 · 포함 · 제외)이 바뀌면 최근 계산을 비움\n  * 사용 → 세그먼트명 · 담당부서 · 설명만 저장. 사이트 · 조건이 다르면 거부\n  * 종료 → 아무것도 하지 않음\n* 현재 상태 ≠ 요청 상태 → **상태만** 변경, 요청의 다른 값은 무시\n  * 임시저장 → 사용: 최신 스냅샷일로 완료된 계산이 있어야 함\n  * 임시저장 · 사용 → 종료: 대상자 명단 삭제\n  * 그 외 전환은 거부\n* 응답: `sgmtNo` · 저장 후 `sgmtStatCd`\n","operationId":"saveSegment","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentSaveRequest"}}},"required":true},"responses":{"200":{"description":"성공","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SegmentSaveResponse"}}}},"900":{"description":"업무처리 오류 내용","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}}}
```

## 세그먼트 조건 초안 생성

> \## 기능설명\
> \* 자연어 문장을 조건 빌더가 바로 쓸 수 있는 조건 카드 초안으로 변환합니다.\
> \---\
> \## 상세설명\
> \* AI 기능이 꺼져 있으면(가용성 false) 요청 자체를 오류로 거부합니다 — 화면이 이 경우\
> &#x20; 입력창 자체를 그리지 않아야 합니다.\
> \* 그 외 실패는 예외를 던지지 않고 \`reason\` 으로 알립니다 — 초안이 없어도 수동 등록을\
> &#x20; 계속할 수 있어야 합니다.<br>

```json
{"openapi":"3.1.0","info":{"title":"X2BEE BO API","version":"v1"},"servers":[{"url":"https://api-bo.x2bee.com/api/bo/","description":"prd"}],"security":[{"accessToken":[]}],"components":{"securitySchemes":{"accessToken":{"type":"http","name":"accessToken","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"SegmentDraftRequest":{"type":"object","description":"세그먼트 조건 초안 생성 요청","properties":{"text":{"type":"string","description":"사용자가 입력한 자연어 조건 문장","maxLength":500,"minLength":0}},"required":["text"]},"SegmentDraftResponse":{"type":"object","description":"세그먼트 조건 초안 생성 응답","properties":{"drafts":{"type":"array","description":"생성된 초안 카드 목록","items":{"$ref":"#/components/schemas/DraftItem"}},"unsupported":{"type":"array","description":"조건으로 표현하지 못했거나 검증·상한 초과로 버려진 사유 목록","items":{"type":"string"}},"reason":{"type":"string","description":"실패 사유. 성공이면 null","enum":["NO_CONDITION","ALL_UNSUPPORTED","IRRECOVERABLE","LLM_ERROR"]}}},"DraftItem":{"type":"object","description":"세그먼트 조건 초안 카드","properties":{"label":{"type":"string","description":"카드 표시 라벨"},"condJson":{"type":"string","description":"조립된 조건 JSON(원본 — 미확정 스코프도 치환하지 않는다)"},"resolutions":{"type":"array","description":"확정하지 못한 스코프 참조 목록","items":{"$ref":"#/components/schemas/ResolutionRef"}}}},"ResolutionRef":{"type":"object","properties":{"nodeId":{"type":"string"},"gb":{"type":"string"},"q":{"type":"string"},"status":{"type":"string"},"candidates":{"type":"array","items":{"$ref":"#/components/schemas/Item"}}}},"Item":{"type":"object","properties":{"id":{"type":"string"},"nm":{"type":"string"}}},"Response":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"result time"},"code":{"type":"string","description":"result code"},"message":{"type":"string","description":"result message"},"isProcess":{"type":"boolean","description":"process check"},"payload":{"description":"payload"},"error":{"type":"boolean","description":"is error"},"errors":{"type":"array","description":"validation error list","items":{"$ref":"#/components/schemas/ValidationError"}}}},"ValidationError":{"type":"object","properties":{"field":{"type":"string","description":"field"},"message":{"type":"string","description":"field message"}}}}},"paths":{"/v1/marketing/segmentMgmt/getSegmentCondDraft":{"post":{"tags":["세그먼트 관리"],"summary":"세그먼트 조건 초안 생성","description":"## 기능설명\n* 자연어 문장을 조건 빌더가 바로 쓸 수 있는 조건 카드 초안으로 변환합니다.\n---\n## 상세설명\n* AI 기능이 꺼져 있으면(가용성 false) 요청 자체를 오류로 거부합니다 — 화면이 이 경우\n  입력창 자체를 그리지 않아야 합니다.\n* 그 외 실패는 예외를 던지지 않고 `reason` 으로 알립니다 — 초안이 없어도 수동 등록을\n  계속할 수 있어야 합니다.\n","operationId":"getSegmentCondDraft","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentDraftRequest"}}},"required":true},"responses":{"200":{"description":"성공","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SegmentDraftResponse"}}}},"900":{"description":"업무처리 오류 내용","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}}}
```

## 세그먼트 조건 초안 생성 (스트리밍)

> \## 기능설명\
> \* 세그먼트 조건 초안 생성을 수행하며 진행 단계를 SSE 로 전달합니다.\
> \---\
> \## 이벤트\
> \* \`stage\` : \`{step, label, seq, total}\` — 진행 단계. 0회 이상 발생\
> \* \`result\` : 초안 결과(JSON 엔드포인트와 동일한 payload). 성공 종료\
> \* \`error\` : \`{code, message}\` — 실패 종료. AI 기능이 꺼져 있으면(가용성 false) 이 이벤트로 거부합니다.<br>

```json
{"openapi":"3.1.0","info":{"title":"X2BEE BO API","version":"v1"},"servers":[{"url":"https://api-bo.x2bee.com/api/bo/","description":"prd"}],"security":[{"accessToken":[]}],"components":{"securitySchemes":{"accessToken":{"type":"http","name":"accessToken","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"SegmentDraftRequest":{"type":"object","description":"세그먼트 조건 초안 생성 요청","properties":{"text":{"type":"string","description":"사용자가 입력한 자연어 조건 문장","maxLength":500,"minLength":0}},"required":["text"]},"SseEmitter":{"type":"object","properties":{"timeout":{"type":"integer","format":"int64"}}}}},"paths":{"/v1/marketing/segmentMgmt/getSegmentCondDraft/stream":{"post":{"tags":["세그먼트 관리"],"summary":"세그먼트 조건 초안 생성 (스트리밍)","description":"## 기능설명\n* 세그먼트 조건 초안 생성을 수행하며 진행 단계를 SSE 로 전달합니다.\n---\n## 이벤트\n* `stage` : `{step, label, seq, total}` — 진행 단계. 0회 이상 발생\n* `result` : 초안 결과(JSON 엔드포인트와 동일한 payload). 성공 종료\n* `error` : `{code, message}` — 실패 종료. AI 기능이 꺼져 있으면(가용성 false) 이 이벤트로 거부합니다.\n","operationId":"getSegmentCondDraftStream","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentDraftRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/SseEmitter"}}}}}}}}}
```

## 대상자 계산

> \## 기능설명\
> \* 현재 조건으로 대상자를 동기로 계산하고 결과를 적재합니다.\
> \---\
> \## 상세설명\
> \* \*\*응답까지 수십 초가 걸릴 수 있습니다.\
> \* \`calcGbCd\` 를 비우면 \`10\`(수동)입니다 — 자동 갱신 배치만 \`20\` 을 싣습니다.\
> \* \*\*멱등합니다.\*\* 같은 스냅샷일로 완료된 계산이 있으면 다시 계산하지 않고 그 결과를 돌려줍니다.\
> \* 종료된 세그먼트는 계산할 수 없습니다.<br>

```json
{"openapi":"3.1.0","info":{"title":"X2BEE BO API","version":"v1"},"servers":[{"url":"https://api-bo.x2bee.com/api/bo/","description":"prd"}],"security":[{"accessToken":[]}],"components":{"securitySchemes":{"accessToken":{"type":"http","name":"accessToken","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"SegmentCalcRequest":{"type":"object","description":"세그먼트 대상자 계산 요청","properties":{"sgmtNo":{"type":"string","description":"세그먼트번호","minLength":1},"calcGbCd":{"type":"string","description":"계산구분코드(MK024) 10 수동 / 20 배치. 비면 수동 — 화면은 싣지 않는다"}},"required":["sgmtNo"]},"SegmentCalcResponse":{"type":"object","description":"세그먼트 대상자 계산 결과","properties":{"calcNo":{"type":"string","description":"계산번호"},"trgtCnt":{"type":"integer","format":"int64","description":"대상자수 — 0 은 실패가 아니라 정상 완료다"},"newCnt":{"type":"integer","format":"int64","description":"신규진입수. null 이면 첫 계산"},"outCnt":{"type":"integer","format":"int64","description":"이탈수. null 이면 첫 계산"},"calcStrtDtm":{"type":"string","format":"date-time","description":"계산시작일시"},"sysModDtm":{"type":"string","format":"date-time","description":"갱신된 세그먼트 수정일시(표시용)"}}},"Response":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"result time"},"code":{"type":"string","description":"result code"},"message":{"type":"string","description":"result message"},"isProcess":{"type":"boolean","description":"process check"},"payload":{"description":"payload"},"error":{"type":"boolean","description":"is error"},"errors":{"type":"array","description":"validation error list","items":{"$ref":"#/components/schemas/ValidationError"}}}},"ValidationError":{"type":"object","properties":{"field":{"type":"string","description":"field"},"message":{"type":"string","description":"field message"}}}}},"paths":{"/v1/marketing/segmentMgmt/calcSegmentTarget":{"post":{"tags":["세그먼트 관리"],"summary":"대상자 계산","description":"## 기능설명\n* 현재 조건으로 대상자를 동기로 계산하고 결과를 적재합니다.\n---\n## 상세설명\n* **응답까지 수십 초가 걸릴 수 있습니다.\n* `calcGbCd` 를 비우면 `10`(수동)입니다 — 자동 갱신 배치만 `20` 을 싣습니다.\n* **멱등합니다.** 같은 스냅샷일로 완료된 계산이 있으면 다시 계산하지 않고 그 결과를 돌려줍니다.\n* 종료된 세그먼트는 계산할 수 없습니다.\n","operationId":"calcSegmentTarget","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentCalcRequest"}}},"required":true},"responses":{"200":{"description":"성공","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SegmentCalcResponse"}}}},"900":{"description":"업무처리 오류 내용","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}}}
```

## 세그먼트 상세 조회

> \## 기능설명\
> \* 세그먼트 정의, 조건(JSON), 계산상태 · 최근 실패일시를 함께 반환합니다.\
> \---\
> \## 상세설명\
> \* 없거나 삭제된 세그먼트면 오류입니다.<br>

```json
{"openapi":"3.1.0","info":{"title":"X2BEE BO API","version":"v1"},"servers":[{"url":"https://api-bo.x2bee.com/api/bo/","description":"prd"}],"security":[{"accessToken":[]}],"components":{"securitySchemes":{"accessToken":{"type":"http","name":"accessToken","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"SegmentDetailResponse":{"type":"object","description":"세그먼트 상세","properties":{"sgmtNo":{"type":"string","description":"세그먼트번호"},"siteNo":{"type":"string","description":"사이트번호"},"sgmtNm":{"type":"string","description":"세그먼트명"},"sgmtDesc":{"type":"string","description":"세그먼트설명"},"deptCd":{"type":"string","description":"부서코드"},"deptNm":{"type":"string","description":"부서명 — ST_DEPT_CD 조인 결과"},"sgmtStatCd":{"type":"string","description":"세그먼트상태코드(MK023)"},"condJson":{"type":"string","description":"조건 JSON(정규화된 값)"},"sysModDtm":{"type":"string","format":"date-time","description":"최종 수정일시(표시용)"},"lstCalcNo":{"type":"string","description":"최종 완료 계산번호. null 이면 계산한 적이 없다"},"lstTrgtCnt":{"type":"integer","format":"int64","description":"최종 완료 계산의 대상자수"},"lstCalcStrtDtm":{"type":"string","format":"date-time","description":"최종 완료 계산의 시작일시"},"lstNewCnt":{"type":"integer","format":"int64","description":"최종 완료 계산의 신규진입수. null 이면 첫 계산"},"lstOutCnt":{"type":"integer","format":"int64","description":"최종 완료 계산의 이탈수. null 이면 첫 계산"},"calcStatCd":{"type":"string","description":"계산상태 FAIL 실패 / NONE 미계산 / DONE 완료, 종료는 null"},"lstFailDtm":{"type":"string","format":"date-time","description":"가장 최근 계산 시도가 실패면 그 시작일시, 아니면 null"}}},"Response":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"result time"},"code":{"type":"string","description":"result code"},"message":{"type":"string","description":"result message"},"isProcess":{"type":"boolean","description":"process check"},"payload":{"description":"payload"},"error":{"type":"boolean","description":"is error"},"errors":{"type":"array","description":"validation error list","items":{"$ref":"#/components/schemas/ValidationError"}}}},"ValidationError":{"type":"object","properties":{"field":{"type":"string","description":"field"},"message":{"type":"string","description":"field message"}}}}},"paths":{"/v1/marketing/segmentMgmt/getSegment":{"get":{"tags":["세그먼트 관리"],"summary":"세그먼트 상세 조회","description":"## 기능설명\n* 세그먼트 정의, 조건(JSON), 계산상태 · 최근 실패일시를 함께 반환합니다.\n---\n## 상세설명\n* 없거나 삭제된 세그먼트면 오류입니다.\n","operationId":"getSegment","parameters":[{"name":"sgmtNo","in":"query","description":"세그먼트번호","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"성공","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SegmentDetailResponse"}}}},"900":{"description":"업무처리 오류 내용","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}}}
```

## 세그먼트 사용처 조회

> \## 기능설명\
> \* 세그먼트를 쓰는 곳(지금은 캠페인)을 최근 등록순으로 반환합니다.<br>

```json
{"openapi":"3.1.0","info":{"title":"X2BEE BO API","version":"v1"},"servers":[{"url":"https://api-bo.x2bee.com/api/bo/","description":"prd"}],"security":[{"accessToken":[]}],"components":{"securitySchemes":{"accessToken":{"type":"http","name":"accessToken","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"SegmentUsageResponse":{"type":"object","description":"세그먼트 사용처","properties":{"usageTypCd":{"type":"string","description":"사용처 유형 — 지금은 CMPGN(캠페인) 고정"},"usageNo":{"type":"string","description":"사용처 번호(캠페인번호)"},"usageNm":{"type":"string","description":"사용처 명(캠페인명)"},"aplyDtm":{"type":"string","format":"date-time","description":"적용일시(캠페인 등록일시)"},"calcNo":{"type":"string","description":"계산번호"},"calcStrtDtm":{"type":"string","format":"date-time","description":"계산시작일시"}}},"Response":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"result time"},"code":{"type":"string","description":"result code"},"message":{"type":"string","description":"result message"},"isProcess":{"type":"boolean","description":"process check"},"payload":{"description":"payload"},"error":{"type":"boolean","description":"is error"},"errors":{"type":"array","description":"validation error list","items":{"$ref":"#/components/schemas/ValidationError"}}}},"ValidationError":{"type":"object","properties":{"field":{"type":"string","description":"field"},"message":{"type":"string","description":"field message"}}}}},"paths":{"/v1/marketing/segmentMgmt/getSegmentUsageList":{"get":{"tags":["세그먼트 관리"],"summary":"세그먼트 사용처 조회","description":"## 기능설명\n* 세그먼트를 쓰는 곳(지금은 캠페인)을 최근 등록순으로 반환합니다.\n","operationId":"getSegmentUsageList","parameters":[{"name":"sgmtNo","in":"query","description":"세그먼트번호","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"성공","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SegmentUsageResponse"}}}}},"900":{"description":"업무처리 오류 내용","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}}}
```

## 대상자 표본 조회

> \## 기능설명\
> \* 계산 결과의 대상자를 페이징 조회합니다. 계산 응답으로 받은 \`calcNo\` 로 조회합니다.\
> \---\
> \## 상세설명\
> \* 조건 매칭 근거는 저장하지 않으므로 응답에 없습니다.\
> \* \*\*회원명은 반환하지 않습니다\*\* — 개인정보 마스킹 · 감사 대상입니다.<br>

```json
{"openapi":"3.1.0","info":{"title":"X2BEE BO API","version":"v1"},"servers":[{"url":"https://api-bo.x2bee.com/api/bo/","description":"prd"}],"security":[{"accessToken":[]}],"components":{"securitySchemes":{"accessToken":{"type":"http","name":"accessToken","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"RealGridListResponseSegmentTargetResponse":{"type":"object","properties":{"totalCount":{"type":"integer","format":"int32"},"payloads":{"type":"array","items":{"$ref":"#/components/schemas/SegmentTargetResponse"}}}},"SegmentTargetResponse":{"type":"object","description":"세그먼트 대상자 표본 행","properties":{"mbrNo":{"type":"string","description":"회원번호"}}}}},"paths":{"/v1/marketing/segmentMgmt/getSegmentTargetList":{"get":{"tags":["세그먼트 관리"],"summary":"대상자 표본 조회","description":"## 기능설명\n* 계산 결과의 대상자를 페이징 조회합니다. 계산 응답으로 받은 `calcNo` 로 조회합니다.\n---\n## 상세설명\n* 조건 매칭 근거는 저장하지 않으므로 응답에 없습니다.\n* **회원명은 반환하지 않습니다** — 개인정보 마스킹 · 감사 대상입니다.\n","operationId":"getSegmentTargetList","parameters":[{"name":"calcNo","in":"query","description":"계산번호","required":true,"schema":{"type":"string","description":"계산번호"}}],"responses":{"200":{"description":"성공","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RealGridListResponseSegmentTargetResponse"}}}}}}}}}
```

## 세그먼트 목록 조회

> \## 기능설명\
> \* 세그먼트 목록을 조회합니다. 각 행에 최종 완료 계산의 대상자 수와 계산일시가 함께 나옵니다.\
> \---\
> \## 상세설명\
> \* 대상자 수는 마지막 계산 기준입니다. 계산이 실패하면 마지막 성공 결과가 그대로 유지됩니다.\
> \* 계산상태 \`calcStatCd\`: \`FAIL\` 계산 실패 · \`NONE\` 미계산 · \`DONE\` 계산 완료 · 종료는 null\
> \* \`cmpgnSelectYn=Y\`: 캠페인 선택용 — 사용 중이고 대상자 1명 이상인 세그먼트만(계산 실패 포함)<br>

```json
{"openapi":"3.1.0","info":{"title":"X2BEE BO API","version":"v1"},"servers":[{"url":"https://api-bo.x2bee.com/api/bo/","description":"prd"}],"security":[{"accessToken":[]}],"components":{"securitySchemes":{"accessToken":{"type":"http","name":"accessToken","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"RealGridListResponseSegmentListResponse":{"type":"object","properties":{"totalCount":{"type":"integer","format":"int32"},"payloads":{"type":"array","items":{"$ref":"#/components/schemas/SegmentListResponse"}}}},"SegmentListResponse":{"type":"object","description":"세그먼트 목록 행","properties":{"sgmtNo":{"type":"string","description":"세그먼트번호"},"sgmtNm":{"type":"string","description":"세그먼트명"},"sgmtStatCd":{"type":"string","description":"세그먼트상태코드(MK023)"},"deptCd":{"type":"string","description":"부서코드"},"deptNm":{"type":"string","description":"부서명 — ST_DEPT_CD 조인 결과"},"lstTrgtCnt":{"type":"integer","format":"int64","description":"최종 완료 계산의 대상자수. null 이면 계산 이력이 없다"},"lstCalcStrtDtm":{"type":"string","format":"date-time","description":"최종 완료 계산의 시작일시"},"calcStatCd":{"type":"string","description":"계산상태 FAIL 실패 / NONE 미계산 / DONE 완료, 종료는 null"}}},"Response":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"result time"},"code":{"type":"string","description":"result code"},"message":{"type":"string","description":"result message"},"isProcess":{"type":"boolean","description":"process check"},"payload":{"description":"payload"},"error":{"type":"boolean","description":"is error"},"errors":{"type":"array","description":"validation error list","items":{"$ref":"#/components/schemas/ValidationError"}}}},"ValidationError":{"type":"object","properties":{"field":{"type":"string","description":"field"},"message":{"type":"string","description":"field message"}}}}},"paths":{"/v1/marketing/segmentMgmt/getSegmentList":{"get":{"tags":["세그먼트 관리"],"summary":"세그먼트 목록 조회","description":"## 기능설명\n* 세그먼트 목록을 조회합니다. 각 행에 최종 완료 계산의 대상자 수와 계산일시가 함께 나옵니다.\n---\n## 상세설명\n* 대상자 수는 마지막 계산 기준입니다. 계산이 실패하면 마지막 성공 결과가 그대로 유지됩니다.\n* 계산상태 `calcStatCd`: `FAIL` 계산 실패 · `NONE` 미계산 · `DONE` 계산 완료 · 종료는 null\n* `cmpgnSelectYn=Y`: 캠페인 선택용 — 사용 중이고 대상자 1명 이상인 세그먼트만(계산 실패 포함)\n","operationId":"getSegmentList","parameters":[{"name":"sgmtStatCd","in":"query","description":"세그먼트상태코드(MK023)","required":false,"schema":{"type":"string","description":"세그먼트상태코드(MK023)"}},{"name":"deptCd","in":"query","description":"부서코드","required":false,"schema":{"type":"string","description":"부서코드"}},{"name":"sgmtNo","in":"query","description":"세그먼트번호 LIKE 검색어","required":false,"schema":{"type":"string","description":"세그먼트번호 LIKE 검색어"}},{"name":"sgmtNm","in":"query","description":"세그먼트명 LIKE 검색어","required":false,"schema":{"type":"string","description":"세그먼트명 LIKE 검색어"}},{"name":"calcStatCd","in":"query","description":"계산상태 FAIL 실패 / NONE 미계산 / DONE 완료","required":false,"schema":{"type":"string","description":"계산상태 FAIL 실패 / NONE 미계산 / DONE 완료"}},{"name":"cmpgnSelectYn","in":"query","description":"캠페인 선택용 여부 — Y 면 사용 중 · 대상자 1명 이상만","required":false,"schema":{"type":"string","description":"캠페인 선택용 여부 — Y 면 사용 중 · 대상자 1명 이상만"}}],"responses":{"200":{"description":"성공","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RealGridListResponseSegmentListResponse"}}}},"900":{"description":"업무처리 오류 내용","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}}}
```

## 조건 메타데이터 조회

> \## 기능설명\
> \* 조건 빌더가 쓸 변수 18종의 문법 계약과 \`CODE\_LIST\` 변수의 값 옵션을 반환합니다.\
> \---\
> \## 상세설명\
> \* 정의는 자바 레지스트리, 값 옵션(회원등급 · 결제수단)만 런타임에 공통코드를 조회합니다.<br>

```json
{"openapi":"3.1.0","info":{"title":"X2BEE BO API","version":"v1"},"servers":[{"url":"https://api-bo.x2bee.com/api/bo/","description":"prd"}],"security":[{"accessToken":[]}],"components":{"securitySchemes":{"accessToken":{"type":"http","name":"accessToken","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"SegmentCondMetaResponse":{"type":"object","description":"세그먼트 조건 메타데이터","properties":{"variables":{"type":"array","description":"조건 변수 목록(레지스트리 선언 순서)","items":{"$ref":"#/components/schemas/SegmentVariableMetaResponse"}}}},"SegmentVariableMetaResponse":{"type":"object","description":"세그먼트 조건 변수 메타","properties":{"varCd":{"type":"string","description":"변수 코드 — 화면은 이 값으로 자기 locale 파일에서 표시 문자열을 찾는다"},"maxPeriodDays":{"type":"integer","format":"int32","description":"조회 가능한 최대 기간(일). null 이면 상한 없음 — 화면이 기간 선택지를 이 값으로 자른다.원천 테이블의 보관 기간에서 온다(행동로그 1개월 / 주문 이력 무제한)"},"allowedOps":{"type":"array","description":"허용 연산자 목록(Operator enum 선언 순서). 화면 연산자 드롭다운을 이 순서 그대로 그리면 된다","items":{"type":"string","description":"허용 연산자","enum":["GTE","LTE","EQ","NEQ","BETWEEN","EXISTS","NOT_EXISTS"]}},"valType":{"type":"string","description":"값 타입","enum":["NONE","NUMBER","CODE_LIST","TEXT_LIST","REL_DATE","BIRTHDAY"]},"periodPolicy":{"type":"string","description":"조회 기간 정책. REQUIRED 면 조건에 period 를 반드시 실어야 한다","enum":["REQUIRED","NONE"]},"allowedScopes":{"type":"array","description":"허용 스코프 목록(ScopeGb enum 선언 순서). 비어 있으면 이 변수는 스코프를 받지 않는다","items":{"type":"string","description":"허용 스코프","enum":["ALL","GOODS","BRAND","CATEGORY","KEYWORD"]}},"codeGroup":{"type":"string","description":"참조 공통코드 그룹코드. null 이면 공통코드를 참조하지 않는다(DELI_LOC 포함)"},"codeOptions":{"type":"array","description":"값 옵션 — codeGroup 이 있는 변수만 채워진다. 그 외에는 항상 빈 배열이다","items":{"$ref":"#/components/schemas/CodeOption"}},"devLabel":{"type":"string","description":"개발자 확인 · 서버 로그 대조용 한국어 라벨. **화면은 쓰지 않는다** — 한국어 한 벌이라 en/zh 사용자에게 한국어가 뜬다. 화면 표시 문자열은 varCd 로 자기 locale 파일에서 찾는다"}}},"CodeOption":{"type":"object","description":"CODE_LIST 변수의 값 옵션","properties":{"cd":{"type":"string","description":"코드값"},"cdNm":{"type":"string","description":"코드명(요청 언어로 해석됨 — 화면이 그대로 쓴다)"}}}}},"paths":{"/v1/marketing/segmentMgmt/getSegmentCondMeta":{"get":{"tags":["세그먼트 관리"],"summary":"조건 메타데이터 조회","description":"## 기능설명\n* 조건 빌더가 쓸 변수 18종의 문법 계약과 `CODE_LIST` 변수의 값 옵션을 반환합니다.\n---\n## 상세설명\n* 정의는 자바 레지스트리, 값 옵션(회원등급 · 결제수단)만 런타임에 공통코드를 조회합니다.\n","operationId":"getSegmentCondMeta","responses":{"200":{"description":"성공","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SegmentCondMetaResponse"}}}}}}}}}
```
