{
  "openapi": "3.0.3",
  "info": {
    "title": "센드엠 문자 발송 API",
    "version": "3.1",
    "description": "센드엠(sendm.co.kr) 공개 API 중 문자(SMS·LMS)·포토문자(MMS) 발송, 발송 결과 조회, 잔여 건수, 발신번호 목록. 서버에서만 호출하세요(브라우저 호출 금지). HTTP 상태는 항상 200이며 성공 여부는 본문 code(\"0\" = 성공)로 판단합니다. 응답 code 표: https://sendm.co.kr/guide/api-integration#lp-h2-codes 응답 대기 30초 권장, 시간초과 시 sendList 로 접수 여부 확인 후 재전송, 결과 조회는 1분 이상 간격.",
    "contact": {
      "name": "센드엠 고객센터",
      "url": "https://sendm.co.kr/board/question"
    }
  },
  "servers": [
    {
      "url": "https://api.sendm.co.kr"
    }
  ],
  "security": [
    {
      "userId": [],
      "apiKey": []
    }
  ],
  "components": {
    "securitySchemes": {
      "userId": {
        "type": "apiKey",
        "in": "header",
        "name": "user-id",
        "description": "sendm.co.kr 회원 아이디"
      },
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "api-key",
        "description": "API 신청 후 발급받은 인증키. 계정에 등록한 발송 IP에서만 사용할 수 있습니다."
      }
    },
    "schemas": {
      "SendResult": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "\"0\" 이면 접수 성공",
            "example": "0"
          },
          "message": {
            "type": "string",
            "example": "success"
          },
          "data": {
            "type": "object",
            "properties": {
              "msgId": {
                "type": "integer",
                "description": "메시지 ID. 실패 시 0",
                "example": 1
              }
            }
          }
        }
      },
      "SmsSendRequest": {
        "type": "object",
        "required": [
          "callerNo",
          "message",
          "receiveNos"
        ],
        "properties": {
          "callerNo": {
            "type": "string",
            "description": "등록·승인된 발신번호",
            "example": "02-0000-0000"
          },
          "message": {
            "type": "string",
            "description": "문자 내용"
          },
          "receiveNos": {
            "type": "string",
            "description": "수신번호. 여러 건은 # 로 구분",
            "example": "010-0000-0001#010-0000-0002"
          },
          "smsType": {
            "type": "string",
            "enum": [
              "SMS",
              "LMS"
            ],
            "default": "SMS"
          },
          "title": {
            "type": "string",
            "description": "제목(LMS)"
          },
          "adYn": {
            "type": "string",
            "enum": [
              "N",
              "Y",
              "E"
            ],
            "default": "N",
            "description": "N 일반 / Y 광고 / E 선거. API는 본문을 그대로 발송하므로 광고문자의 (광고) 표기와 무료 수신거부번호는 message 에 직접 넣어야 합니다. 광고는 21시~08시 발송 불가(code 101)"
          },
          "reserveYn": {
            "type": "string",
            "enum": [
              "N",
              "Y"
            ],
            "default": "N"
          },
          "sendDate": {
            "type": "string",
            "description": "예약 시각 YYYYMMDDHHMM (현재보다 뒤)",
            "example": "YYYYMMDDHHMM"
          },
          "messageCd": {
            "type": "string",
            "description": "문자 템플릿 코드"
          },
          "kind": {
            "type": "string",
            "enum": [
              "I",
              "L"
            ],
            "description": "국제문자일 때만"
          },
          "country": {
            "type": "string",
            "description": "국제문자 국가코드. 현재 86(중국)만 지원하며 그 외 값은 code 102"
          }
        }
      }
    }
  },
  "paths": {
    "/v1/sms/send": {
      "post": {
        "summary": "문자 발송 (SMS·LMS)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SmsSendRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "접수 결과(code 로 성공 판단)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResult"
                }
              }
            }
          }
        }
      }
    },
    "/v1/mms/send": {
      "post": {
        "summary": "포토문자 발송 (MMS)",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "callerNo",
                  "receiveNos"
                ],
                "properties": {
                  "callerNo": {
                    "type": "string"
                  },
                  "receiveNos": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string",
                    "description": "포토문자는 생략 가능"
                  },
                  "smsType": {
                    "type": "string",
                    "default": "MMS"
                  },
                  "title": {
                    "type": "string"
                  },
                  "adYn": {
                    "type": "string",
                    "enum": [
                      "N",
                      "Y",
                      "E"
                    ]
                  },
                  "reserveYn": {
                    "type": "string",
                    "enum": [
                      "N",
                      "Y"
                    ]
                  },
                  "sendDate": {
                    "type": "string"
                  },
                  "attachFile01": {
                    "type": "string",
                    "format": "binary"
                  },
                  "attachFile02": {
                    "type": "string",
                    "format": "binary"
                  },
                  "attachFile03": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "접수 결과",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResult"
                }
              }
            }
          }
        },
        "description": "이미지는 최대 3장, JPG·JPEG·PNG. 1,500×1,440px를 넘으면 서버가 줄여 JPG로 변환하며, 변환 후 합계 1MB를 넘으면 거부합니다(code 801 여러 장, 802 한 장). 장당 300KB 이하 권장."
      }
    },
    "/v1/sms/sendList": {
      "get": {
        "summary": "문자 발송 목록",
        "parameters": [
          {
            "name": "pageIndex",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "pageUnit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 10
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 10
            }
          },
          {
            "name": "caller",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "발신번호로 거르기. 하이픈 없이 숫자만, 정확히 일치"
          }
        ],
        "responses": {
          "200": {
            "description": "code, message, totalCount, list[](msgId, callerNo, smsType, adYn, reserveYn, sendDate, title, message, totalCnt, successCnt, failCnt, waitCnt)"
          }
        }
      }
    },
    "/v1/sms/sendList/{msgId}": {
      "get": {
        "summary": "문자 발송 상세(수신자별 결과)",
        "parameters": [
          {
            "name": "msgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "data(totalCnt, successCnt, failCnt, waitCnt), list[](receiveNo, resultCd, resultCdNm). 결과 대기는 최대 48시간"
          }
        }
      }
    },
    "/v2/info/coinInfo": {
      "get": {
        "summary": "잔여 코인·발송 가능 건수",
        "responses": {
          "200": {
            "description": "data(smsCnt, lmsCnt, mmsCnt, atCnt, totalCoin)"
          }
        }
      }
    },
    "/v1/caller/callerNoList": {
      "get": {
        "summary": "발신번호 목록",
        "parameters": [
          {
            "name": "callerNo",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 12
            },
            "description": "발신번호 검색(부분 일치). 숫자 외 문자는 빼고 비교하며 숫자만 12자리 이하(초과 시 code 107)."
          },
          {
            "name": "callerNm",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 50
            },
            "description": "발신번호 이름 검색(부분 일치). 50자 초과 시 code 108."
          },
          {
            "name": "repYn",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "Y",
                "N"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "code, message, totalCount, list[](callerNo, callerNm, repYn)"
          }
        }
      }
    }
  }
}
