# Fetch Reservations — Mews

> Retrieve reservations using Mews Connector API. See the documentation

- Key: `mews-fetch-reservations`
- Type: Action (Read-only)
- Version: 0.1.0
- App: Mews (`mews`) — https://pipedream.com/apps/mews.md
- This page (HTML): https://pipedream.com/apps/mews/actions/fetch-reservations
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/mews/actions/fetch-reservations/fetch-reservations.mjs

## Description

Retrieve reservations using Mews Connector API. [See the documentation](https://mews-systems.gitbook.io/connector-api/operations/reservations#get-all-reservations-ver-2023-06-06)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `createdStartUtc` | `string` | No | Start of the interval in which Reservation was created. ISO 8601 format. Eg. 2025-01-01T00:00:00Z |
| `createdEndUtc` | `string` | No | End of the interval in which Reservation was created. ISO 8601 format. Max 3 months interval. Eg. 2025-01-01T00:00:00Z |
| `updatedStartUtc` | `string` | No | Start of the interval in which Reservations were updated. ISO 8601 format. Eg. 2025-01-01T00:00:00Z |
| `updatedEndUtc` | `string` | No | End of the interval in which Reservations were updated. ISO 8601 format. Max 3 months interval. Eg. 2025-01-01T00:00:00Z |
| `collidingStartUtc` | `string` | No | Start of the interval in which reservations are active. Reservation is selected if any part of its interval intersects with the interval specified. ISO 8601 format. Eg. 2025-01-01T00:00:00Z |
| `collidingEndUtc` | `string` | No | End of the interval in which reservations are active. ISO 8601 format. Max 3 months interval. Eg. 2025-01-01T00:00:00Z |
| `scheduledStartStartUtc` | `string` | No | Start of the interval filtering Reservations by their scheduled start time. Cannot be used with Actual Start. ISO 8601 format. Eg. 2025-01-01T00:00:00Z |
| `scheduledStartEndUtc` | `string` | No | End of the interval filtering Reservations by their scheduled start time. ISO 8601 format. Max 3 months interval. Eg. 2025-01-01T00:00:00Z |
| `scheduledEndStartUtc` | `string` | No | Start of the interval filtering Reservations by their scheduled end time. Cannot be used with Actual End. ISO 8601 format. Eg. 2025-01-01T00:00:00Z |
| `scheduledEndEndUtc` | `string` | No | End of the interval filtering Reservations by their scheduled end time. ISO 8601 format. Max 3 months interval. Eg. 2025-01-01T00:00:00Z |
| `actualStartStartUtc` | `string` | No | Start of the interval filtering Reservations by their actual start (check-in) time. Cannot be used with Scheduled Start. Note that the filter applies only to started or processed reservations. ISO 8601 format. Eg. 2025-01-01T00:00:00Z |
| `actualStartEndUtc` | `string` | No | End of the interval filtering Reservations by their actual start (check-in) time. ISO 8601 format. Max 3 months interval. Eg. 2025-01-01T00:00:00Z |
| `actualEndStartUtc` | `string` | No | Start of the interval filtering Reservations by their actual end (check-out) time. Cannot be used with Scheduled End. ISO 8601 format. Eg. 2025-01-01T00:00:00Z |
| `actualEndEndUtc` | `string` | No | End of the interval filtering Reservations by their actual end (check-out) time. ISO 8601 format. Max 3 months interval. Eg. 2025-01-01T00:00:00Z |
| `enterpriseIds` | `string[]` | No | Unique identifiers of the Enterprises. If not specified, the operation returns data for all enterprises within scope of the Access Token. Max 1000 items. Options are loaded from the connected account. |
| `reservationIds` | `string[]` | No | Unique identifiers of the Reservations. Max 1000 items. Options are loaded from the connected account. |
| `serviceIds` | `string[]` | No | Unique identifiers of the Services. If not provided, all bookable services are used. Max 1000 items. Options are loaded from the connected account. |
| `reservationGroupIds` | `string[]` | No | Unique identifiers of Reservation groups. Max 1000 items. Options are loaded from the connected account. |
| `accountIds` | `string[]` | No | Unique identifiers of accounts (currently only Customers, in the future also Companies) the reservation is associated with. Max 1000 items. Options are loaded from the connected account. |
| `partnerCompanyIds` | `string[]` | No | Unique identifiers of the Companies on behalf of which the reservations were made. Max 100 items. Options are loaded from the connected account. |
| `travelAgencyIds` | `string[]` | No | Identifier of the Travel Agencies (Company) that mediated the reservations. Max 100 items. (Company with a TravelAgencyContract) Options are loaded from the connected account. |
| `numbers` | `string[]` | No | Reservation confirmation numbers. Max 1000 items. |
| `channelNumbers` | `string[]` | No | Numbers or references used by a Channel (OTA, GDS, CRS, etc.) in case the reservation group originates there, e.g. Booking.com confirmation numbers. Max 100 items. |
| `assignedResourceIds` | `string[]` | No | Unique identifiers of the Resources assigned to the reservations. Max 1000 items. Options are loaded from the connected account. |
| `availabilityBlockIds` | `string[]` | No | Unique identifiers of the Availability blocks assigned to the reservations. Max 100 items. |
| `states` | `string[]` | No | A list of service order states to filter by. |
| `maxResults` | `integer` | No | Maximum number of records to return (min 1, max 99999). Leave blank to return every matching record. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "mews",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "mews-fetch-reservations",
  arguments: {
    createdStartUtc: "Created Start (UTC)",
    createdEndUtc: "Created End (UTC)",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "mews-fetch-reservations",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    mews: { authProvisionId: "apn_xxxxxxx" },
    createdStartUtc: "Created Start (UTC)",
    createdEndUtc: "Created End (UTC)",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "mews-fetch-reservations",
    "configured_props": {
      "mews": { "authProvisionId": "apn_xxxxxxx" },
      "createdStartUtc": "Created Start (UTC)",
      "createdEndUtc": "Created End (UTC)"
    }
  }'
```

---

- App: https://pipedream.com/apps/mews.md · All apps: https://pipedream.com/apps
