tencent cloud

APIs

CreateBackupPlan

Focus Mode
Font Size
Last updated: 2026-04-13 13:05:26

1. API Description

Domain name for API request: postgres.intl.tencentcloudapi.com.

This API is used to create a backup policy.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: CreateBackupPlan.
Version Yes String Common Params. The value used for this API: 2017-03-12.
Region Yes String Common Params. For more information, please see the list of regions supported by the product. This API only supports: ap-bangkok, ap-beijing, ap-chengdu, ap-chongqing, ap-guangzhou, ap-hongkong, ap-jakarta, ap-nanjing, ap-seoul, ap-shanghai, ap-shanghai-fsi, ap-shenzhen-fsi, ap-singapore, ap-tokyo, eu-frankfurt, na-ashburn, na-siliconvalley, sa-saopaulo.
DBInstanceId Yes String Instance ID. obtain through the api DescribeDBInstances.
PlanName Yes String Specifies the name of the backup plan.
BackupPeriodType Yes String Specifies the schedule type of the backup created. currently only support month.
BackupPeriod.N Yes Array of String Backup date. example: enable backup on the 2nd of every month.
MinBackupStartTime No String Specifies the backup start time. if not passed, it follows the default backup plan.
MaxBackupStartTime No String Backup end time. follows the default plan if not specified.
BaseBackupRetentionPeriod No Integer Specifies the data backup retention duration in days. value range: [0,30000).
BackupPeriodType defaults to 7 when set to week and 31 when set to month.

3. Output Parameters

Parameter Name Type Description
PlanId String Backup policy ID.
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Creating a Monthly Backup Policy

This example shows you how to create a backup policy named plan1 that performs data backup from 1 AM to 2 AM on the 1st and 2nd of every month, with data files retained for 40 days.

Input Example

POST / HTTP/1.1
Host: postgres.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateBackupPlan
<Common request parameters>

{
    "PlanName": "plan1",
    "BackupPeriodType": "month",
    "DBInstanceId": "postgres-kwk4tq23",
    "MinBackupStartTime": "01:00:00",
    "MaxBackupStartTime": "02:00:00",
    "BackupPeriod": [
        "1",
        "2"
    ],
    "BaseBackupRetentionPeriod": 40
}

Output Example

{
    "Response": {
        "RequestId": "8a61e500-aa33-454c-9ec2-da2a368c39ab",
        "PlanId": "dfea3bb4-8ca7-5e79-aefb-9d231f2b66b6"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation.DatabaseAffectedError Data operation failed. Please contact customer service.
FailedOperation.FailedOperationError Operation failed. Please try again later.
FailedOperation.PreCheckError Pre-check failed
InvalidParameter.ParameterCheckError Failed to check the parameter.
InvalidParameterValue.InvalidParameterValueError Incorrect parameter value
InvalidParameterValue.ParameterLengthLimitError The length of parameter exceeds the limit.
OperationDenied.InstanceStatusLimitOpError This operation cannot be performed on an instance in this status.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback