로그인

API

간단한 REST API를 통해 여행을 만들고, 일정을 관리하고, 협업할 수 있습니다.

인증

모든 API 요청에는 Authorization 헤더에 Bearer 토큰으로 API 키가 필요합니다.

설정 → API 키에서 키를 생성하세요. 키를 즉시 복사하세요. 다시 표시되지 않습니다.

curl https://keen-sturgeon-487.convex.site/api/v1/trips \
  -H "Authorization: Bearer osk_your_key_here"

Scopes

The four base scopes are trips:read, trips:write, messages:read, and messages:write. Each can be limited to a single trip by appending :<tripId>. For example, a key with only the scope trips:write:jx7abc... can create and update content on that one trip but nothing else. In the settings UI, leave "Limit to trip" blank for a key that works everywhere, or paste a trip ID to scope it down.

SDKs

You do not need a client to use the REST API, but the official TypeScript SDK takes care of the tedious bits: auto-generated idempotency keys, retry with exponential backoff on 429 and 5xx, cursor pagination iterators, typed errors, and an unauthenticated share-token consumer.

TypeScript

npm install @osoto/api-client
import { OsotoClient } from '@osoto/api-client';

const client = new OsotoClient({
  apiKey: process.env.OSOTO_API_KEY!,
  baseUrl: 'https://keen-sturgeon-487.convex.site/api/v1',
});

const me = await client.me();
const { _id: tripId } = await client.createTrip({
  groupId: me.defaultGroupId!,
  title: 'Cotswolds',
  startDate: '2026-07-15',
  endDate: '2026-07-22',
});

// Async iterator loops every page automatically.
for await (const leg of client.iterateLegs(tripId)) {
  console.log(leg.title);
}

Model Context Protocol

Agents that speak MCP (Claude Desktop, Claude Code, Cursor, Windsurf, OpenClaw) can consume the REST API through @osoto/mcp-server without writing any client code.

npx @osoto/mcp-server

Full MCP setup instructions →

속도 제한

API 키는 분당 60개 요청으로 제한됩니다. 속도 제한 상태는 응답 헤더에 반환됩니다.

ParameterTypeDescription
X-RateLimit-Limitinteger윈도우당 허용 요청 수
X-RateLimit-Remaininginteger현재 윈도우의 남은 요청 수
Retry-Afterinteger윈도우 리셋까지의 초 (429인 경우만)

Idempotency and retries

Retries are safe. You have two tools for making sure a flaky network does not create duplicates: an Idempotency-Key header for individual mutations, and a clientRef field for upserting rows by a caller-supplied identifier.

Idempotency-Key header

Any POST, PATCH, or DELETE may include an Idempotency-Key header (max 255 characters). Retries with the same key replay the cached response; retries with the same key but a different body return 409 IDEMPOTENCY_CONFLICT. Cached responses expire after 24 hours.

curl -X POST https://keen-sturgeon-487.convex.site/api/v1/trips \
  -H "Authorization: Bearer osk_..." \
  -H "Idempotency-Key: create-trip-42" \
  -H "Content-Type: application/json" \
  -d '{"groupId":"...","title":"Cotswolds","startDate":"2026-07-15","endDate":"2026-07-22"}'

clientRef field

Pass a clientRef when creating legs, action items, map pins, or stays. It is unique per trip (or per leg for stays). Passing the same value on a retry diff-merges into the existing row instead of inserting a duplicate. clientRef pairs naturally with the batch upsert endpoints when importing a full itinerary.

오류

오류는 코드와 메시지를 포함하는 JSON 객체로 반환됩니다.

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Missing required fields: title, startDate",
    "requestId": "req_0f9a8b7c-...",
    "details": [
      { "path": "title", "reason": "required" },
      { "path": "startDate", "reason": "required" }
    ]
  }
}

Every response carries an X-Request-Id header (mirrored in error.requestId for error responses). Include it when filing support issues so we can trace the request end-to-end.

ParameterTypeDescription
UNAUTHORIZED401유효하지 않거나 누락된 API 키
FORBIDDEN403필요한 스코프 또는 여행 접근 권한 부족
NOT_FOUND404리소스가 존재하지 않음
VALIDATION_ERROR400요청 필드 누락 또는 무효
IDEMPOTENCY_CONFLICT409Same Idempotency-Key was replayed with a different request body
RATE_LIMITED429요청이 너무 많음

