사주 등록
POST /api/saju
요청
Headers
Authorization: Bearer {accessToken}
Content-Type: application/json
Request Body
| 필드 | 타입 | 필수 | 설명 |
|---|---|---|---|
birthDate | string (YYYY-MM-DD) | Y | 생년월일 (과거 날짜만 허용) |
birthTime | string (HH:mm) | N | 출생 시간. 모르면 null |
gender | string | Y | MALE | FEMALE |
calendarType | string | Y | SOLAR (양력) | LUNAR (음력) |
city | string | N | 출생 도시. 미입력 시 서울 기본값 |
{
"birthDate": "1995-03-15",
"birthTime": "14:30",
"gender": "MALE",
"calendarType": "SOLAR",
"city": "서울"
}
응답
성공 201 Created
사주 원국 + 오늘의 기운이 통합 응답됩니다.
{
"status": 201,
"message": "created",
"data": {
"saju": {
"sajuId": 2001,
"traits": {
"summaryZodiac": "돼지띠",
"summaryStrength": "신강",
"geokguk": "식신격",
"summaryPillars": "갑자 을축 병인 정묘"
},
"pillars": [
{ "type": "년주", "stem": "갑", "branch": "자", "twelveGrowth": "건록" },
{ "type": "월주", "stem": "을", "branch": "축", "twelveGrowth": "관대" },
{ "type": "일주", "stem": "병", "branch": "인", "twelveGrowth": "장생" },
{ "type": "시주", "stem": "정", "branch": "묘", "twelveGrowth": "목욕" }
],
"fiveElements": {
"elements": { "목": 30.0, "화": 20.0, "토": 15.0, "금": 20.0, "수": 15.0 },
"yongshinPrimary": "화",
"yongshinSecondary": null
}
},
"daily": {
"targetDate": "2026-06-08",
"todayScore": 72,
"goodTime": "오후 2~4시",
"mood": "차분한 집중",
"dailyMessage": "오늘은 성실하게 임하면 좋은 결과가 있습니다.",
"goodActions": ["기록", "정리", "독서"],
"avoidActions": ["충동적 결정", "과도한 운동"],
"avoidFlows": ["과한 일정", "감정적 대화"],
"recommendPlaces": ["갤러리", "숲 카페"],
"weakElement": "화",
"fiveElements": { "목": 30.0, "화": 20.0, "토": 15.0, "금": 20.0, "수": 15.0 }
}
}
}
에러
| 상황 | HTTP | errorCode |
|---|---|---|
| 이미 사주가 등록된 사용자 | 409 | SAJU_ALREADY_EXISTS |
| 유효하지 않은 생년월일 | 400 | INVALID_BIRTH_DATE |
| Ablecity API 장애 | 502 | EXTERNAL_API_ERROR |
| GPT 분석 오류 | 500 | LLM_ERROR |
{
"status": 409,
"errorCode": "SAJU_ALREADY_EXISTS",
"message": "이미 사주가 등록된 사용자입니다."
}