Glowb Dev Docs
Agency API

Admin Agency API

관리자 에이전시 CRUD 및 고객사 조회 API

Admin Agency API

관리자가 에이전시 테넌트를 생성, 조회, 수정, 비활성화하고 소속 고객사를 조회합니다.

모든 API는 관리자 권한이 필요합니다. 목록/상세/생성/수정은 status가 문자열인 envelope를 반환하고, 비활성화/고객사 목록은 bare JSON을 반환합니다.

에이전시 목록 조회

GET /ai/admin/agency?page=1&limit=20&search=agency&status=active
Authorization: Bearer {access_token}

Query Parameters

파라미터타입필수기본값설명
pageInteger아니오1페이지 번호
limitInteger아니오20페이지 크기
searchString아니오없음에이전시명 또는 도메인 검색
statusString아니오없음active 또는 inactive

성공 응답

{
  "status": "200",
  "message": null,
  "data": {
    "items": [
      {
        "id": "agency-a",
        "name": "Agency A",
        "domain": "agency.example.com",
        "brand": {
          "logoUrl": "https://cdn.example.com/logo.png"
        },
        "status": "active",
        "clientCount": 3,
        "createdAt": "2026-07-08T10:30:00"
      }
    ],
    "total": 1,
    "page": 1,
    "limit": 20,
    "totalPages": 1
  }
}

에이전시 생성

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

Request Body

{
  "id": "agency-a",
  "name": "Agency A",
  "domain": "agency.example.com",
  "brand": {
    "logoUrl": "https://cdn.example.com/logo.png"
  }
}
필드타입필수설명
idString아니오에이전시 ID. 생략 시 도메인 앞부분으로 생성
nameString에이전시명
domainString화이트라벨 도메인
brand.logoUrlString아니오로고 URL

성공 응답

{
  "status": "200",
  "message": null,
  "data": {
    "id": "agency-a",
    "name": "Agency A",
    "domain": "agency.example.com",
    "brand": {
      "logoUrl": "https://cdn.example.com/logo.png"
    },
    "status": "active",
    "clientCount": 0,
    "createdAt": "2026-07-08T10:30:00"
  }
}

에이전시 상세 조회

GET /ai/admin/agency/{id}
Authorization: Bearer {access_token}

성공 응답

{
  "status": "200",
  "message": null,
  "data": {
    "id": "agency-a",
    "name": "Agency A",
    "domain": "agency.example.com",
    "brand": {
      "logoUrl": "https://cdn.example.com/logo.png"
    },
    "status": "active",
    "clientCount": 3,
    "createdAt": "2026-07-08T10:30:00"
  }
}

에이전시 수정

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

Request Body

{
  "name": "Agency A Updated",
  "domain": "agency-new.example.com",
  "brand": {
    "logoUrl": "https://cdn.example.com/logo-new.png"
  },
  "status": "inactive"
}
필드타입필수설명
nameString아니오에이전시명
domainString아니오도메인
brand.logoUrlString아니오로고 URL
statusString아니오active 또는 inactive

성공 응답

{
  "status": "200",
  "message": null,
  "data": {
    "id": "agency-a",
    "name": "Agency A Updated",
    "domain": "agency-new.example.com",
    "brand": {
      "logoUrl": "https://cdn.example.com/logo-new.png"
    },
    "status": "inactive",
    "clientCount": 3,
    "createdAt": "2026-07-08T10:30:00"
  }
}

에이전시 비활성화

DELETE /ai/admin/agency/{id}
Authorization: Bearer {access_token}

성공 응답

{
  "id": "agency-a",
  "status": "inactive"
}

에이전시 고객사 목록 조회

GET /ai/admin/agency/{id}/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

에이전시 고객사 수정

관리자가 특정 에이전시의 고객사 정보와 알림 라우팅 토글을 수정합니다. 에이전시 셀프서비스( PATCH /ai/agency/me/clients/{id} )와 동일한 동작이며, 관리자 권한으로 대상 에이전시를 지정합니다.

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

Path Parameters

파라미터타입필수설명
idString에이전시 ID
clientIdString고객사 로그인 ID

Request Body

전달한 필드만 변경되며, 생략하거나 null이면 기존 값을 유지합니다.

{
  "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
}

On this page