View as Markdown
Mews icon

Mews ACTION

Create Availability Block

Create an availability block in Mews. See the documentation
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Mews account once, then configure and run Create Availability Block from your backend or agent.

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-create-availability-block",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    mews: { authProvisionId: "apn_xxxxxxx" },
    serviceId: "Service ID",
    rateId: "Rate ID",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Create Availability Block inputs
Property Type Description
serviceId Service ID string
Unique identifier of the Service to assign block to.
Required Dynamic
rateId Rate ID string
Unique identifier of the Rate to assign block to.
Required Dynamic
firstTimeUnitStartUtc First Time Unit Start (UTC) string
Start of the time interval, expressed as the timestamp for the start of the first time unit, in UTC timezone ISO 8601 format. Eg. 2025-01-01T00:00:00Z
Required
lastTimeUnitStartUtc Last Time Unit Start (UTC) string
End of the time interval, expressed as the timestamp for the start of the first time unit, in UTC timezone ISO 8601 format. Eg. 2025-01-01T00:00:00Z
Required
state State string
State of the availability block.
Required
releasedUtc Released (UTC) string
The moment when the block and its availability is released, in UTC timezone ISO 8601 format. Takes precedence over RollingReleaseOffset. Eg. 2025-01-01T00:00:00Z
Optional
name Name string
The name of the block.
Optional
bookerId Booker ID string
Unique identifier of the Booker as a creator of an availability block.
Optional Dynamic
companyId Company ID string
Unique identifier of Company.
Optional Dynamic
travelAgencyId Travel Agency ID string
Identifier of the Travel Agency. (Company with a TravelAgencyContract)
Optional Dynamic
budgetCurrency Currency string
Currency of the budget.
Optional Dynamic
budgetValue Budget Value string
The value of the budget.
Optional
reservationPurpose Reservation Purpose string
The purpose of the block.
Optional
externalIdentifier External Identifier string
Identifier of the block from external system. Max length 255 characters.
Optional
notes Notes string
Additional notes of the block.
Optional
quoteId Quote ID string
Unique identifier of the Mews Events quote associated with the availability block.
Optional
purchaseOrderNumber Purchase Order Number string
Unique number of the purchase order. This number is propagated to any newly picked up Reservation within the block.
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
mews-create-availability-block
Version
0.0.3
App
Mews
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes