> 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-8.md).

# 캠페인 관리

## 캠페인 등록(발동)

> \## 기능설명\
> \* 캠페인을 등록하고 \*\*그 자리에서 발송을 요청합니다.\*\* 저장과 발송이 분리돼 있지 않습니다.\
> \---\
> \## 상세설명\
> \* 세그먼트의 최종 계산 결과를 발송 대상자로 적재하고, 발송 헤더를 발송대기(20)로 만듭니다.\
> \* 커밋되는 순간 batch-mbod 가 집어가 실제 발송을 수행합니다.\
> \* 사용 상태가 아니거나 대상자 계산이 없는 세그먼트, 대상자 0건이면 거부합니다.<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":{"CampaignSaveRequest":{"type":"object","description":"캠페인 등록 요청","properties":{"siteNo":{"type":"string","description":"사이트번호","minLength":1},"cmpgnNm":{"type":"string","description":"캠페인명","maxLength":100,"minLength":0},"cmpgnDesc":{"type":"string","description":"캠페인설명","maxLength":1000,"minLength":0},"sgmtNo":{"type":"string","description":"대상 세그먼트번호","minLength":1},"actTypCd":{"type":"string","description":"액션유형코드(ME025) 10 SMS / 20 이메일","minLength":1,"pattern":"10|20"},"msgTitle":{"type":"string","description":"메시지 제목 — 이메일 필수, SMS 미사용","maxLength":1000,"minLength":0},"msgConts":{"type":"string","description":"메시지 본문. SMS 는 4000자 상한(ST_MSG_SND_BASE.MSG_CONTS)","minLength":1},"msgTypCd":{"type":"string","description":"메시지유형코드(CM021) COMM 정보성 / AD 광고성 — SMS 필수"},"msgSndTypCd":{"type":"string","description":"메시지발송유형코드(CM020) SMS / LMS / MMS — SMS 필수"},"recvmnVetoNoCd":{"type":"string","description":"회신거부번호코드(ST019) — SMS 선택"},"emailTypCd":{"type":"string","description":"이메일유형코드 — 이메일 필수"},"emailTrgmnTypCd":{"type":"string","description":"이메일수신자유형코드 — 이메일 필수"}},"required":["actTypCd","cmpgnNm","msgConts","sgmtNo","siteNo"]},"CampaignSaveResponse":{"type":"object","description":"캠페인 등록(발동) 결과","properties":{"cmpgnNo":{"type":"string","description":"채번된 캠페인번호"},"sndNo":{"type":"string","description":"생성된 발송번호"},"trgtCnt":{"type":"integer","format":"int64","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/campaignMgmt/saveCampaign":{"post":{"tags":["캠페인 관리"],"summary":"캠페인 등록(발동)","description":"## 기능설명\n* 캠페인을 등록하고 **그 자리에서 발송을 요청합니다.** 저장과 발송이 분리돼 있지 않습니다.\n---\n## 상세설명\n* 세그먼트의 최종 계산 결과를 발송 대상자로 적재하고, 발송 헤더를 발송대기(20)로 만듭니다.\n* 커밋되는 순간 batch-mbod 가 집어가 실제 발송을 수행합니다.\n* 사용 상태가 아니거나 대상자 계산이 없는 세그먼트, 대상자 0건이면 거부합니다.\n","operationId":"saveCampaign","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignSaveRequest"}}},"required":true},"responses":{"200":{"description":"성공","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CampaignSaveResponse"}}}},"900":{"description":"업무처리 오류 내용","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}}}
```

## 캠페인 발송취소

> \## 기능설명\
> \* 캠페인의 발송을 취소합니다. 캠페인의 유일한 상태 변경입니다.\
> \---\
> \## 상세설명\
> \* 발송대기(20) 상태일 때만 가능합니다. 이미 발송중이거나 완료됐으면 거부합니다.\
> \* 액션유형에 따라 SMS · 이메일 발송 헤더를 서버가 골라 바꿉니다.<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":{"CampaignCancelRequest":{"type":"object","description":"캠페인 발송취소 요청","properties":{"cmpgnNo":{"type":"string","description":"캠페인번호","minLength":1}},"required":["cmpgnNo"]},"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/campaignMgmt/cancelCampaign":{"post":{"tags":["캠페인 관리"],"summary":"캠페인 발송취소","description":"## 기능설명\n* 캠페인의 발송을 취소합니다. 캠페인의 유일한 상태 변경입니다.\n---\n## 상세설명\n* 발송대기(20) 상태일 때만 가능합니다. 이미 발송중이거나 완료됐으면 거부합니다.\n* 액션유형에 따라 SMS · 이메일 발송 헤더를 서버가 골라 바꿉니다.\n","operationId":"cancelCampaign","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCancelRequest"}}},"required":true},"responses":{"200":{"description":"성공"},"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":{"CampaignDetailResponse":{"type":"object","description":"캠페인 상세","properties":{"cmpgnNo":{"type":"string","description":"캠페인번호"},"cmpgnNm":{"type":"string","description":"캠페인명"},"cmpgnDesc":{"type":"string","description":"캠페인설명"},"sgmtNo":{"type":"string","description":"세그먼트번호"},"sgmtNm":{"type":"string","description":"세그먼트명 — LEFT JOIN 결과"},"calcNo":{"type":"string","description":"발동에 사용한 계산번호"},"actTypCd":{"type":"string","description":"액션유형코드(ME025)"},"sndNo":{"type":"string","description":"발송번호"},"trgtCnt":{"type":"integer","format":"int64","description":"대상자수 — 발동 시점 스냅샷"},"sndStatCd":{"type":"string","description":"발송상태코드(CM018) — 이 값이 곧 캠페인 상태다"},"sndStrDtm":{"type":"string","format":"date-time","description":"발송 시작일시"},"sndEndDtm":{"type":"string","format":"date-time","description":"발송 종료일시"},"msgTitle":{"type":"string","description":"메시지 제목"},"msgConts":{"type":"string","description":"메시지 본문"},"sndSuccCnt":{"type":"integer","format":"int64","description":"발송 성공 건수 — 수신동의로 걸러진 만큼 대상자수보다 작다"},"sndImpsCnt":{"type":"integer","format":"int64","description":"미발송 건수 — 수신거부·연락처없음 등으로 배치가 제외한 건"},"sndWaitCnt":{"type":"integer","format":"int64","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/campaignMgmt/getCampaign":{"get":{"tags":["캠페인 관리"],"summary":"캠페인 상세 조회","description":"## 기능설명\n* 캠페인 상세와 발송현황(성공 · 미발송 · 대기)을 조회합니다.\n---\n## 상세설명\n* 발송 성공 건수는 대상자수보다 작을 수 있습니다. 배치가 수신동의로 걸러내기 때문입니다.\n* 미발송은 수신거부 · 연락처없음 등으로 배치가 제외한 건입니다.\n","operationId":"getCampaign","parameters":[{"name":"cmpgnNo","in":"query","description":"캠페인번호","required":true,"schema":{"type":"String"}}],"responses":{"200":{"description":"성공","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CampaignDetailResponse"}}}},"900":{"description":"업무처리 오류 내용","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}}}
```

