Skip to main content

Register New User

POST 

/auth/v1/signup

Register New User, Applicable Scenarios:

  • Register a new user with mobile number + verification code
  • Register a new user with email + verification code
  • Register a new user by obtaining the provider_token after third-party authorization.

You can set both the username and password during registration. Registering with only a username and password is not supported. To create a user with username and password, please go to the cloud console to create one.

Request

Query Parameters

    client_id string

    The client ID corresponding to the application, which can be obtained from Cloud Development Platform --> Authentication --> Development Settings. Defaults to the environment ID and can be omitted.

Header Parameters

    x-device-id string

    The device ID of the currently logged-in device. The client should randomly generate and cache this value. 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 number + verification_token. The '+86' prefix cannot be omitted. Example: "+86 13000000000"

    username Username (string)

    Length: 5-24 characters. Supports Chinese and English letters, digits, and special characters (only _ and -). Chinese characters are not supported.

    verification_token Verification Token Received (string)

    Required when registering with phone number + verification_token or email + verification_token

    password optional password (string)
    name optional nickname (optional) (string)
    gender optional avatar, in CSS-encoded format (string)
    picture optional avatar, in CSS-encoded format (string)
    locale optional region (optional) (If the region is empty, the backend will determine the initial region based on factors such as phone number and IP address.) Format: zh (string)
    provider_token If third-party information has been obtained previously, it can be bound to this account (string)

    The provider_token returned by interfaces such as /auth/v1/provider/token

Responses

A successful response.

Response Headers
    Schema
      token_type Access Token Type (string)

      Always returns Bearer

      access_token User's Access Token (string)

      Token used to access the Cloud Development HTTP API, with a maximum length of 4096 characters

      refresh_token User's Refresh Token (string)

      When the access_token expires, it can be refreshed using the refresh_token to obtain a new access_token. The default expiration time is 31 days. Maximum length is 128 characters

      expires_in int32

      Expiration time of the access_token in seconds

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