tencent cloud

CreatePostPaidInstance
Last updated: 2025-11-21 20:32:46
CreatePostPaidInstance
Last updated: 2025-11-21 20:32:46

1. API Description

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

This API is used to replace CreateInstancePost to create a pay-as-you-go instance. You can call this API via SDK or the TencentCloud API console to create a pay-as-you-go CKafka instance, which is an alternate option for making a purchase in the console.

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: CreatePostPaidInstance.
Version Yes String Common Params. The value used for this API: 2019-08-19.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
VpcId Yes String VPC Id, obtain through the API DescribeVpcs.
SubnetId Yes String Subnet Id. can be obtained through the DescribeSubnets api.
InstanceName No String Specifies the cluster instance name of ckafka, an arbitrary character with length not exceeding 128.
InstanceType No Integer Specifies the standard edition instance specification for the international site. currently only the international site standard edition uses the current field to distinguish specifications, while the domestic site standard edition distinguishes specifications by peak bandwidth. fill in 1 for all instances except the international site standard edition. for international site standard edition instances: [entry-level (general)] fill 1; [standard type (standard)] fill 2; [advanced] fill 3; [capacity type (capacity)] fill 4; [advanced type 1 (specialized-1)] fill 5; [advanced type 2 (specialized-2)] fill 6; [advanced type 3 (specialized-3)] fill 7; [advanced type 4 (specialized-4)] fill 8.
MsgRetentionTime No Integer The maximum instance log retention period in minutes by default. If this parameter is left empty, the default retention period is 1,440 minutes (1 day) to 30 days. If the message retention period of the topic is explicitly set, it will prevail.
ClusterId No Integer Cluster ID, which can be selected when you create an instance. You don’t need to pass in this parameter if the cluster where the instance resides is not specified.
KafkaVersion No String Instance version. currently supports "2.4.1", "2.4.2", "2.8.1", "3.2.3". default value "2.4.1". "2.4.1" and "2.4.2" belong to the same version. any one can be passed.
SpecificationsType No String Instance type. "standard": standard version. "profession": pro edition. (standard version is only supported on the international site. currently, the chinese site supports pro edition.).
DiskType No String Specifies the disk type for a pro edition instance. you do not need to fill it in for a standard edition instance. valid values: "CLOUD_SSD" for SSD CLOUD disk; "CLOUD_BASIC" for high-performance CLOUD block storage. default value: "CLOUD_BASIC".
BandWidth No Integer Specifies the peak bandwidth of the instance private network, with a default value of 40 MB/s. for standard version, input the peak bandwidth corresponding to the current instance specifications. note that if the instance created is a pro edition instance, parameter configuration such as peak bandwidth and number of partitions should meet the billing specification of the professional edition. view billing specifications through the following link: https://www.tencentcloud.comom/document/product/597/11745.?from_cn_redirect=1
DiskSize No Integer Instance disk size. default value is 500. step length is set to 100. should meet the billing specification of the current instance. can be accessed through the following link: https://www.tencentcloud.comom/document/product/597/122562.?from_cn_redirect=1
Partition No Integer Specifies the maximum number of partitions for the instance, which should meet the billing specification of the current instance. default value is 800 with a step length of 100. the billing specification can be viewed through the following link: https://www.tencentcloud.comom/document/product/597/122563.?from_cn_redirect=1
TopicNum No Integer Maximum number of topics for the instance should meet the billing specification of the current instance. default value is 800, step length is set to 100.
ZoneId No Integer Specifies the availability zone of the instance. when creating a multi-az instance, this parameter is the availability zone id of the subnet where the default access point is created. ZoneId and ZoneIds cannot be empty at the same time. obtain through the API DescribeCkafkaZone.
MultiZoneFlag No Boolean Whether the current instance is a multi-AZ instance
ZoneIds.N No Array of Integer Specifies the multi-az id list when the instance is a multi-az instance. note that the multi-az corresponding to parameter ZoneId must be included in this parameter array. ZoneId and ZoneIds cannot be empty at the same time. you can obtain this information through the DescribeCkafkaZone api.
InstanceNum No Integer The number of purchased instances. Default value: 1. This parameter is optional. If it is passed in, multiple instances will be created, with their names being instanceName plus different suffixes.
PublicNetworkMonthly No Integer Public network bandwidth in Mbps. The 3 Mbps of free bandwidth is not included here by default. For example, if you need 3 Mbps of public network bandwidth, pass in 0; if you need 6 Mbps, pass in 3. The value must be an integer multiple of 3.
Tags.N No Array of Tag Tag.
ElasticBandwidthSwitch No Integer Elastic bandwidth switch. valid values: 0 (disable, default), 1 (enable).

3. Output Parameters

Parameter Name Type Description
Result CreateInstancePostResp Returned result
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 Postpaid Pro Edition Instance

