인증·오류·규약

인증

모든 /api/v1/* 은 Authorization: Bearer sd_live_… 헤더로 인증해요. API 키는 워크스페이스 단위이고 관리자 권한으로 동작해요. 웹 화면은 같은 API를 세션 쿠키로 써요.

curl https://send.ad/api/v1/me -H "Authorization: Bearer $SEND_API_KEY"

오류

실패는 { "error": "사람이 읽는 문구", "code": "machine_code" } 예요. 자주 보는 코드:

codeHTTP뜻
bad_api_key401키가 없거나 폐기됨
admin_only403관리자만 가능한 행위(발송·설정·결제)
insufficient_balance402잔액 부족 — /api/v1/billing/topup
sender_profile_incomplete400회사명·주소·연락처가 비어 있음
night_consent_required40021~08시 예약인데 야간 동의 미체크
rate_limited429너무 잦은 요청

규약

ID는 uuid, 시간은 ISO 8601, 돈은 원 정수, 이메일은 소문자로 저장돼요. 목록은 ?page=&limit=(기본 50 · 최대 500) 로 { items, total, page, limit } 를 돌려줘요.