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
| 파라미터 | 타입 | 필수 | 기본값 | 설명 |
|---|---|---|---|---|
page | Integer | 아니오 | 1 | 페이지 번호 |
limit | Integer | 아니오 | 20 | 페이지 크기 |
search | String | 아니오 | 없음 | 에이전시명 또는 도메인 검색 |
status | String | 아니오 | 없음 | 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/jsonRequest Body
{
"id": "agency-a",
"name": "Agency A",
"domain": "agency.example.com",
"brand": {
"logoUrl": "https://cdn.example.com/logo.png"
}
}| 필드 | 타입 | 필수 | 설명 |
|---|---|---|---|
id | String | 아니오 | 에이전시 ID. 생략 시 도메인 앞부분으로 생성 |
name | String | 예 | 에이전시명 |
domain | String | 예 | 화이트라벨 도메인 |
brand.logoUrl | String | 아니오 | 로고 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/jsonRequest Body
{
"name": "Agency A Updated",
"domain": "agency-new.example.com",
"brand": {
"logoUrl": "https://cdn.example.com/logo-new.png"
},
"status": "inactive"
}| 필드 | 타입 | 필수 | 설명 |
|---|---|---|---|
name | String | 아니오 | 에이전시명 |
domain | String | 아니오 | 도메인 |
brand.logoUrl | String | 아니오 | 로고 URL |
status | String | 아니오 | 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
}
]| 필드 | 타입 | 설명 |
|---|---|---|
notifyAdvertiser | Boolean | 고객사(광고주)가 광고주 알림 이메일을 수신할지. 기본 true |
notifyAgency | Boolean | 에이전시가 이 고객사 캠페인 알림 사본(CC)을 수신할지. 기본 false |
에이전시 고객사 수정
관리자가 특정 에이전시의 고객사 정보와 알림 라우팅 토글을 수정합니다. 에이전시 셀프서비스( PATCH /ai/agency/me/clients/{id} )와 동일한 동작이며, 관리자 권한으로 대상 에이전시를 지정합니다.
PATCH /ai/admin/agency/{id}/clients/{clientId}
Authorization: Bearer {access_token}
Content-Type: application/jsonPath Parameters
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
id | String | 예 | 에이전시 ID |
clientId | String | 예 | 고객사 로그인 ID |
Request Body
전달한 필드만 변경되며, 생략하거나 null이면 기존 값을 유지합니다.
{
"notifyAdvertiser": false,
"notifyAgency": true
}| 필드 | 타입 | 필수 | 설명 |
|---|---|---|---|
name | String | 아니오 | 고객사명 |
email | String | 아니오 | 고객사 이메일 |
status | String | 아니오 | active 또는 inactive |
notifyAdvertiser | Boolean | 아니오 | 광고주 수신 on/off. 기본 true |
notifyAgency | Boolean | 아니오 | 에이전시 합류 수신 on/off. 기본 false |
알림 라우팅 동작
notifyAdvertiser/notifyAgency는 이 고객사(AGENCY_CLIENT) 캠페인의 알림 발송 대상을 정합니다. 일반 광고주에게는 영향이 없습니다. notifyAgency=true이면 에이전시의 기본 담당자에게 글로우비 브랜드로 사본(CC)이 발송됩니다.
notifyAdvertiser | notifyAgency | 결과 |
|---|---|---|
true | false | 광고주만 수신 (기본) |
true | true | 광고주 + 에이전시 둘 다 수신 |
false | true | 에이전시만 수신 (광고주 차단) |
false | false | 아무도 수신 안 함 |
성공 응답
{
"id": "client@example.com",
"name": "고객사 A",
"email": "client@example.com",
"status": "active",
"creditBalance": 0,
"createdAt": "2026-07-08T10:30:00",
"notifyAdvertiser": false,
"notifyAgency": true
}