엔드포인트

Me

GET/me

Return the authenticated user, their groups, and the default group ID. Call this once at startup to discover groupId values for trip creation.

curl https://keen-sturgeon-487.convex.site/api/v1/me \
  -H "Authorization: Bearer osk_..."

여행

GET/trips

인증된 사용자가 접근할 수 있는 모든 여행을 나열합니다.

curl https://keen-sturgeon-487.convex.site/api/v1/trips \
  -H "Authorization: Bearer osk_..."
POST/trips

새 여행을 만듭니다.

ParameterTypeDescription
groupId*string여행을 만들 그룹
title*string여행 제목
startDate*string시작일 (YYYY-MM-DD)
endDate*string종료일 (YYYY-MM-DD)
curl -X POST https://keen-sturgeon-487.convex.site/api/v1/trips \
  -H "Authorization: Bearer osk_..." \
  -H "Content-Type: application/json" \
  -d '{"groupId":"...","title":"Summer in the Cotswolds","startDate":"2026-07-15","endDate":"2026-07-22"}'
GET/trips/{tripId}

여행 상세 정보를 가져옵니다.

GET/trips/{tripId}/export

Canonical trip snapshot. Returns trip, legs, map pins, action items, commitments, and members in a single response. Use this to answer questions like "where am I staying on Tuesday" without issuing multiple reads.

curl https://keen-sturgeon-487.convex.site/api/v1/trips/TRIP_ID/export \
  -H "Authorization: Bearer osk_..."
POST/trips/{tripId}/sync

Diff-based snapshot import. Pass any combination of legs, actionItems, and mapPins; items with a matching clientRef are diff-merged, items without are created. Set dryRun=true to preview the change set without writing. Returns per-category created/updated/errors counts and per-item outcomes.

curl -X POST "https://keen-sturgeon-487.convex.site/api/v1/trips/TRIP_ID/sync?dryRun=true" \
  -H "Authorization: Bearer osk_..." \
  -H "Content-Type: application/json" \
  -d '{"legs":[{"order":0,"title":"Tokyo","destination":"Tokyo","startDate":"2026-07-15","endDate":"2026-07-20","timezone":"Asia/Tokyo","clientRef":"leg-tok-1"}],"mapPins":[{"name":"Sensoji","lat":35.7148,"lng":139.7967,"clientRef":"pin-sensoji"}]}'
PATCH/trips/{tripId}

여행 메타데이터를 업데이트합니다.

ParameterTypeDescription
titlestring새 제목
startDatestring새 시작일
endDatestring새 종료일
statusstringdraft, active, 또는 completed
DELETE/trips/{tripId}

여행을 아카이브합니다 (상태를 completed로 설정).

일정 구간

GET/trips/{tripId}/legs

여행의 구간을 순서대로 나열합니다.

ParameterTypeDescription
limitintegerMax results (default 100, max 200)
cursorstringPagination cursor from previous response
POST/trips/{tripId}/legs

일정 구간을 추가합니다.

ParameterTypeDescription
order*number정렬 순서 (0부터 시작)
title*string구간 제목
destination*string목적지명
startDate*string시작일
endDate*string종료일
timezone*stringIANA 시간대 (예: Europe/London)
accommodationobject숙소 세부정보
flightsarray항공편 세부정보
rentalCarobject렌터카 세부정보
clientRefstringCaller-supplied unique reference (per trip). Retries upsert instead of duplicating.
POST/trips/{tripId}/legs:batch

Batch upsert up to 50 legs in a single call. Items with a matching clientRef are diff-merged; items without are created. Partial success: a 207 response lists per-item results.

curl -X POST https://keen-sturgeon-487.convex.site/api/v1/trips/TRIP_ID/legs:batch \
  -H "Authorization: Bearer osk_..." \
  -H "Content-Type: application/json" \
  -d '{"items":[{"order":0,"title":"Tokyo","destination":"Tokyo","startDate":"2026-07-15","endDate":"2026-07-20","timezone":"Asia/Tokyo","clientRef":"leg-tok-1"}]}'