This example shows you how to create a post-payment for professional edition instance with a disk size of 200GB and peak bandwidth of 20MB/s.

Input Example

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

{
    "InstanceName": "test55",
    "VpcId": "vpc-rmcgxxxx",
    "SubnetId": "subnet-mnzcxxxx",
    "ZoneId": 450001,
    "InstanceType": 1,
    "KafkaVersion": "2.4.2",
    "SpecificationsType": "profession",
    "DiskSize": 200,
    "BandWidth": 20,
    "Partition": 400,
    "DiskType": "CLOUD_BASIC",
    "PublicNetworkMonthly": 0
}

Output Example

{
    "Response": {
        "RequestId": "323c3bbe-db79-48c3-9b76-63aacd65b169",
        "Result": {
            "Data": {
                "DealNameInstanceIdMapping": [
                    {
                        "DealName": "20230608002033899990000",
                        "InstanceIdList": [
                            "ckafka-mom5xxxx"
                        ]
                    }
                ],
                "DealNames": [
                    "2023060800203389990000"
                ],
                "FlowId": 0,
                "InstanceId": "ckafka-mom5xxxx"
            },
            "ReturnCode": "0",
            "ReturnMessage": "ok[apply ok]"
        }
    }
}

Example2 Creating Pay-As-You-Go Pro Edition Instances in Batches

This example shows you how to create three postpaid Pro Edition instances simultaneously.

Input Example

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

{
    "InstanceName": "test58",
    "VpcId": "vpc-rmcg5cpf",
    "SubnetId": "subnet-mnzcs7gk",
    "KafkaVersion": "2.4.2",
    "SpecificationsType": "profession",
    "BandWidth": 20,
    "DiskSize": 200,
    "Partition": 400,
    "TopicNum": 200,
    "ZoneId": 450001,
    "InstanceNum": 3,
    "PublicNetworkMonthly": 12
}

Output Example

{
    "Response": {
        "RequestId": "cda79237-6424-482a-b2d2-97d4853b33b4",
        "Result": {
            "Data": {
                "DealNameInstanceIdMapping": [
                    {
                        "DealName": "20230608002033915320000",
                        "InstanceIdList": [
                            "ckafka-bz4dxxxx",
                            "ckafka-o9gdxxxx",
                            "ckafka-aj5gxxxx"
                        ]
                    }
                ],
                "DealNames": [
                    "20230608002033915320000"
                ],
                "FlowId": 0,
                "InstanceId": "ckafka-bz4dxxxx"
            },
            "ReturnCode": "0",
            "ReturnMessage": "ok[apply ok]"
        }
    }
}

Example3 Creating a Postpaid Multi-AZ Pro Edition Instance

This example shows you how to create a triple-az Pro Edition instance.

Input Example

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

{
    "InstanceName": "test55",
    "VpcId": "vpc-rmcgxxxx",
    "SubnetId": "subnet-mnzcxxxx",
    "ZoneId": 450001,
    "InstanceType": 1,
    "KafkaVersion": "2.4.2",
    "SpecificationsType": "profession",
    "DiskSize": 200,
    "BandWidth": 20,
    "Partition": 400,
    "DiskType": "CLOUD_BASIC",
    "PublicNetworkMonthly": 0,
    "MultiZoneFlag": true,
    "ZoneIds": [
        450001,
        450002,
        450003
    ]
}

Output Example

{
    "Response": {
        "RequestId": "323c3bbe-db79-48c3-9b76-63aacd65b169",
        "Result": {
            "Data": {
                "DealNameInstanceIdMapping": [
                    {
                        "DealName": "20230608002033899990000",
                        "InstanceIdList": [
                            "ckafka-mom5xxxx"
                        ]
                    }
                ],
                "DealNames": [
                    "2023060800203389990000"
                ],
                "FlowId": 0,
                "InstanceId": "ckafka-mom5xxxx"
            },
            "ReturnCode": "0",
            "ReturnMessage": "ok[apply ok]"
        }
    }
}

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 Operation failed.
InternalError Internal error.
InvalidParameter Invalid parameter.
InvalidParameterValue.InstanceNotExist The instance does not exist.
InvalidParameterValue.NotAllowedEmpty The parameter is required.
InvalidParameterValue.RepetitionValue The parameter already exists.
InvalidParameterValue.SubnetIdInvalid Invalid subnet ID.
InvalidParameterValue.SubnetNotBelongToZone The subnet is not in the zone.
InvalidParameterValue.VpcIdInvalid Invalid VPC ID.
InvalidParameterValue.WrongAction The value of the Action parameter is incorrect.
InvalidParameterValue.ZoneNotSupport The zone is not supported.
ResourceUnavailable The resource is unavailable.
UnauthorizedOperation Unauthorized operation.
UnsupportedOperation.BatchDelInstanceLimit The batch instance deletion limit is reached.
UnsupportedOperation.OssReject Oss rejected the operation.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback