social / pragma.account / AccountService / createAccountPartnerV1 /

createAccountPartnerV1 #

suspend fun createAccountPartnerV1(session: PartnerSession, request: AccountRpc.CreateAccountPartnerV1Request): AccountRpc.CreateAccountPartnerV1Response

Creates a Pragma Account and returns the created SocialIdentity.

Unlike AccountService.authenticateOrCreateV2, if a Pragma account is already associated with the IdentityProvider the call will throw AccountRpc.AccountAlreadyExistsApplicationError.

Warning: This endpoint bypasses the provider token validation and is intended for trusted partners only.

References

Plugins

  • AccountPlugin.onAccountCreate - Called before an account is created for the first time
  • AccountPlugin.onAccountCreated - Called after an account is created for the first time

PragmaApplicationErrors

  • pragma.IdProviderNotFoundApplicationError when authenticating with an unknown or unconfigured IdentityProvider.
  • AccountRpc.RanOutOfDiscriminatorsApplicationError when display name has been reused too many times
  • AccountRpc.AccountAlreadyExistsApplicationError when Pragma account is already associated with the IdentityProvider

PragmaResultErrors

  • PragmaError.Database_Error when failing to create a social identity