PATCH/trips/{tripId}/legs/{legId}

일정 구간을 업데이트합니다.

DELETE/trips/{tripId}/legs/{legId}

일정 구간을 삭제합니다.

액션 아이템

GET/trips/{tripId}/action-items

여행의 체크리스트 항목을 나열합니다.

POST/trips/{tripId}/action-items

체크리스트 항목을 만듭니다.

ParameterTypeDescription
text*string항목 텍스트
urgency*stringnow, before_trip, 또는 nice_to_have
ownerstring할당할 사용자 ID
clientRefstringCaller-supplied unique reference (per trip). Retries upsert instead of duplicating.
POST/trips/{tripId}/action-items:batch

Batch upsert up to 50 action items. Supports clientRef for retry-safe upserts.

PATCH/trips/{tripId}/action-items/{itemId}

액션 아이템 업데이트 또는 완료 토글.

DELETE/trips/{tripId}/action-items/{itemId}

액션 아이템을 삭제합니다.

Commitments

GET/trips/{tripId}/commitments

List scheduled events on a trip: dinners, activities, birthdays, meetings. Paginated — default limit 100, max 200, ordered by startDate and startTime.

POST/trips/{tripId}/commitments

Create a scheduled event. Optionally link it to a leg or a map pin.

ParameterTypeDescription
title*stringEvent title
startDate*stringDate (YYYY-MM-DD)
category*stringdinner, activity, birthday, meeting, or other
startTimestringLocal time HH:mm (24-hour)
endTimestringLocal time HH:mm (24-hour)
isAllDaybooleanTrue for all-day events (startTime and endTime are ignored)
timezonestringIANA timezone (e.g., Europe/London)
legIdstringLink to an existing trip leg
mapPinIdstringLink to an existing map pin
notesstringFree-form notes about the event
PATCH/trips/{tripId}/commitments/{commitmentId}

Update a commitment.

DELETE/trips/{tripId}/commitments/{commitmentId}

Remove a commitment.

지도 핀

GET/trips/{tripId}/map-pins

여행의 지도 핀을 나열합니다.

POST/trips/{tripId}/map-pins

여행 지도에 장소를 핀 찍습니다.

ParameterTypeDescription
name*string장소명
lat*number위도
lng*number경도
categorystring카테고리 (예: 레스토랑, 호텔)
notesstring장소에 대한 메모
clientRefstringCaller-supplied unique reference (per trip). Retries upsert instead of duplicating.
POST/trips/{tripId}/map-pins:batch

Batch upsert up to 50 map pins. Supports clientRef for retry-safe upserts.

PATCH/trips/{tripId}/map-pins/{pinId}

지도 핀을 업데이트합니다.

DELETE/trips/{tripId}/map-pins/{pinId}

지도 핀을 삭제합니다.

메시지

GET/trips/{tripId}/channels

여행의 채널을 나열합니다.

GET/trips/{tripId}/channels/{channelId}/messages

채널의 메시지를 나열합니다. 페이지네이션: 다음 페이지에는 cursor를 전달하세요.

ParameterTypeDescription
limitinteger최대 결과 수 (기본 50, 최대 100)
cursorstring이전 응답의 페이지네이션 커서
POST/trips/{tripId}/channels/{channelId}/messages

채널에 메시지를 보냅니다.

ParameterTypeDescription
content*string메시지 내용
parentIdstring답장할 메시지 ID

여행 멤버

GET/trips/{tripId}/members

여행의 멤버와 역할, 연락처를 나열합니다.

Shared (no auth)

Generate a share token with POST /trips/{tripId}/share-token. The token grants unauthenticated read access to the safe projection of the trip. Sensitive fields like wifiPassword, doorCode, hostPhone, confirmationNumber, and check-in instructions are stripped. Revoke with DELETE /trips/{tripId}/share-token.

GET/shared/trips/{token}

Read-only share view. No Authorization header required.

curl https://keen-sturgeon-487.convex.site/api/v1/shared/trips/SHARE_TOKEN
GET/shared/trips/{token}/export

Canonical share snapshot with the same shape as /trips/{tripId}/export but using the safe-allowlist projection.