---
openapi: 3.0.3
info:
  title: Braze REST API – Update scheduled API-triggered Canvases
  description: 'Use this endpoint to update scheduled API-triggered Canvases that were created in the dashboard.

    '
  version: 1.0.0
  contact:
    name: Braze Support
    url: https://www.braze.com/docs/braze_support/
  license:
    name: Braze Documentation
    url: https://www.braze.com/docs/api/home/
servers:
  - url: https://rest.iad-01.braze.com
    description: US-01
  - url: https://rest.iad-02.braze.com
    description: US-02
  - url: https://rest.iad-03.braze.com
    description: US-03
  - url: https://rest.iad-04.braze.com
    description: US-04
  - url: https://rest.iad-05.braze.com
    description: US-05
  - url: https://rest.iad-06.braze.com
    description: US-06
  - url: https://rest.iad-07.braze.com
    description: US-07
  - url: https://rest.iad-08.braze.com
    description: US-08
  - url: https://rest.us-10.braze.com
    description: US-10
  - url: https://rest.fra-01.braze.eu
    description: EU-01
  - url: https://rest.fra-02.braze.eu
    description: EU-02
  - url: https://rest.au-01.braze.com
    description: AU-01
  - url: https://rest.id-01.braze.com
    description: ID-01
  - url: https://rest.jp-01.braze.com
    description: JP-01
  - url: https://rest.kr-01.braze.com
    description: KR-01
