본문으로 건너뛰기

캠페인

목록 조회

GET /campaigns — 활성 캠페인 목록을 cursor pagination으로 조회합니다.

  • Scope: campaigns:read
  • 쿼리: limit(기본 50, 최대 100), cursor. limit[1, 100] 범위를 벗어나면 자동 보정 없이 400 INVALID_QUERY를 반환합니다.
curl "https://api.talk.zeroworks.ai/api/public/v1/campaigns?limit=50" \
-H "Authorization: Bearer ztpat_..."

응답

{
"success": true,
"data": [
{
"id": "c1a2b3d4-...",
"name": "5월 신규 가입 안내",
"status": "completed",
"campaign_type": "chat",
"trigger_type": "scheduled",
"scheduled_at": "2026-05-01T09:00:00Z",
"started_at": "2026-05-01T09:00:03Z",
"completed_at": "2026-05-01T09:04:21Z",
"sent_count": 1280,
"failed_count": 4,
"created_at": "2026-04-28T11:00:00Z",
"updated_at": "2026-05-01T09:04:21Z"
}
],
"meta": { "has_more": true, "next_cursor": "eyJ..." }
}

삭제되지 않은(active) 캠페인만 최신순으로 반환하며 상태 필터는 없습니다. status로 발송 진행 단계를, sent_count·failed_count로 집계를 확인합니다.

필드 값 집합

필드
campaign_typepopup | chat | email (기본 chat)
trigger_typeimmediate | scheduled | event
statusdraft | scheduled | sending | completed | canceled

scheduled_at·started_at·completed_at은 해당 시점에 도달하기 전에는 응답에서 아예 생략됩니다(키 자체가 없음). 메시지 본문(content)과 타깃·A/B 설정은 의도적으로 제외되어 있으며, 현재 공개 API로는 본문을 조회할 수 없습니다.

단건 조회

GET /campaigns/{id} — 단일 캠페인을 조회합니다. {id}는 캠페인 UUID입니다.

  • Scope: campaigns:read
curl "https://api.talk.zeroworks.ai/api/public/v1/campaigns/c1a2b3d4-..." \
-H "Authorization: Bearer ztpat_..."

응답

{
"success": true,
"data": {
"id": "c1a2b3d4-...",
"name": "5월 신규 가입 안내",
"status": "completed",
"campaign_type": "chat",
"trigger_type": "scheduled",
"scheduled_at": "2026-05-01T09:00:00Z",
"started_at": "2026-05-01T09:00:03Z",
"completed_at": "2026-05-01T09:04:21Z",
"sent_count": 1280,
"failed_count": 4,
"created_at": "2026-04-28T11:00:00Z",
"updated_at": "2026-05-01T09:04:21Z"
}
}

ID 형식이 올바르지 않으면 400 INVALID_INPUT, 존재하지 않거나 워크스페이스에 속하지 않은 ID는 404 NOT_FOUND를 반환합니다.