> For the complete documentation index, see [llms.txt](https://docs.channex.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.channex.io/api-v.1-documentation/ari/update-restrictions-api.md). Agents can also search and read this documentation through its [MCP server](https://docs.channex.io/~gitbook/mcp).

# Update Restrictions API

## Update rates and restrictions

> Update rates and restrictions for specific Rate Plans and dates. Each change\
> object carries the Property and the Rate Plan it applies to, and targets\
> either a single \`date\` or the range \`date\_from\`–\`date\_to\`, optionally\
> narrowed to specific \`days\`. Sending both a \`date\` and the pair is refused,\
> and so is sending neither.\
> \
> Changes are applied asynchronously: \`data\` carries one background task\
> reference per Property, and the new values are readable a moment later rather\
> than at once. See the Tasks resource to follow a task to completion.\
> \
> Change objects are applied in the order given, so a broad range can be set\
> first and overridden by later, narrower objects.\
> \
> A change object that fails validation is rejected on its own and reported\
> under \`meta.warnings\` while the others are still applied — such a response is\
> still \`200 OK\`, and \`data\` is empty only when every change object was\
> rejected. A range that starts in the past is clamped to today rather than\
> rejected, and the clamp is reported as a warning of its own.\
> \
> Rate limited to ten requests a minute per Property. Availability updates\
> carry a limit of ten a minute of their own, so twenty ARI updates a minute\
> per Property in all; beyond that the request answers \`429 Too Many\
> Requests\`, and nothing is applied until the limit expires.

```json
{"openapi":"3.1.0","info":{"title":"Channex.io — Public API","version":"0.0.0"},"tags":[{"name":"ARI","description":"Read and update Availability, Rates and Inventory. Rates and restrictions are held per Rate Plan and date; real availability is held per Room Type and date, and every Rate Plan of that Room Type reads it back as its own `availability`. Updates on both paths are queued: the response references a background task per Property (see the Tasks resource), and the new values are readable a moment later rather than at once. The `availability_offset` and `max_availability` values a read returns are set through Channel Availability Rules, not here."}],"servers":[{"url":"https://app.channex.io/api/v1","description":"Production server","variables":{}},{"url":"https://staging.channex.io/api/v1","description":"Staging server","variables":{}}],"security":[{"UserApiKeyAuth":[]}],"components":{"securitySchemes":{"UserApiKeyAuth":{"type":"apiKey","in":"header","name":"user-api-key","description":"API key for programmatic access, sent in the `user-api-key` header."}},"schemas":{"Restrictions.UpdateAcknowledgement":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Restrictions.TaskReference"}},"meta":{"type":"object","properties":{"message":{"type":"string"},"warnings":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/Restrictions.UpdateWarning"},{"type":"string"}]},"description":"The change objects that were rejected, and why. Present only when there are any."}},"required":["message"]}},"description":"Acknowledgement of an ARI update. Changes are applied asynchronously: `data`\nreferences the background tasks produced, one per Property, and is empty when\nevery change object was rejected. A rejected change object never fails the\nrequest — it is reported under `meta.warnings` while the rest is applied, and\nthe status is still `200 OK`."},"Restrictions.TaskReference":{"type":"object","required":["id","type"],"properties":{"id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}]},"type":{"type":"string","enum":["task"]}},"description":"Reference to a background task produced by an update. Its progress can be read through the Tasks resource."},"Common.Scalars.id":{"type":"string","format":"uuid"},"Restrictions.UpdateWarning":{"type":"object","required":["warning"],"properties":{"warning":{"type":"object","unevaluatedProperties":{"type":"array","items":{"type":"string"}},"description":"Maps each rejected field to the reasons it was rejected."}},"unevaluatedProperties":{},"description":"A change object rejected from an update: the submitted fields echoed back —\nthey may hold arbitrarily invalid data — plus `warning` with the reason per\nfield."},"Common.Errors.UnparsableRequest":{"type":"object","required":["errors"],"properties":{"errors":{"$ref":"#/components/schemas/Common.Errors.UnparsableRequestObject"}},"description":"The request body could not be parsed as JSON."},"Common.Errors.UnparsableRequestObject":{"type":"object","required":["code","title","details"],"properties":{"code":{"type":"string","enum":["bad_request"]},"title":{"type":"string","enum":["Bad Request"]},"details":{"type":"object","unevaluatedProperties":{"type":"string"},"description":"Maps the part of the request that could not be parsed to the reason."}},"description":"Error object for an unparsable request body, naming the malformed part."},"Common.Errors.Unauthorized":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["unauthorized"]},"title":{"type":"string","enum":["Unauthorized"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"Authentication credentials are missing or invalid."},"Common.Errors.InvalidArguments":{"type":"object","required":["errors"],"properties":{"errors":{"$ref":"#/components/schemas/Common.Errors.InvalidArgumentsObject"}},"description":"The request has missing or invalid arguments; `details` lists the messages per argument."},"Common.Errors.InvalidArgumentsObject":{"type":"object","required":["code","title","details"],"properties":{"code":{"type":"string","enum":["bad_request"]},"title":{"type":"string","enum":["Bad Request"]},"details":{"type":"object","unevaluatedProperties":{"type":"array","items":{"type":"string"}},"description":"Maps each invalid argument to the list of validation messages for that argument."}},"description":"Error object for invalid request arguments, adding per-argument messages."},"Common.Errors.TooManyRequests":{"type":"object","required":["errors"],"properties":{"errors":{"$ref":"#/components/schemas/Common.Errors.TooManyRequestsObject"}},"description":"The client has sent too many requests and is being rate limited."},"Common.Errors.TooManyRequestsObject":{"type":"object","required":["code","title","details"],"properties":{"code":{"type":"string","enum":["http_too_many_requests"]},"title":{"type":"string","pattern":"^Too Many Requests: retry after ","description":"`Too Many Requests: retry after`, then the HTTP date when a retry can start."},"details":{"type":"object","properties":{"retry_after":{"type":"integer","format":"int32","description":"Seconds to wait before the request is sent again. The `Retry-After` header has the same value."},"id":{"type":"string","description":"The property that reached a provider rate limit, on the ARI routes only."}},"required":["retry_after"]}},"description":"Error object for a rate limit, adding when to send the request again."},"Restrictions.RestrictionsUpdateRequest":{"type":"object","required":["values"],"properties":{"values":{"type":"array","items":{"$ref":"#/components/schemas/Restrictions.RestrictionUpdate"},"description":"The changes to apply, in order: a later change overrides an earlier one on the dates they share."}},"description":"Request body accepted when updating rates and restrictions."},"Restrictions.RestrictionUpdate":{"type":"object","required":["property_id","rate_plan_id"],"properties":{"property_id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}],"description":"UUID of the Property."},"rate_plan_id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}],"description":"UUID of the Rate Plan."},"date":{"type":"string","format":"date","description":"Single date the change applies to. Past dates are refused. Give either this or the `date_from`–`date_to` pair, never both."},"date_from":{"type":"string","format":"date","description":"Start of the applicable date range. Past dates are refused. Required together with `date_to` when `date` is not given."},"date_to":{"type":"string","format":"date","description":"End of the applicable date range. Past dates are refused. Required together with `date_from` when `date` is not given."},"days":{"type":"array","items":{"$ref":"#/components/schemas/Restrictions.Weekday"},"description":"Days of the week to affect within `date_from`–`date_to`; omitted means every day. Ignored when a single `date` is given."},"rate":{"allOf":[{"$ref":"#/components/schemas/Restrictions.RateValue"}],"description":"Rate for the date. Must be greater than 0 and within the Property's price\nlimits, and cannot be unset once given — `null` and `0` are both refused."},"rates":{"type":"array","items":{"$ref":"#/components/schemas/Restrictions.OccupancyRate"},"description":"Per-occupancy rates for a multi-occupancy Rate Plan, as an alternative to the single `rate`."},"min_stay_arrival":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.positiveInt"}],"description":"Minimum nights a stay arriving on the date must run. At least 1."},"min_stay_through":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.positiveInt"}],"description":"Minimum nights a stay covering the date must run. At least 1."},"min_stay":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.positiveInt"}],"description":"Shorthand for whichever minimum stay the Property uses: the value is written\nto `min_stay_arrival` or `min_stay_through` according to\n`property.settings.min_stay_type`. A Property whose `min_stay_type` is\n`both` refuses it — send the specific restriction instead."},"max_stay":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.nonNegativeInt"}],"description":"Maximum nights a stay may run; `0` means no maximum."},"max_sell":{"anyOf":[{"$ref":"#/components/schemas/Common.Scalars.nonNegativeInt"},{"type":"null"}],"description":"Maximum rooms that may be sold on the date. `null` removes the limit."},"closed_to_arrival":{"type":"boolean","description":"Whether a stay may not begin on the date. `0` and `1` are accepted as boolean representations."},"closed_to_departure":{"type":"boolean","description":"Whether a stay may not end on the date. `0` and `1` are accepted as boolean representations."},"stop_sell":{"type":"boolean","description":"Whether to close the date for sale. `0` and `1` are accepted as boolean\nrepresentations. A date whose availability or rate is 0 stays closed even\nwhen this is `false`."}},"description":"One rate/restrictions change. Targets either a single `date` or the range\n`date_from`–`date_to`, optionally narrowed to specific `days`."},"Restrictions.Weekday":{"type":"string","enum":["mo","tu","we","th","fr","sa","su"],"description":"A day-of-week name in two-letter format."},"Restrictions.RateValue":{"anyOf":[{"$ref":"#/components/schemas/Common.Scalars.decimalString"},{"$ref":"#/components/schemas/Common.Scalars.positiveInt"}],"description":"A rate value. Two forms are accepted: a decimal amount written as a string\n(`\"200.00\"`), or an integer in the minimum fraction of the currency (`20000`\nfor 200.00 USD). Both avoid floating-point issues, and a bare fractional\nnumber is refused. Must be greater than 0."},"Common.Scalars.decimalString":{"type":"string","description":"A decimal number as a string, e.g. `100.00`. Every monetary amount the API returns takes this form."},"Common.Scalars.positiveInt":{"type":"integer","format":"int32","minimum":1},"Restrictions.OccupancyRate":{"type":"object","required":["occupancy","rate"],"properties":{"occupancy":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.positiveInt"}],"description":"Occupancy the rate applies to."},"rate":{"$ref":"#/components/schemas/Restrictions.RateValue"}},"description":"A rate for a specific occupancy of a multi-occupancy Rate Plan."},"Common.Scalars.nonNegativeInt":{"type":"integer","format":"int32","minimum":0}}},"paths":{"/restrictions":{"post":{"operationId":"Ari_updateRestrictions","summary":"Update rates and restrictions","description":"Update rates and restrictions for specific Rate Plans and dates. Each change\nobject carries the Property and the Rate Plan it applies to, and targets\neither a single `date` or the range `date_from`–`date_to`, optionally\nnarrowed to specific `days`. Sending both a `date` and the pair is refused,\nand so is sending neither.\n\nChanges are applied asynchronously: `data` carries one background task\nreference per Property, and the new values are readable a moment later rather\nthan at once. See the Tasks resource to follow a task to completion.\n\nChange objects are applied in the order given, so a broad range can be set\nfirst and overridden by later, narrower objects.\n\nA change object that fails validation is rejected on its own and reported\nunder `meta.warnings` while the others are still applied — such a response is\nstill `200 OK`, and `data` is empty only when every change object was\nrejected. A range that starts in the past is clamped to today rather than\nrejected, and the clamp is reported as a warning of its own.\n\nRate limited to ten requests a minute per Property. Availability updates\ncarry a limit of ten a minute of their own, so twenty ARI updates a minute\nper Property in all; beyond that the request answers `429 Too Many\nRequests`, and nothing is applied until the limit expires.","parameters":[],"responses":{"200":{"description":"The request has succeeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Restrictions.UpdateAcknowledgement"}}}},"400":{"description":"The request body could not be parsed as JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.UnparsableRequest"}}}},"401":{"description":"Authentication credentials are missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.Unauthorized"}}}},"422":{"description":"The request has missing or invalid arguments; `details` lists the messages per argument.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.InvalidArguments"}}}},"429":{"description":"The client has sent too many requests and is being rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.TooManyRequests"}}}}},"tags":["ARI"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Restrictions.RestrictionsUpdateRequest"}}}}}}}}
```