security:
- BearerAuth: []
paths:
  "/canvas/trigger/schedule/update":
    post:
      summary: Update scheduled API-triggered Canvases
      description: |
        ## Prerequisites

        To use this endpoint, you'll need an [API key]({{site.baseurl}}/api/basics#rest-api-key/) with the `canvas.trigger.schedule.update` permission.

        ## Rate limit

        We apply the default Braze rate limit of 250,000 requests per hour to this endpoint, as documented in [API rate limits]({{site.baseurl}}/api/api_limits/).

        ## Request body

        The following headers and request body are required for this endpoint.

        ```
        Content-Type: application/json
        Authorization: Bearer YOUR_REST_API_KEY
        ```

        ```json
        {
          "canvas_id": (required, string) see Canvas identifier,
          "schedule_id": (required, string) the `schedule_id` to update (obtained from the response to create schedule),
          "schedule": {
            // required, see create schedule documentation
          }
        }
        ```

        ## Request parameters

        The following table lists the request parameters for this endpoint.

        | Parameter | Required | Data Type | Description |
        | --------- | ---------| --------- | ----------- |
        |`canvas_id`|Required|String| See [Canvas identifier]({{site.baseurl}}/api/identifier_types/). |
        | `schedule_id` | Optional | String | The `schedule_id` to update (obtained from the response to create schedule). |
        |`schedule` | Required | Object | See [schedule object]({{site.baseurl}}/api/objects_filters/schedule_object/). |

        ## Example request

        The following sample request shows an example of how to update a scheduled API-triggered Canvas.

        ```
        curl --location --request POST 'https://rest.iad-01.braze.com/canvas/trigger/schedule/update' \
        --header 'Content-Type: application/json' \
        --header 'Authorization: Bearer YOUR_REST_API_KEY' \
        --data-raw '{
          "canvas_id": "canvas_identifier",
          "schedule_id": "schedule_identifier",
          "schedule": {
            "time": "2017-05-24T21:30:00Z",
            "in_local_time": true
          }
        }'
        ```

        ## Response

        The following sample response shows an example of the response returned when you update a scheduled API-triggered Canvas.

        ```json
        {
          "message": "success"
        }
        ```

        If the Canvas is archived or paused, the response also includes a `notice` field. If the Canvas is archived, you see this `notice` message: "The Canvas is archived. Unarchive the Canvas to ensure trigger requests will take effect." If the Canvas is paused, you see this `notice` message: "The Canvas is paused. Resume the Canvas to ensure trigger requests will take effect."

        ## Response status codes

        The following table lists the responses for this endpoint, the error message you may receive, and how to resolve it.

        | Status code | Meaning | Error message | How to resolve |
        | --- | --- | --- | --- |
        | `201 Created` | The request was accepted and the scheduled Canvas was updated. | `success` | No action needed. |
        | `400 Bad Request` | The `canvas_id` is missing or isn't a string. | `canvas_id must be a string of the Canvas api identifier` | Pass a valid `canvas_id` string. Find it with the [Export Canvas list endpoint]({{site.baseurl}}/api/endpoints/export/canvas/get_canvases/). |
        | `400 Bad Request` | The `schedule_id` is missing or isn't a string. | `'schedule_id' must be a valid identifier of a schedule object` | Pass the `schedule_id` returned when you created the schedule. |
        | `400 Bad Request` | The request doesn't include a `schedule` object to update. | `Schedule updates must update the 'schedule'` | Include a `schedule` object in the request. |
        | `400 Bad Request` | The `time` is missing, malformed, or in the past. | `'time' must be an ISO 8601 time in UTC that has not passed` | Pass `schedule.time` as a future ISO 8601 UTC datetime. |
        | `400 Bad Request` | For local or optimal delivery, the `time` is in the past. | `'time' must be an ISO 8601 time in UTC that is not in the past` | Pass a future `schedule.time` for local or optimal delivery. |
        | `400 Bad Request` | Both `in_local_time` and `at_optimal_time` are `true`. | `only one of 'in_local_time' and 'at_optimal_time' can be true` | Set only one of `in_local_time` or `at_optimal_time`. |
        | `400 Bad Request` | `segment_id` isn't supported on this endpoint. | `'segment_id' is not supported on this endpoint` | Remove `segment_id` from the request. |
        | `401 Unauthorized` | The REST API key is missing, malformed, or sent to the wrong REST endpoint. | `Invalid API key` | Send the key as `Authorization: Bearer YOUR_REST_API_KEY` to the correct [REST endpoint]({{site.baseurl}}/api/basics/#endpoints). For more causes, see [Errors and responses]({{site.baseurl}}/api/errors/#fatal-errors). |
        | `403 Access Denied` | The REST API key doesn't have the required permission. | `Access Denied` | Use a REST API key that has the `canvas.trigger.schedule.update` permission. |
        | `429 Rate Limited` | You exceeded the rate limit for this endpoint. | `Over rate limit` | Slow your request rate and retry with exponential backoff. See [API rate limits]({{site.baseurl}}/api/api_limits/). |
        | `5XX Internal Server Error` | An unexpected error occurred on the Braze server. | `Internal Server Error` | Retry with exponential backoff. If the error persists, contact [Support]({{site.baseurl}}/braze_support/). |
      operationId: post_canvas_trigger_schedule_update_post_update_scheduled_triggered_canvases
      tags:
      - Messaging
      responses:
        '201':
          description: The request was accepted and the scheduled Canvas was updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateScheduledTriggeredCanvasesResponse'
        '400':
          description: |-
            Bad Request. Causes include:

            - `canvas_id must be a string of the Canvas api identifier` — The `canvas_id` is missing or isn't a string.
            - `'schedule_id' must be a valid identifier of a schedule object` — The `schedule_id` is missing or isn't a string.
            - `Schedule updates must update the 'schedule'` — The request doesn't include a `schedule` object to update.
            - `'time' must be an ISO 8601 time in UTC that has not passed` — The `time` is missing, malformed, or in the past.
            - `'time' must be an ISO 8601 time in UTC that is not in the past` — For local or optimal delivery, the `time` is in the past.
            - `only one of 'in_local_time' and 'at_optimal_time' can be true` — Both `in_local_time` and `at_optimal_time` are `true`.
            - `'segment_id' is not supported on this endpoint` — `segment_id` isn't supported on this endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: The REST API key is missing, malformed, or sent to the wrong REST endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: The REST API key doesn't have the required permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: You exceeded the rate limit for this endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '5XX':
          description: An unexpected error occurred on the Braze server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                canvas_id:
                  type: string
                  description: See Canvas identifier.
                schedule_id:
                  type: string
                  description: The `schedule_id` to update (obtained from the response to create schedule).
                schedule:
                  type: object
                  description: See schedule object.
              required:
              - canvas_id
              - schedule
            examples:
              example_request:
                summary: Example request
                value:
                  canvas_id: canvas_identifier
                  schedule_id: schedule_identifier
                  schedule:
                    time: '2017-05-24T21:30:00Z'
                    in_local_time: true
components:
  schemas:
    UpdateScheduledTriggeredCanvasesResponse:
      type: object
      properties:
        message:
          type: string
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: The error message describing why the request failed.
        errors:
          type: array
          description: Non-fatal errors encountered while processing the request. Data unaffected by these errors is still processed.
          items:
            type: object
            properties:
              type:
                type: string
                description: The error type.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: REST API key
