tencent cloud

Tencent OneID Identity Security

User Registration

Download
Focus Mode
Font Size
Last updated: 2026-08-26 15:38:13
AI-Translated

API Description

Register a new user. This API is applicable to scenarios where the application system develops its own registration feature. If your application uses the IDSEC authentication portal, see Register via the Authentication Portal.
Before calling this API, ensure that the application's registration process has been configured and enabled. The API input parameters must comply with the business rules configured in the registration process. For example, if the registration process is configured with a phone number as an authentication attribute and a user nickname as a required common attribute, the input parameters must include both the phone number and the user nickname attributes. If the registration process is not configured with a phone number as an authentication attribute, the input parameters must not include a phone number.
When the registration information contains a phone number or email address, you must first call the Send OTP Captcha API to send a Captcha to the user.
The password is an optional parameter. You can decide whether to require users to set a password based on your specific business needs.
If a user logs in only via SMS OTP, email OTP, or social authentication, a password does not need to be set.
If you need to support user login via username and password authentication, you should set a password.
If you need to set a password, ensure that the application's login flow is associated with a username-password authentication source. The API will validate the provided password against the password policy of that authentication source. Registration cannot be completed successfully if the password does not meet the policy requirements.
Note:
This API does not support setting user groups. Users who register successfully are assigned by default to the user group configured in the registration process.
This API does not handle the logic for automatic login and identity verification. Consequently, configurations related to automatic login and identity verification in the registration process do not take effect for this API.

Supported Application Types

Web applications.

Request Method

POST

Request path

/signup

Request Content-Type

application/json

Request Example

Register with a username and set a password.
POST /signup HTTP/1.1
Content-Type: application/json
Authorization: Basic VEVOQU5UX0NMSUVOVF9JRDpURU5BTlRfQ0xJRU5UX1NFQ1JFVA==
Host: sample.portal.tencentciam.com

{
"username" : "MOCK_USERNAME",
"password" : "MOCK_PASSWORD"
}
Register with an email address and a nickname, and set a password.
POST /signup HTTP/1.1
Content-Type: application/json
Authorization: Basic VEVOQU5UX0NMSUVOVF9JRDpURU5BTlRfQ0xJRU5UX1NFQ1JFVA==
Host: sample.portal.tencentciam.com

{
"email" : "MOCK_USERNAME@example.com",
"email_otp_token" : "MOCK_EMAIL_OTP_TOKEN",
"email_otp" : "MOCK_EMAIL_OTP",
"password" : "MOCK_PASSWORD",
"nickname" : "MOCK_NICKNAME"
}
Register with a phone number and do not set a password.
POST /signup HTTP/1.1
Content-Type: application/json
Authorization: Basic VEVOQU5UX0NMSUVOVF9JRDpURU5BTlRfQ0xJRU5UX1NFQ1JFVA==
Host: sample.portal.tencentciam.com

{
"phone_number" : "13612345678",
"phone_number_otp_token" : "MOCK_PHONE_NUMBER_OTP_TOKEN",
"phone_number_otp" : "MOCK_PHONE_NUMBER_OTP"
}

Request header

Term
Description
Authorization
The HTTP Basic authentication request header has the format Basic <credentials>. Here, Basic is a fixed string, and <credentials> is calculated as base64(url_encode(client_id) + ":" + url_encode(client_secret)). A single space separates Basic and <credentials>.

Request Body JSON Parameters

JSON Path
Data Type
Description
username
String
A username can contain English letters, digits, and underscores. It must start with a letter and have a maximum length of 32 characters.
password
String
User password. If a password is set, it must comply with the password policy of the username-password authentication source associated with the application.
phone_number
String
The user's mobile phone number must be an 11-digit number from one of the three major domestic carriers. When passing this parameter, you must also pass the two parameters phone_number_otp_token and phone_number_otp.
phone_number_otp_token
String
The otp_token returned by the server after the SMS verification code is sent successfully.
phone_number_otp
String
The OTP Captcha received by the user's mobile phone.
email
String
The user's email address. When passing this parameter, you must also pass the two parameters email_otp_token and email_otp.
email_otp_token
String
The otp_token returned by the server after the email verification code is sent successfully.
email_otp
String
The OTP Captcha received by the user's email.
name
String
User name.
nickname
String
User nickname.
zoneinfo
String
User time zone, such as Asia/Shanghai or Europe/Paris.
locale
String
User locale information, such as zh-CN or en-US.
Note:
The values of other parameters are user attribute identifiers. Attribute identifiers can be viewed on the attribute details page of the Attribute Customization page.

Successful Registration Response Example

HTTP/1.1 200 OK
Content-Type: application/json

{
"sub" : "MOCK_USER_ID"
}

Response Parameters

Field
Data Type
Description
sub
String
Unique user identifier.

Failed Registration Response Example

The application registration process is not enabled.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "misconfigured",
"error_description" : "Sign up flow of the application is not enabled."
}
The input parameters lack the authentication attributes or required common attributes configured for the registration process.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "invalid_request",
"error_description" : "Missing required sign-up attribute(s)."
}
The input parameters contain authentication attributes or common attributes that are not configured in the registration process.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "invalid_request",
"error_description" : "Unconfigured sign-up attribute(s) found."
}
The input parameters contain unknown attributes.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "invalid_request",
"error_description" : "Unknown attribute(s) found."
}
The username format is invalid.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "invalid_username"
}
The username already exists.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "duplicate_username"
}
The phone number format is invalid.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "malformed_phone_number"
}
The phone number already exists.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "duplicate_phone_number"
}
The phone_number_otp_token is incorrect or has expired, or the parameters used during registration do not match those used when sending the verification code (for example, the phone numbers are different).
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "bad_phone_number_otp_token"
}
The phone_number_otp is incorrect or has expired.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "bad_phone_number_otp"
}
The email address format is invalid.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "malformed_email"
}
The email address already exists.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "duplicate_email"
}
The email_otp_token is incorrect or has expired, or the parameters used during registration do not match those used when the verification code is sent (for example, the email addresses are different).
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "bad_email_otp_token"
}
The email_otp is incorrect or has expired.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "bad_email_otp"
}
A password is included in the input parameters, but the username-password authentication source is not associated with the application login flow.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "misconfigured",
"error_description" : "No password auth source is associated with the application."
}
The password does not meet the policy requirements.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "invalid_password"
}


Help and Support

Was this page helpful?

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

Feedback