> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daysync.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Common Workflows

> End-to-end recipes for common Daysync Integration API tasks.

These recipes show how the endpoints fit together. All calls assume the standard [authentication](/authentication) headers; the examples use these shell variables:

```bash theme={null}
BASE="https://integration.daysync.com"
KEY="dk_live_xxxx"      # x-api-key
SECRET="ds_xxxx"        # x-api-secret
TOKEN="YOUR_ACCESS_TOKEN"
```

## 1. Full tour setup

Stand up a complete tour from scratch.

1. **Find the organization** — `GET /v1/organizations` to get the `org_id` the tour will belong to.
2. **Create the tour with its days** — `POST /v1/tours` with `name`, `org_id`, `start_date`, `end_date`, `timeZone`, and a non-empty `days[]` array. The response returns the new tour `id`.
3. **Get the day IDs** — `GET /v1/tours?org_id=...` and read `tour.tourDays[].id`; these are the `dayId` values used by schedule, venue, and guest-list routes.
4. **Add schedule items** — `POST /v1/schedule/items` with `tour_id` + `day_id`.
5. **Add a venue** — `POST /v1/venues` with `tour_id` + `day_id`.
6. **Add accommodation** — `POST /v1/accommodation` with `tourId` + `dayId` (note the [camelCase](/introduction#field-naming)).

```bash theme={null}
# Step 1 — list organizations
curl "$BASE/v1/organizations" \
  -H "x-api-key: $KEY" -H "x-api-secret: $SECRET" -H "Authorization: Bearer $TOKEN"

# Step 2 — create the tour
curl -X POST "$BASE/v1/tours" \
  -H "x-api-key: $KEY" -H "x-api-secret: $SECRET" -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Spring Tour 2026",
    "org_id": "2f1c…",
    "start_date": "2026-06-01T00:00:00Z",
    "end_date": "2026-06-30T00:00:00Z",
    "timeZone": "Australia/Sydney",
    "days": [
      { "day_type_id": 1, "name": "Day 1", "formatted_address": "Sydney NSW", "date": "2026-06-01T00:00:00Z" }
    ]
  }'
```

## 2. Sync a tour

Keep a local copy in step with Daysync.

1. **Read the tour list** — `GET /v1/tours?org_id=...` and read each tour's `updated_at`/`is_deleted`.
2. **Read each resource** — for each day, `GET` schedule, venues, accommodation, guest list, and bulletins.
3. **Diff against local state** — compare IDs and `updated_at` timestamps; treat `is_deleted: true` as a removal.
4. **Apply changes** — `PUT` changed items, `POST` new ones, `DELETE` removed ones.

<Note>
  There are no webhooks yet — syncing is poll-based. See [pagination](/introduction#pagination) and [rate limits](/introduction#rate-limits) before choosing a polling interval.
</Note>

## 3. Guest list management

1. **Discover pass types** — pass type IDs are configured per tour in the Daysync app; see [Pass object](/endpoints/guest-list#pass-object).
2. **Add guests with passes** — `POST /v1/guestlist` with `tour_id`, `day_id`, guest details, and a `passes` array.
3. **Update status** — `PUT /v1/guestlist/{guestListId}` to change `statusId` as guests are approved.

```bash theme={null}
curl -X POST "$BASE/v1/guestlist" \
  -H "x-api-key: $KEY" -H "x-api-secret: $SECRET" -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "tour_id": "2f1c…",
    "day_id": 1843,
    "firstName": "Sam",
    "lastName": "Taylor",
    "numberOfGuests": 2,
    "pickupMethodId": 1,
    "statusId": 1,
    "passes": [ { "passId": 1, "count": 2 } ]
  }'
```
