tencent cloud

CreateRegisterCode
Last updated:2026-03-05 16:27:25
CreateRegisterCode
Last updated: 2026-03-05 16:27:25

1. API Description

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

This API is used to create a registration code.

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: CreateRegisterCode.
Version Yes String Common Params. The value used for this API: 2020-10-28.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
Description No String Describes the registration code. maximum length is 128 characters.
InstanceNamePrefix No String Prefix of the registered instance name. maximum length is 32 characters.
RegisterLimit No Integer Number of instances allowed by the registration code. default value is 10, minimum value is 1, maximum value is 10000.
EffectiveTime No Integer The validity time of the registration code is measured in hours. default value is 4.

-If the input value is less than or equal to 99999, the time is deemed valid in hours.
-If the input value is more than 99999, it is set to permanently valid.
IpAddressRange No String Restrict the registration code to register only from the public outbound ip described by IpAddressRange.

Empty by default, meaning no restrictions.

The value should be in standard IPv4 or CIDRv4 format, such as 192.168.1.1 or 192.168.0.0/16.

3. Output Parameters

Parameter Name Type Description
RegisterCodeId String Registration code ID.
RegisterCodeValue String Registration code value.
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 Registration Code with Parameter

Create a registration code with parameter.

Input Example

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

{
    "Description": "webserver",
    "InstanceNamePrefix": "webserver",
    "RegisterLimit": 10,
    "EffectiveTime": 4,
    "IpAddressRange": "192.168.10.1/10"
}

Output Example

{
    "Response": {
        "RegisterCodeId": "9b5rb72b-418f-4a81-b32e-f8bc80eef678",
        "RegisterCodeValue": "21e9b871e123427dbee18b0cf3e0d766f91d81a9902843b7b046d7b9ffb9d45a",
        "RequestId": "3f5bf8de-a51a-4ac0-8d95-ad56702cab1f"
    }
}

Example2 Creating a Registration Code - No Parameters

Create a registration code - no parameters.

Input Example

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

{}

Output Example

{
    "Response": {
        "RegisterCodeId": "9b5rb72b-418f-4a81-b32e-f8bc80eef678",
        "RegisterCodeValue": "21e9b871e123427dbee18b0cf3e0d766f91d81a9902843b7b046d7b9ffb9d45a",
        "RequestId": "2e8bf8de-a51a-4ac0-8d95-ad56702cab1f"
    }
}

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
InvalidParameter Invalid parameter.
InvalidParameterValue.TooLarge Parameter value is too large.
InvalidParameterValue.TooLong Length limit exceeded.
InvalidParameterValue.TooSmall Parameter value is too low.
ResourceNotFound.RoleNotFound The role does not exist.
UnauthorizedOperation.AssumeRoleUnauthorized Role play unauthorized.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback