---
schema_version: "1"
id: 7546ad6af07c683f959076fb985f43cd175458aef6787bb3639dbaf16264a844
title: Use Apex to Configure Self-Registration in Batches for High-Volume Sites
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/experience/264-0-0/exp_cloud_high_volume_self_reg_apex.md
canonical_url: https://help.salesforce.com/s/articleView?id=experience.exp_cloud_high_volume_self_reg_apex.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 31eb3d814b3a3addba3e276af0a5d4b7a3ffea1ccab3335184b9f5b06e57a3c9
description: Your Experience Cloud site can handle twice as many self-registration requests at a time when they’re collected into batches and processed asynchronously rather than one at a time. The accounts and contacts created are owned and managed by the community administrator. After a batch is processed successfully, users receive an email with their login instructions. Batch processing self-registration requests improves performance and keeps your site moving during heavy traffic spikes. Minimal coding is required when you use the Apex controller that manages your self-registration flow.
products:
  - Experiences
release: "264"
---
# Use Apex to Configure Self-Registration in Batches for High-Volume Sites

Your Experience Cloud site can handle twice as many self-registration requests at a time when they’re collected into batches and processed asynchronously rather than one at a time. The accounts and contacts created are owned and managed by the community administrator. After a batch is processed successfully, users receive an email with their login instructions. Batch processing self-registration requests improves performance and keeps your site moving during heavy traffic spikes. Minimal coding is required when you use the Apex controller that manages your self-registration flow.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Developer</strong>, <strong>Performance</strong>, and <strong>Unlimited</strong> Editions</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d106571e51">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d106571e51 ">To configure record and case creation in batches:</td>
            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d106571e51 ">Use Micro-Batching to Create Records</td>
          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d106571e51 ">To publish an Experience Cloud site: </td>
            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d106571e51 ">
              <ul>
                <li>Be a member of the site AND Create and Set Up Experiences</li>
                <li>OR</li>
                <li>Be a member of the site AND an experience admin or publisher in that site</li>
              </ul>
            </td>
          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d106571e51 ">To edit Apex classes:</td>
            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d106571e51 ">
              <ul>
                <li>Author Apex </li>
                <li>AND </li>
                <li>Customize Application</li>
              </ul>
            </td>
          </tr>
        </tbody>
      </table>

External Identity and Customer Community license users or Customer Community Plus and Partner Community license users with account role optimization (ARO) enabled can use micro-batching for self-registration. Users can’t be created for existing accounts using self-registration.

Keep the following in mind when using Apex controllers to manage your self-registration flow:

- For person account sites, leave the account and contact fields blank.
- For business account sites, you must add an account. Contacts are optional, but they require a null value.
- User sObjects are required for all sites.

1. From Setup, in the Quick Find box, enter Apex Classes, and then select **Apex Classes**.
2. Use this function for the Apex controller that manages your self-registration flow.
    
    ```
    
                String uuid = Network.createExternalUserAsync(user, contact, account);
              
    ```
    
    Contact is a (not yet saved) sObject.
    
    ```
    new Contact(
      		 FirstName = firstName,
      		 LastName = lastName,
        	Level__c = 'Primary');
    ```
    
    Account is an sObject.
    
    ```
    new Account(
      name = 'Account for '+ LastName,
      description = 'account description',
      active__c = 'Yes' );
    ```