## 캠페인 목록 조회

> \## 기능설명\
> \* 캠페인 목록을 조회합니다. 각 행에 세그먼트명과 발송상태가 함께 나옵니다.\
> \---\
> \## 상세설명\
> \* 발송상태(CM018)가 곧 캠페인 상태입니다. 캠페인에는 별도 상태 컬럼이 없습니다.\
> \* 대상자수는 발동 시점 스냅샷입니다. 세그먼트를 재계산해도 변하지 않습니다.<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":{"RealGridListResponseCampaignListResponse":{"type":"object","properties":{"totalCount":{"type":"integer","format":"int32"},"payloads":{"type":"array","items":{"$ref":"#/components/schemas/CampaignListResponse"}}}},"CampaignListResponse":{"type":"object","description":"캠페인 목록 행","properties":{"cmpgnNo":{"type":"string","description":"캠페인번호"},"cmpgnNm":{"type":"string","description":"캠페인명"},"sgmtNo":{"type":"string","description":"세그먼트번호"},"sgmtNm":{"type":"string","description":"세그먼트명 — LEFT JOIN 결과. 세그먼트가 삭제돼도 캠페인은 목록에 남는다"},"actTypCd":{"type":"string","description":"액션유형코드(ME025)"},"trgtCnt":{"type":"integer","format":"int64","description":"대상자수 — 발동 시점 스냅샷. 발송 성공 건수와 다른 값이다"},"sndStatCd":{"type":"string","description":"발송상태코드(CM018) — 이 값이 곧 캠페인 상태다. 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/campaignMgmt/getCampaignList":{"get":{"tags":["캠페인 관리"],"summary":"캠페인 목록 조회","description":"## 기능설명\n* 캠페인 목록을 조회합니다. 각 행에 세그먼트명과 발송상태가 함께 나옵니다.\n---\n## 상세설명\n* 발송상태(CM018)가 곧 캠페인 상태입니다. 캠페인에는 별도 상태 컬럼이 없습니다.\n* 대상자수는 발동 시점 스냅샷입니다. 세그먼트를 재계산해도 변하지 않습니다.\n","operationId":"getCampaignList","parameters":[{"name":"searchCondition","in":"query","description":"조회조건 — cmpgnNm 캠페인명 / cmpgnNo 캠페인번호","required":false,"schema":{"type":"string","description":"조회조건 — cmpgnNm 캠페인명 / cmpgnNo 캠페인번호"}},{"name":"searchConditionContents","in":"query","description":"조회조건 내용. 비어 있으면 조건 자체가 빠진다","required":false,"schema":{"type":"string","description":"조회조건 내용. 비어 있으면 조건 자체가 빠진다"}},{"name":"actTypCd","in":"query","description":"액션유형코드(ME025) 10 SMS / 20 이메일","required":false,"schema":{"type":"string","description":"액션유형코드(ME025) 10 SMS / 20 이메일"}},{"name":"sndStatCd","in":"query","description":"발송상태코드(CM018). 발송 테이블 조인 결과로 거른다","required":false,"schema":{"type":"string","description":"발송상태코드(CM018). 발송 테이블 조인 결과로 거른다"}},{"name":"regDtmFr","in":"query","description":"등록일 시작(yyyy-MM-dd)","required":false,"schema":{"type":"string","description":"등록일 시작(yyyy-MM-dd)"}},{"name":"regDtmTo","in":"query","description":"등록일 종료(yyyy-MM-dd) — 해당일 24시까지 포함한다","required":false,"schema":{"type":"string","description":"등록일 종료(yyyy-MM-dd) — 해당일 24시까지 포함한다"}}],"responses":{"200":{"description":"성공","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RealGridListResponseCampaignListResponse"}}}},"900":{"description":"업무처리 오류 내용","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}}}
```
