---
schema_version: "1"
id: 6b8b776df1b61cff033401883ac6486cc131fc5c2c8527ff6f1063712fff486c
title: Get Default Values to Create 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_create.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_record_defaults_template_create.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 067df90891c092b894d7648e8579713ee69a0f8ab7a199ceeb29f5b6ea215339
description: Get the default values for fields for a new record of a specified object and optional record type. 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 Create a Record—Lightweight

Get the default values for fields for a new record of a specified object and optional record type. 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 object metadata for specified fields. For example, this request 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/create/Account?optionalFields=Account.OwnerId

Resource

/ui-api/record-defaults/template/create/{objectApiName}

![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/create/{objectApiName}](# "Get the default values for fields for a new record of a specified object and optional record type. 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.") resource.

- objectApiName—The API name of the object type for the new record.

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="d70575e133">Parameter Name</th>

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

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

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

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

                </tr>

              </thead>

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

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

                  <td class="entry" headers="d70575e139" 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 doesn’t include any
                      fields.</p>
                  </td>

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

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

                </tr>

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

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

                  <td class="entry" headers="d70575e139" 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="d70575e142" data-title="Required or Optional">Optional</td>

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

                </tr>

              </tbody>

            </table>

Response Body

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