Skip to content

Clear restrictions

POST
/api/connector/v1/restrictions/clear

Deletes restrictions that exactly match the specified conditions, using a splicing algorithm. This operation is intended to be used alongside Set restrictions. The specified conditions must be met exactly. The time interval, however, does not need to correspond to an existing restriction in the system, instead the API uses a splicing algorithm to work out how to divide up any existing restrictions to meet the specified time interval. For details about matching conditions and the splicing algorithm, see Concepts > Restrictions.

Only restrictions created through the API are affected by this operation, not restrictions created by the user within Mews Operations. Similarly, if a user creates a restriction in Mews Operations, this will not affect restrictions created through the API.

ClearRestrictionParameters
object
ClientToken
required

Token identifying the client application.

string
>= 1 characters
AccessToken
required

Access token of the client application.

string
>= 1 characters
Client
required

Name and version of the client application.

string
>= 1 characters
ServiceId
required

Unique identifier of the Service to which the restrictions apply.

string
>= 1 characters
Data
required

Details of the matching conditions and time intervals for clearing restrictions.

Array<object>
>= 1 items <= 1000 items
Restriction clear data
object
Type
required
Restriction type

Restriction type.

Stay (Guests can’t stay within specified dates.)

Start (Guests can’t check in within specified dates.)

End (Guests can’t check out within specified dates.)

string
Allowed values: Stay Start End
ExactRateId

Unique identifier of the exact Rate to which the restriction applies.

string
nullable
BaseRateId

Unique identifier of the base Rate to which the restriction applies.

string
nullable
RateGroupId

Unique identifier of the Rate group to which the restriction applies.

string
nullable
ResourceCategoryId

Unique identifier of the Resource category to which the restriction applies.

string
nullable
ResourceCategoryType

Name of the Resource category type to which the restriction applies.

Room

Bed

Dorm

Apartment

Suite

Villa

Site

Office

MeetingRoom

ParkingSpot

Desk

TeamArea

Membership

Tent

CaravanOrRV

UnequippedCampsite

Bike

ExtraBed

Cot

Crib

ConferenceRoom

Rooftop

Garden

Restaurant

Amphitheater

PrivateSpaces

string
Allowed values: Room Bed Dorm Apartment Suite Villa Site Office MeetingRoom ParkingSpot Desk TeamArea Membership Tent CaravanOrRV UnequippedCampsite Bike ExtraBed Cot Crib ConferenceRoom Rooftop Garden Restaurant Amphitheater PrivateSpaces
StartUtc

Start date of the time interval for which the restriction conditions should be applied. This must be in UTC timezone in ISO 8601 format - see Datetimes.

string format: date-time
nullable
EndUtc

End date of the time interval for which the restriction conditions should be applied. This must be in UTC timezone in ISO 8601 format - see Datetimes.

string format: date-time
nullable
Days
required
Days parameters

The days of week to which the restriction applies.

object
Monday
required

Monday enabled

boolean
Tuesday
required

Tuesday enabled

boolean
Wednesday
required

Wednesday enabled

boolean
Thursday
required

Thursday enabled

boolean
Friday
required

Friday enabled

boolean
Saturday
required

Saturday enabled

boolean
Sunday
required

Sunday enabled

boolean
Example
{
"ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
"AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
"Client": "Sample Client 1.0.0",
"ServiceId": "bd26d8db-86da-4f96-9efc-e5a4654a4a94",
"Data": [
{
"Type": "Start",
"ExactRateId": "ed4b660b-19d0-434b-9360-a4de2ea42eda",
"ResourceCategoryId": "773d5e42-de1e-43a0-9ce6-f940faf2303f",
"StartUtc": "2023-02-15T00:00:00Z",
"EndUtc": "2023-02-22T00:00:00Z",
"Days": {
"Monday": false,
"Tuesday": false,
"Wednesday": false,
"Thursday": false,
"Friday": true,
"Saturday": true,
"Sunday": true
}
},
{
"Type": "Start",
"BaseRateId": "e5b538b1-36e6-43a0-9f5c-103204c7f68e",
"StartUtc": "2023-02-23T00:00:00Z",
"EndUtc": "2023-03-03T00:00:00Z",
"Days": {
"Monday": true,
"Tuesday": true,
"Wednesday": true,
"Thursday": true,
"Friday": true,
"Saturday": false,
"Sunday": false
}
}
]
}

OK

object
Example
{}

Server has successfully fulfilled the request and there is no additional information to send back.

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable

Error caused by the client app, e.g. in case of malformed request or invalid identifier of a resource. In most cases, such an error signifies a bug in the client app (consumer of the API).

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable

Error caused by usage of invalid ClientToken, AccessToken, or you may not have the necessary permission to use the endpoint.

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable

Server error that should be reported to the end user of the client app. Happens for example when the server-side validation fails or when a business-logic check is violated.

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable

Error caused by heavy request that takes too long to process (typically tens of seconds). To get around this, request data in smaller batches. For more information, see Request timeouts

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable

The request cannot be completed because the data has changed, causing conflict between the state on the client and the server. To get around this error, try refreshing the data on the client and resubmitting the request.

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable

Error caused by too many requests sent in a given amount of time. Response contains Retry-After header indicating how long the user agent should wait before making a follow-up request. For more information, see Request limits.

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable

Unexpected error on the Mews side. This may be due to a software fault. If such a situation occurs, the error will be logged and the development team notified, however you can raise an issue through GitHub on our documentation repository.

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable