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.
Request Body
Section titled “Request Body ”object
Token identifying the client application.
Access token of the client application.
Name and version of the client application.
Unique identifier of the Service to which the restrictions apply.
Details of the matching conditions and time intervals for clearing restrictions.
object
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.)
Unique identifier of the exact Rate
to which the restriction applies.
Unique identifier of the base Rate
to which the restriction applies.
Unique identifier of the Rate group
to which the restriction applies.
Unique identifier of the Resource category
to which the restriction applies.
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
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.
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.
The days of week to which the restriction applies.
object
Monday enabled
Tuesday enabled
Wednesday enabled
Thursday enabled
Friday enabled
Saturday enabled
Sunday enabled
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 } } ]}
Responses
Section titled “ Responses ”OK
object
Example
{}
Server has successfully fulfilled the request and there is no additional information to send back.
object
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).
object
Error caused by usage of invalid ClientToken, AccessToken, or you may not have the necessary permission to use the endpoint.
object
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.
object
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
object
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.
object
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.
object
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.