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": "your_verification_token",
"username": "user123",
"password": "Password@123"
}
Phone Number + Verification Code Registration Response Example
{
"token_type": "Bearer",
"access_token": "your_access_token",
"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": "your_verification_token",
"username": "user456",
"password": "DemoPass123!@#"
}
Email + Verification Code Registration Response Example
{
"token_type": "Bearer",
"access_token": "your_access_token",
"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": "your_provider_token",
"username": "github_user",
"password": "SamplePass456$%^"
}
Third-party Authorization Registration Response Example
{
"token_type": "Bearer",
"access_token": "your_access_token",
"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": "your_access_token",
"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"
}