Skip to main content
GET
/
organizations
/
{organization}
/
databases
/
{database}
/
backup-policies
/
{id}
Get a backup policy
curl --request GET \
  --url https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/backup-policies/{id} \
  --header 'Authorization: Bearer <token>'
{
  "id": "<string>",
  "display_name": "<string>",
  "name": "<string>",
  "target": "production",
  "retention_value": 123,
  "retention_unit": "<string>",
  "frequency_value": 123,
  "frequency_unit": "<string>",
  "schedule_time": "<string>",
  "schedule_day": 123,
  "schedule_week": 123,
  "created_at": "<string>",
  "updated_at": "<string>",
  "last_ran_at": "<string>",
  "next_run_at": "<string>",
  "required": true
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

id
string
required

The ID of the backup policy

organization
string
required

Organization name slug from list_organizations. Example: acme.

database
string
required

Database name slug from list_databases. Example: app-db.

Response

Returns a backup policy

id
string
required

The ID of the backup policy

display_name
string
required

The display name of the backup policy

name
string
required

The name of the backup policy

target
enum<string>
required

Whether the policy is for production or development branches

Available options:
production,
development
retention_value
integer
required

A number value for the retention period of the backup policy

retention_unit
string
required

The unit for the retention period of the backup policy

frequency_value
integer
required

A number value for the frequency of the backup policy

frequency_unit
string
required

The unit for the frequency of the backup policy

schedule_time
string
required

The time of day that the backup is scheduled, in HH:MM format

schedule_day
integer
required

Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday

schedule_week
integer
required

Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week

created_at
string
required

When the backup policy was created

updated_at
string
required

When the backup policy was last updated

last_ran_at
string
required

When the backup was last run

next_run_at
string
required

When the backup will next run

required
boolean
required

Whether the policy is a required system backup