---
title: "Attach a schedule to a rate plan with a cancellation policy."
method: PUT
path: "/rateplan/v0-nsfw/rate-plan-actions/{id}/schedules/{scheduleId}"
tags: ["RatePlanActions"]
---

# Attach a schedule to a rate plan with a cancellation policy.

`PUT /rateplan/v0-nsfw/rate-plan-actions/{id}/schedules/{scheduleId}`

## Request

- Base URL: `https://api.apaleo.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.apaleo.com/rateplan/v0-nsfw/rate-plan-actions/{id}/schedules/{scheduleId}`
- Auth: OAuth 2
  - Implicit: `https://identity.apaleo.com/connect/authorize`
  - Scopes: `setup.manage`, `admin`

Creates or updates the attachment for the given rate plan and schedule.
A repeat call with the same rate plan and schedule repoints the cancellation policy.
Rejected when the schedule range is entirely in the past (property-local today).
Overlapping policy-bearing schedules on the same rate plan are rejected.<br>You must have this scope: 'setup.manage'.<br>For fine-grained clients, you must have this permission: 'core.rate_plans.modify'.

## Path parameters

- `id` string, required
- `scheduleId` string, required

## Request body

- AttachRatePlanScheduleModel
  - `cancellationPolicyId` string, required: The id of the cancellation policy that applies to the rate plan over the schedule period

## Response `200`

Attachment successfully created or updated.

- RatePlanScheduleModel
  - `ratePlanId` string, required: The rate plan id
  - `scheduleId` string, required: The schedule id
  - `cancellationPolicy` EmbeddedCancellationPolicyModel, required
    - `id` string, required: The cancellation policy id
    - `code` string, nullable: The code for the cancellation policy that can be shown in reports and table views
    - `name` string, nullable: The name for the cancellation policy
    - `description` string, nullable: The description for the cancellation policy
    - `periodPriorToArrival` PeriodModel
      - `hours` integer, nullable: The number of hours within the period
      - `days` integer, nullable: The number of days within the period
      - `months` integer, nullable: The number of months within the period

## Other responses

- `400`: Bad request.
- `401`: You are unauthorized.
- `403`: Forbidden.
- `404`: The Request-URI could not be found.
- `415`: Unsupported media type.
- `422`: Validation errors in the request body or query params.
- `499`: Client closed request.
- `500`: An unexpected error occurred.
- `503`: The server is currently unavailable. Please try later.

---

[API](https://skmtc.dev/apaleo/apis/apaleo-rate-plan-api-not-safe-for-work.md) - [All operations](https://skmtc.dev/apaleo/apis/apaleo-rate-plan-api-not-safe-for-work/llms.txt) - [OpenAPI document](https://skmtc.dev/apaleo/apis/apaleo-rate-plan-api-not-safe-for-work/revisions/97dec9512a17?raw)
