Skip to main content

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 API
  • username: 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 API
  • username: 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 string

    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

    x-device-id string

    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.

Body

    email Email (string)

    Required when registering with email + verification_token

    phone_number Phone number (string)

    Required when registering with phone + verification_token, +86 cannot be omitted. For example: '+86 13000000000'

    username Username (string)

    Length 2-48 characters, supports English letters (case-sensitive), numbers, special characters (only -_.:+ @), must start with a letter or number, Chinese characters not supported

    verification_token Received verification code Token (string)

    Required when registering with phone + verification_token or email + verification_token

    password optional password (string)
    name optional nickname, optional (string)
    gender optional avatar, conforms to css encoding format (string)
    picture optional avatar, conforms to css encoding format (string)
    locale optional region, optional (If the region is empty, the backend will initialize the region based on various factors such as mobile number, IP address) Format: zh (string)
    provider_token If third-party information has been obtained before, then third-party information can be bound to this account (string)

    provider_token returned by /auth/v1/provider/token and other interfaces

Responses

A successful response.

Response Headers
    Schema
      token_type Access token type (string)

      Uniformly return Bearer

      access_token User's access token (string)

      Token used to access Cloud Development HTTP API, length within 4096 bits

      refresh_token User's refresh token (string)

      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

      expires_in int32

      Expiration time of access_token, in seconds

      scope Authorization scope (string)
      sub User's unique ID (string)
      groups string[]
    Loading...