createAccount abstract method

Future<MastodonResponse<Token>> createAccount({
  1. required String username,
  2. required String email,
  3. required String password,
  4. required bool agreement,
  5. required Locale locale,
  6. String? reason,
})

Creates a user and account records. Returns an account access token for the app that initiated the request. The app should save this token for later, and should wait for the user to confirm their account by clicking a link in their email inbox.

Parameters

  • username: The desired username for the account.

  • email: The email address to be used for login.

  • password: The password to be used for login.

  • agreement: Whether the user agrees to the local rules, terms, and policies. These should be presented to the user in order to allow them to consent before setting this parameter to TRUE.

  • locale: The language of the confirmation email that will be sent.

  • reason: If registrations require manual approval, this text will be reviewed by moderators.

Endpoint Url

  • POST /api/v1/accounts HTTP/1.1

Authentication Methods

  • OAuth 2.0

Required Scopes

  • write:accounts

Reference

Implementation

Future<MastodonResponse<Token>> createAccount({
  required String username,
  required String email,
  required String password,
  required bool agreement,
  required Locale locale,
  String? reason,
});