Register New User
POST/auth/v1/signup
Register new user, supports the following three registration scenarios:
1. Phone Number + Verification Code Registration
Input Requirements:
phone_number: Phone number (required, format: "+86 13000000000")verification_token: Verification code token (required), obtained from Verify SMS/Email Verification Code APIusername: Username (optional, 2-48 characters)password: Password (optional)
Output:
- Returns standard token response (access_token, refresh_token, etc.)
Phone Number + Verification Code Registration Request Example
{
"phone_number": "+86 13000000000",
"verification_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJwaG9uZSI6Iis4NiAxMzAwMDAwMDAwMCIsImV4cCI6MTczNDY4MjM1NywicHJvamVjdCI6Imxvd2NvZGUiLCJ0eXBlIjoidmVyaWZpY2F0aW9uIn0",
"username": "user123",
"password": "Password@123"
}
Phone Number + Verification Code Registration Response Example
{
"token_type": "Bearer",
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2FwaS5leGFtcGxlLmNvbSIsInN1YiI6Ijk4NzY1NDMyMTAxMjM0NTY3ODkiLCJhdWQiOiJkZW1vLWFwcC0yZjhhOWMzZTFiNGQiLCJleHAiOjE3MzQ2NzU4ODksImlhdCI6MTczNDY2ODY4OSwic2NvcGUiOiJ1c2VyIn0.dGhpc19pc19hX2Zha2Vfc2lnbmF0dXJlX2Zvcl9leGFtcGxlX3B1cnBvc2VzX29ubHlfZG9fbm90X3VzZV9pbl9wcm9kdWN0aW9uX2Vudmlyb25tZW50X3RoaXNfaXNfbm90X3JlYWxfdG9rZW5fZGF0YQ",
"refresh_token": "m.xY9zA1bC2dE3fG4hI5jK6lM7nO8pQ9rS0tU1vW2xY3zA4bC5dE6fG7hI8jK9lM0nO1pQ2rS3tU4vW5",
"expires_in": 7200,
"sub": "9876543210123456789"
}
2. Email + Verification Code Registration
Input Requirements:
email: Email address (required)verification_token: Verification code token (required), obtained from Verify SMS/Email Verification Code APIusername: Username (optional, 5-24 characters)password: Password (optional)
Output:
- Returns standard token response (access_token, refresh_token, etc.)
Email + Verification Code Registration Request Example
{
"email": "user@example",
"verification_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InVzZXJAZXhhbXBsZS5jb20iLCJleHAiOjE3MzQ2ODIzNTcsInByb2plY3QiOiJsb3djb2RlIiwidHlwZSI6InZlcmlmaWNhdGlvbiJ9",
"username": "user456",
"password": "DemoPass123!@#"
}
Email + Verification Code Registration Response Example
{
"token_type": "Bearer",
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2FwaS5leGFtcGxlLmNvbSIsInN1YiI6Ijk4NzY1NDMyMTAxMjM0NTY3ODkiLCJhdWQiOiJkZW1vLWFwcC0yZjhhOWMzZTFiNGQiLCJleHAiOjE3MzQ2NzU4ODksImlhdCI6MTczNDY2ODY4OSwic2NvcGUiOiJ1c2VyIn0.dGhpc19pc19hX2Zha2Vfc2lnbmF0dXJlX2Zvcl9leGFtcGxlX3B1cnBvc2VzX29ubHlfZG9fbm90X3VzZV9pbl9wcm9kdWN0aW9uX2Vudmlyb25tZW50X3RoaXNfaXNfbm90X3JlYWxfdG9rZW5fZGF0YQ",
"refresh_token": "m.xY9zA1bC2dE3fG4hI5jK6lM7nO8pQ9rS0tU1vW2xY3zA4bC5dE6fG7hI8jK9lM0nO1pQ2rS3tU4vW5",
"expires_in": 7200,
"sub": "9876543210123456789"
}
3. Third-party Authorization Registration
Input Requirements:
provider_token: Third-party identity source token (required)username: Username (optional, 5-24 characters)password: Password (optional)
Output:
- Returns standard token response (access_token, refresh_token, etc.)
Third-party Authorization Registration Request Example
{
"provider_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJwcm92aWRlciI6ImdpdGh1YiIsInN1YiI6IjEyMzQ1Njc4OTAiLCJleHAiOjE3MzQ2ODIzNTd9.bVJ0cE1xTnBWc0R5QmhKa0xmR3pYY1ZiTm1Bc1FkRmdIaktsTXBPclN0VXZXeElaQWJDZERlRmZHaEhpSmpLa0xs",
"username": "github_user",
"password": "SamplePass456$%^"
}
Third-party Authorization Registration Response Example
{
"token_type": "Bearer",
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2FwaS5leGFtcGxlLmNvbSIsInN1YiI6Ijk4NzY1NDMyMTAxMjM0NTY3ODkiLCJhdWQiOiJkZW1vLWFwcC0yZjhhOWMzZTFiNGQiLCJleHAiOjE3MzQ2NzU4ODksImlhdCI6MTczNDY2ODY4OSwic2NvcGUiOiJ1c2VyIn0.dGhpc19pc19hX2Zha2Vfc2lnbmF0dXJlX2Zvcl9leGFtcGxlX3B1cnBvc2VzX29ubHlfZG9fbm90X3VzZV9pbl9wcm9kdWN0aW9uX2Vudmlyb25tZW50X3RoaXNfaXNfbm90X3JlYWxfdG9rZW5fZGF0YQ",
"refresh_token": "m.xY9zA1bC2dE3fG4hI5jK6lM7nO8pQ9rS0tU1vW2xY3zA4bC5dE6fG7hI8jK9lM0nO1pQ2rS3tU4vW5",
"expires_in": 7200,
"sub": "9876543210123456789"
}
General Notes:
- Can set username and password during registration
- For verification code registration, need to obtain verification_token from Verify SMS/Email Verification Code API
- Registration with only username and password is not supported. For username/password user creation, please go to cloud backend
Request
Query Parameters
Client ID corresponding to the application, can be obtained from Cloud Development Platform -> Identity Authentication -> Development Settings. Defaults to environment ID, can be omitted
Header Parameters
Device ID, the ID of the current logged-in device. The client should generate it randomly and cache it on the client. This parameter is related to the number of logged-in accounts.
- application/json
Body
Required when registering with email + verification_token
Required when registering with phone + verification_token, +86 cannot be omitted. For example: '+86 13000000000'
Length 2-48 characters, supports English letters (case-sensitive), numbers, special characters (only -_.:+ @), must start with a letter or number, Chinese characters not supported
Required when registering with phone + verification_token or email + verification_token
provider_token returned by /auth/v1/provider/token and other interfaces
Responses
- 200
- 400
A successful response.
Response Headers
- application/json
- Schema
- Example (from schema)
- Example
Schema
Uniformly return Bearer
Token used to access Cloud Development HTTP API, length within 4096 bits
access_token can be refreshed to get a new access_token when it expires through refresh_token, expiration time defaults to 31 days. Length within 128 bits
Expiration time of access_token, in seconds
{
"token_type": "string",
"access_token": "string",
"refresh_token": "string",
"expires_in": 0,
"scope": "string",
"sub": "string",
"groups": [
"string"
]
}
{
"token_type": "Bearer",
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwOi8vbG93Y29kZS01ZzlhYzIwdTJhMjdkYTQ2LmFwLXNoYW5naGFpLnRjYi1hcGkudGVuY2VudGNsb3VkYXBpLmNvbSIsInN1YiI6IjE4NzAwMTQxNjE5NTk2MjA2MDgiLCJhdWQiOiJBT0o4eUFBQnpOc01YZjBJY0tjIiwiZXhwIjoxNzM0Njg4Mjk0LCJpYXQiOjE3MzQ2ODEwOTQsImF0X2hhc2giOiJyLlBtazZMemNpUTJ5QktESWFONEFreGciLCJzY29wZSI6InVzZXIgc3NvIiwicHJvamVjdF9pZCI6Imxvd2NvZGUtNWc5YWMyMHUyYTI3ZGE0NiIsIm1ldGEiOnsid3hPcGVuSWQiOiIiLCJ3eFVuaW9uSWQiOiIifSwidXNlcl90eXBlIjoiIn0.lbSQ06kh5pe6PqRbGfm6tHZzj9stKDwYxpWqnjwALDx-DYqU-nOAPWQxXowEZGd-HwwsDbEi_eZfpxds4UO5rdmueMXCUxgMk9wf0fNRZe9KzOgdtmSq0H92pPjKAxskmZvzTLe4ftsAZmWLb-wUjATrk1RsGR4i9INeT9Ydprt-6vOdiJJQkLBDTBuiwdOQxge3md2rcnoM0L0VHwdCAIk1IfNZ4Dih9D77B34HPxdQdeAbppnS2SMFtjGAuvcwUVya3Lp8UFTNMrWO7S3ue4nOd35ns4tUc9cwB2LijNaBj4kYBHIjU8GFZCLuuSfGVj7EFnE2YFvlAU64aqvlYQ",
"refresh_token": "m.xY9zA1bC2dE3fG4hI5jK6lM7nO8pQ9rS0tU1vW2xY3zA4bC5dE6fG7hI8jK9lM0nO1pQ2rS3tU4vW5",
"expires_in": 7200,
"sub": "1870014161959620608"
}
- you can not signup just by username and password, registration with only username and password is not allowed, user identity needs to be verified
- phone number login is disabled by admin, phone number login is not enabled, needs to be enabled on the Cloud Development Platform
- you can not set phone number and email at same time, phone number and email cannot be set simultaneously
Response Headers
- application/json
- Schema
- Example (from schema)
- Example
Schema
{
"error": "string",
"error_code": 0,
"error_description": "string"
}
{
"error": "unimplemented",
"error_code": 12,
"error_description": "you can not signup just by username and password"
}