Glowb Dev Docs
Agency API

Agency Self-service API

에이전시 운영자의 내 정보, 브랜딩, 고객사, 크레딧 관리 API

Agency Self-service API

에이전시 운영자가 자기 에이전시와 소속 고객사를 관리하는 API입니다.

모든 API는 ROLE_AGENCY 권한이 필요합니다. 응답은 bare JSON입니다.

내 에이전시 정보 조회

GET /ai/agency/me
Authorization: Bearer {access_token}

성공 응답

{
  "agencyId": "agency-a",
  "name": "Agency A",
  "domain": "agency.example.com",
  "brand": {
    "logoUrl": "https://cdn.example.com/logo.png"
  },
  "locale": "ko"
}

브랜딩 수정

PATCH /ai/agency/me/branding
Authorization: Bearer {access_token}
Content-Type: application/json

Request Body

{
  "logoUrl": "https://cdn.example.com/logo.png"
}

성공 응답

{
  "logoUrl": "https://cdn.example.com/logo.png"
}

로고 업로드

POST /ai/agency/branding/logo
Authorization: Bearer {access_token}
Content-Type: multipart/form-data

Form Data

필드타입필수설명
fileFile업로드할 로고 파일

성공 응답

{
  "logoUrl": "https://cdn.example.com/logo.png"
}

고객사 목록 조회

GET /ai/agency/me/clients
Authorization: Bearer {access_token}

성공 응답

[
  {
    "id": "client@example.com",
    "name": "고객사 A",
    "email": "client@example.com",
    "status": "active",
    "creditBalance": 100000,
    "createdAt": "2026-07-08T10:30:00",
    "notifyAdvertiser": true,
    "notifyAgency": false
  }
]
필드타입설명
notifyAdvertiserBoolean고객사(광고주)가 광고주 알림 이메일을 수신할지. 기본 true
notifyAgencyBoolean에이전시가 이 고객사 캠페인 알림 사본(CC)을 수신할지. 기본 false
알림 토글 값(notifyAdvertiser/notifyAgency)이 이 응답에 포함됩니다. 프론트 토글 UI의 현재 상태 표시에 사용하세요. null이면 컬럼 미설정(기본값으로 동작).

고객사 생성

POST /ai/agency/me/clients
Authorization: Bearer {access_token}
Content-Type: application/json

Request Body

{
  "name": "고객사 A",
  "email": "client@example.com",
  "password": "password123"
}
필드타입필수설명
nameString고객사명
emailString고객사 이메일. 로그인 ID로 사용
passwordString아니오초기 비밀번호. 생략 시 서버가 임의 비밀번호를 생성

성공 응답

{
  "id": "client@example.com",
  "name": "고객사 A",
  "email": "client@example.com",
  "status": "active",
  "creditBalance": 0,
  "createdAt": "2026-07-08T10:30:00"
}

고객사 수정

PATCH /ai/agency/me/clients/{id}
Authorization: Bearer {access_token}
Content-Type: application/json

Path Parameters

파라미터타입필수설명
idString고객사 로그인 ID

Request Body

전달한 필드만 변경되며, 생략하거나 null이면 기존 값을 유지합니다. 알림 토글만 바꿀 때는 notifyAdvertiser/notifyAgency만 담아 보내면 됩니다.

{
  "notifyAdvertiser": false,
  "notifyAgency": true
}
필드타입필수설명
nameString아니오고객사명
emailString아니오고객사 이메일
statusString아니오active 또는 inactive
notifyAdvertiserBoolean아니오광고주 수신 on/off. 기본 true
notifyAgencyBoolean아니오에이전시 합류 수신 on/off. 기본 false

알림 라우팅 동작

notifyAdvertiser/notifyAgency는 이 고객사(AGENCY_CLIENT) 캠페인의 알림 발송 대상을 정합니다. 일반 광고주에게는 영향이 없습니다. notifyAgency=true이면 에이전시의 기본 담당자에게 글로우비 브랜드로 사본(CC)이 발송됩니다.

notifyAdvertisernotifyAgency결과
truefalse광고주만 수신 (기본)
truetrue광고주 + 에이전시 둘 다 수신
falsetrue에이전시만 수신 (광고주 차단)
falsefalse아무도 수신 안 함

성공 응답

{
  "id": "client@example.com",
  "name": "고객사 A",
  "email": "client@example.com",
  "status": "active",
  "creditBalance": 0,
  "createdAt": "2026-07-08T10:30:00",
  "notifyAdvertiser": false,
  "notifyAgency": true
}

고객사 크레딧 지급

POST /ai/agency/me/clients/{id}/credit
Authorization: Bearer {access_token}
Content-Type: application/json

Request Body

{
  "amount": 100000,
  "memo": "초기 지급"
}
필드타입필수설명
amountInteger지급할 크레딧. 1 이상
memoString아니오원장 메모

성공 응답

{
  "id": "client@example.com",
  "creditBalance": 100000
}

고객사 크레딧 이력 조회

GET /ai/agency/me/clients/{id}/credit
Authorization: Bearer {access_token}

성공 응답

[
  {
    "id": "123",
    "type": "grant",
    "amount": 100000,
    "balanceAfter": 100000,
    "memo": "초기 지급",
    "createdAt": "2026-07-08T10:30:00"
  }
]
필드설명
typegrant, use, adjust 중 하나

On this page