/v1/resources/{id}/restrictions (PUT)
PUT
/v1/resources/{id}/restrictions
const url = 'http://localhost:8787/v1/resources/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/restrictions';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"restrictions":[{"closedToArrival":true,"closedToDeparture":true,"from":"2026-04-15T12:00:00Z","maxStayNights":1,"minStayNights":1,"ratePlanCode":"example","stopSell":false,"to":"2026-04-15T12:00:00Z"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url http://localhost:8787/v1/resources/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/restrictions \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "restrictions": [ { "closedToArrival": true, "closedToDeparture": true, "from": "2026-04-15T12:00:00Z", "maxStayNights": 1, "minStayNights": 1, "ratePlanCode": "example", "stopSell": false, "to": "2026-04-15T12:00:00Z" } ] }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
Request Body
Section titled “Request Body”Media typeapplication/json
object
restrictions
required
Array<object>
object
closedToArrival
boolean | null
closedToDeparture
boolean | null
from
required
string format: date-time
maxStayNights
integer | null
minStayNights
integer | null
ratePlanCode
required
string
stopSell
boolean
to
required
string format: date-time
Responses
Section titled “Responses”Full restriction calendar after the replace — see application/inventory/restrictions.service.ts’s header for the declarative-replace-per-rate-plan semantics.
Media typeapplication/json
object
resourceId
required
string format: uuid
restrictions
required
Array<object>
object
closedToArrival
required
boolean | null
closedToDeparture
required
boolean | null
from
required
string
id
required
string format: uuid
maxStayNights
required
integer | null
minStayNights
required
integer | null
ratePlanCode
required
string
stopSell
required
boolean
to
required
string
Examplegenerated
{ "resourceId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "restrictions": [ { "closedToArrival": true, "closedToDeparture": true, "from": "example", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "maxStayNights": 1, "minStayNights": 1, "ratePlanCode": "example", "stopSell": true, "to": "example" } ]}A ratePlanCode in the body doesn’t resolve for this resource.
Media typeapplication/problem+json
object
code
required
string
detail
required
string
status
required
number
title
required
string
type
required
string
Example
{ "code": "resource_not_found"}No such resource for this tenant.
Media typeapplication/problem+json
object
code
required
string
detail
required
string
status
required
number
title
required
string
type
required
string
Example
{ "code": "resource_not_found"}This resource has no room type.
Media typeapplication/problem+json
object
code
required
string
detail
required
string
status
required
number
title
required
string
type
required
string
Example
{ "code": "resource_not_found"}