---
schema_version: "1"
id: ec91ab50d9e8fb897ddc5814ed6812c950ef62f8dd573b8d6017616a663e2e62
title: Get Default Values to Clone a Record—Lightweight
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/uiapi/ui_api_resources_record_defaults_template_clone.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_record_defaults_template_clone.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: f3f2544eab293ee79547640c6de88047658c3052a770a9e257e72fc6f3adf557
description: Get the default values for fields for cloning a record. You must specify the fields you want returned. This resource doesn’t use or return layout information. After getting the default values, make a request to POST /ui-api/records to create the record.
---
# Get Default Values to Clone a Record—Lightweight

Get the default values for fields for cloning a record. You must specify the fields you want returned. This resource doesn’t use or return layout information. After getting the default values, make a request to POST /ui-api/records to create the record.

The response contains the default field values for the specified fields, optionally of the specified recordTypeId.

The response also contains object metadata for fields specified in the request. For example, this request clones an Account record. It returns object metadata for Account and User, because the OwnerId field on the Account object contains a reference to the User object.

GET /ui-api/record-defaults/template/clone/001d000000AtfRIAAZ?optionalFields=Account.OwnerId

Resource

/ui-api/record-defaults/template/clone/{recordId}

![Note](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/images/icon_note.png)

#### Note

To get default values based on a layout, use the [/ui-api/record-defaults/clone/{recordId}](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_record_defaults_clone.htm "Get the default layout information, object information, and data for cloning a record. After getting the default values, make a request to POST /ui-api/records to create the record.") resource.

Available Version

49.0

HTTP Method

GET

Request Parameters

<table class="featureTable sort_table" summary="">





              <thead class="thead sorted" align="left">
                <tr>
                  <th class="featureTableHeader vertical-align-top " id="d70079e129">Parameter Name</th>

                  <th class="featureTableHeader vertical-align-top " id="d70079e132">Type</th>

                  <th class="featureTableHeader vertical-align-top " id="d70079e135">Description</th>

                  <th class="featureTableHeader vertical-align-top " id="d70079e138">Required or Optional</th>

                  <th class="featureTableHeader vertical-align-top " id="d70079e141">Available Version</th>

                </tr>

              </thead>

              <tbody class="tbody">
                <tr>
                  <td class="entry" headers="d70079e129" data-title="Parameter Name"><samp class="codeph nolang">optionalFields</samp></td>

                  <td class="entry" headers="d70079e132" data-title="Type">String[]</td>

                  <td class="entry" headers="d70079e135" data-title="Description">A collection of optional field names. If a field is accessible to the
                    context user, it’s included in the response. If a field isn’t accessible to
                    the context user, it isn’t included in the response, but it doesn’t cause an
                    error. <p class="p">Specify names in the format <samp class="codeph nolang"><var class="keyword varname">ObjectApiName</var>.<var class="keyword varname">FieldName</var></samp>.
                      You can get any field that has a named relationship to this record. There’s
                      no limit to the number of fields you can specify.</p>
                    <p class="p">If you don’t pass
                      any fields, the response includes only the ID of the cloned record in a
                      field called <samp class="codeph nolang">CloneSourceId</samp>.</p>
                  </td>

                  <td class="entry" headers="d70079e138" data-title="Required or Optional">Optional</td>

                  <td class="entry" headers="d70079e141" data-title="Available Version">49.0</td>

                </tr>

                <tr>
                  <td class="entry" headers="d70079e129" data-title="Parameter Name"><samp class="codeph nolang">recordTypeId</samp></td>

                  <td class="entry" headers="d70079e132" data-title="Type">Id</td>

                  <td class="entry" headers="d70079e135" data-title="Description">The ID of the record type (RecordType object) for the new record. If not
                    provided, the default record type is used.</td>

                  <td class="entry" headers="d70079e138" data-title="Required or Optional">Optional</td>

                  <td class="entry" headers="d70079e141" data-title="Available Version">49.0</td>

                </tr>

              </tbody>

            </table>

Response Body

[Record Defaults Template Clone](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_responses_record_defaults_template_clone.htm "A record template containing the default information and data needed to clone a record. Use these values in a request to POST /ui-api/records.")