Last updated: 2021-05-19 15:02:07

1. API Description

Domain name for API request:

This API is used to create a PostgreSQL for Serverless instance. If the creation succeeds, the instance ID will be returned.

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

Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example:

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 parameter. The value used for this API: CreateServerlessDBInstance.
Version Yes String Common parameter. The value used for this API: 2017-03-12.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
Zone Yes String Availability zone ID. Only ap-shanghai-2, ap-beijing-1, and ap-guangzhou-2 are supported during the beta test.
DBInstanceName Yes String Instance name. The value must be unique for the same account.
DBVersion Yes String Kernel version of a PostgreSQL instance. Currently, only 10.4 is supported.
DBCharset Yes String Database character set of a PostgreSQL instance. Currently, only UTF-8 is supported.
ProjectId No Integer Project ID.
VpcId No String VPC ID.
SubnetId No String VPC subnet ID.
TagList.N No Array of Tag Array of tags to be bound with the instance

3. Output Parameters

Parameter Name Type Description
DBInstanceId String Instance ID, such as "postgres-xxxxx". The value must be globally unique.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Creating a PostgreSQL for Serverless instance

This example shows you how to create a v10.4 PostgreSQL for Serverless instance named "serverlessdb-test", whose character set used on the server is UTF-8.

Input Example
&<Common request parameters>

Output Example

  "Response": {
    "RequestId": "08fdf411-5d39-44f2-8e1d-a58ee60b237d",
    "DBInstanceId": "postgres-xxxxx"

5. Developer Resources


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
AuthFailure.UnauthorizedOperation Authentication failed.
FailedOperation.CamSigAndAuthError Authentication failed. Please try again later. If the problem persists, please contact customer service.
FailedOperation.DatabaseAccessError Failed to access database management service. Please try again later. If the problem persists, please contact customer service.
FailedOperation.FailedOperationError Operation failed. Please try again later.
FailedOperation.FlowCreateError Failed to create a task. Please try again later. If the problem persists, please contact customer service.
FailedOperation.GetVpcInfoError Failed to query VPC information. Please try again later. If the problem persists, please contact customer service.
FailedOperation.QueryVpcFailed Failed to query VPC.
FlowError Failed to create the task.
InternalError Internal error.
InternalError.DBError Backend database execution error.
InternalError.FlowError Failed to create the flow.
InternalError.SystemError System error. When this error occurs, please contact customer service for assistance.
InvalidParameter Parameter error.
InvalidParameter.InstanceNameExist The instance name already exists.
InvalidParameter.ParameterCheckError Failed to check the parameter.
InvalidParameterValue.IllegalRegion Invalid Region parameter.
InvalidParameterValue.IllegalZone Invalid Zone parameter.
InvalidParameterValue.InstanceNameExist The account already exists.
InvalidParameterValue.InvalidAccountFormat Incorrect account format.
InvalidParameterValue.InvalidCharset Incorrect database character set. Currently, only UTF8 and LATIN1 are supported.
InvalidParameterValue.InvalidParameterValueError Incorrect parameter value
InvalidParameterValue.InvalidPasswordFormat Incorrect password format.
InvalidParameterValue.InvalidZoneIdError Invalid availability zone.
InvalidParameterValue.ParameterHandleError Failed to process the parameter. Please check if the parameter value is valid.
InvalidParameterValue.RegionNotSupported The current region is not supported.
InvalidParameterValue.StructParseFailed An error occurred while parsing parameters.
OperationDenied.CamDeniedError This operation cannot be performed.
OperationDenied.NotSupportZoneError Serverless is not supported in this availability zone.
OperationDenied.VersionNotSupportError Serverless is not supported on this version of PostgreSQL.
ResourceNotFound.InstanceNotFoundError The instance does not exist.
ResourceUnavailable.InvalidInstanceStatus Incorrect instance status.
UnauthorizedOperation.UserHasNoRealnameAuthentication Unverified user.