---
title: "Schedule bucket refresh"
method: POST
path: "/v2/storage/buckets/{bucketId}/scheduled-tasks/refresh"
tags: ["Buckets"]
---

# Schedule bucket refresh

`POST /v2/storage/buckets/{bucketId}/scheduled-tasks/refresh`

## Request

- Base URL: `https://connection.keboola.com`
- URL: `https://connection.keboola.com/v2/storage/buckets/{bucketId}/scheduled-tasks/refresh`
- Auth: one of:
  - API key in header `X-StorageApi-Token`
  - API key in header `X-KBC-ManageApiToken`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/keboola/apis/keboola-storage-api/docs/v2/storage/buckets/:bucketId/scheduled-tasks/refresh/post.ts> (a function with typed inputs; its response is checked against the schema)

**EXPERIMENTAL**

Schedule external bucket refresh to a given time or repeating period defined by a cron expression. Available for external buckets in the default branch only.

## Path parameters

- `bucketId` string, required

## Request body

- ScheduleRefreshRequest
  - `cronExpression` string, required: Cron expression defining when the scheduled refresh runs.

## Response `201`

Scheduled task data.

- ScheduledTaskResponse: Scheduled task attached to a bucket.
  - `uuid` string, uuid, required: Identifier of the scheduled task.
  - `job` 'bucketRefresh', required: Job the task runs.
  - `relatedEntity` 'bucket', required: Type of the entity the task is attached to.
  - `relatedId` string, required: Identifier of the related entity (bucket ID).
  - `cronExpression` string, required: Cron expression of the schedule.
  - `createdAt` string, date-time, required: Creation timestamp of the task.

## Other responses

- `400`: The bucket is not an external bucket or is in a development branch (`storage.buckets.notSupported`), or the cron expression is invalid.
- `403`: The token does not have write access to the bucket (`accessDenied`).
- `404`: The bucket was not found (`storage.buckets.notFound`).

---

[API](https://skmtc.dev/keboola/apis/keboola-storage-api.md) - [All operations](https://skmtc.dev/keboola/apis/keboola-storage-api/llms.txt) - [OpenAPI document](https://skmtc.dev/keboola/apis/keboola-storage-api/revisions/34b5ceac0317?raw)
