Skip to content

데이벤트 API ​

client.day는 장소·이벤트·캐스팅을 다룹니다. 목록과 상세는 로그인하지 않아도 볼 수 있고, 로그인하면 좋아요·신청 여부 같은 내 상태가 함께 옵니다.

역할 ​

데이벤트 프로필(service: 'day')의 역할에 따라 할 수 있는 일이 다릅니다. 한 계정이 여러 역할을 가질 수 있습니다.

역할할 수 있는 일
venue (장소 운영자)장소 등록, 이벤트·캐스팅 개설, 신청자 관리, 출석 체크
influencer이벤트 신청, 캐스팅 지원
user이벤트 신청

역할이 없으면 403이 돌아옵니다. 역할 추가는 client.users.addProfile({ service: 'day', role })로 합니다.

목록 조회 ​

ts
const page = await client.day.events.list({
  regionId: 'seongsu',
  status: ['open'],
  target: ['all', 'influencer'],
  sort: 'popular', // 'date'(기본) | 'new' | 'popular'
  page: 1,
  pageSize: 20, // 최대 100
});
// page = { items, total, page, pageSize }
  • 기본으로 오늘 이후 이벤트만 옵니다. 지난 이벤트까지 보려면 includePast: true.
  • 지도 화면은 minLat·maxLat·minLng·maxLng로 보이는 영역만 가져옵니다.
  • ownerId: 'me'는 내가 연 이벤트입니다(로그인 필요).
  • 지역·카테고리 목록은 client.day.meta()로 받습니다.

캐스팅(client.day.castings.list)과 장소(client.day.places.list)도 같은 방식입니다.

이벤트 개설 ​

이벤트와 캐스팅을 열면 등록비(건당 100,000원) 결제가 함께 만들어집니다. 네트워크 오류로 다시 보낼 때 결제가 두 번 되지 않도록, 같은 등록에는 같은 idempotencyKey를 쓰세요.

ts
const idempotencyKey = crypto.randomUUID(); // 폼을 열 때 한 번 만들어 두기

const event = await client.day.events.create({
  idempotencyKey,
  placeId,
  title: '성수 루프탑 와인 나잇',
  category: '파티',
  date: '2026-10-24',
  startTime: '19:00',
  endTime: '23:00',
  address: '서울 성동구 …',
  regionId: 'seongsu',
  lat: 37.544,
  lng: 127.055,
  description: '…',
  program: '…',
  lineup: [],
  target: 'all', // 'all' | 'influencer' | 'user'
  capacity: 40,
  priceInfluencer: 0,
  priceUser: 15000,
});

await client.day.events.setStatus(event.id, { status: 'closed' }); // open | closed | ended | canceled

진행 중인 이벤트나 캐스팅이 걸린 장소는 삭제할 수 없습니다(409).

신청과 출석 ​

ts
await client.day.events.apply(eventId, { message: '친구와 함께 갈게요', role: 'influencer' });
await client.day.events.cancelApplication(eventId);

// 개설자
const { items } = await client.day.events.applications(eventId);
await client.day.events.setAttendance(applicationId, { attended: true });

role은 user와 influencer를 모두 가진 계정이 어느 역할로 신청할지 고를 때만 보냅니다. 정원이 찼거나, 이미 신청했거나, 내가 연 이벤트면 신청할 수 없습니다.

캐스팅 ​

ts
await client.day.castings.apply(castingId, { message: '뷰티 채널 운영 중입니다' }); // influencer 역할 필요

// 개설자
await client.day.castings.decide(applicationId, { status: 'selected' }); // pending | selected | rejected
await client.day.castings.setStatus(castingId, { status: 'closed' });

좋아요·일정·신고 ​

ts
await client.day.events.like(eventId);
await client.day.events.unlike(eventId);

const likes = await client.day.me.likes();
const schedule = await client.day.me.schedule(); // 내가 신청한·연 이벤트 일정

await client.day.report({ targetType: 'event', targetId: eventId, reason: '허위 정보가 있어요' });

신고는 운영 콘솔(admin)의 신고 화면으로 들어갑니다.