Fields Generated by Payload
Payload automatically adds fields to collections and globals based on their configuration. For example, collections receive an id field, auth-enabled collections receive fields such as email, and upload-enabled collections receive fields such as filename.
You can override the configuration of supported generated fields by defining a top-level field with the same name in your collection or global fields array. Payload merges auth, upload, and version field overrides into its default field configuration, preserving properties that you do not override, including hooks. Custom ID and timestamp fields replace the generated field instead.
Example
The following auth collection further restricts writes to Payload's default apiKey field. Field overrides replace matching access functions, so the custom functions build on Payload's canAccessAdmin boundary before applying an application role:
Document fields
The following fields are available on collections and globals without enabling authentication, uploads, or versions:
Field | Used by | Override behavior |
|---|---|---|
| Collections | Replaces the generated ID field. See Custom ID fields. |
| Collections with timestamps and all globals | Replaces the generated field. Keep this as a |
| Collections with timestamps and all globals | Replaces the generated field. Keep this as a |
| Collections with | Replaces the generated field. Keep this as a |
Custom ID fields
All Collections automatically generate their own ID field. If needed, you can override this behavior by providing an explicit ID field to your config. This field should either be required or have a hook to generate the ID dynamically.
To define a custom ID field, add a top-level field with the name property set to id:
Authentication fields
Authentication fields are added to a collection according to its auth configuration. Payload deep-merges matching fields from your collection's fields array into these defaults, except for the special password override described below.
Fields | Added when |
|---|---|
| The local authentication strategy is enabled. |
| |
| |
| |
| |
| |
The password override is also applied to the generated new-password and confirm-password fields in the Admin Panel. You may need to set hidden: true on the override to prevent an additional field from being displayed.
The salt and hash fields are reserved and cannot be overridden.
Upload fields
The following fields are added to upload-enabled collections. Payload deep-merges matching fields from your collection's fields array into these defaults.
Fields | Added when |
|---|---|
| Uploads are enabled. |
| Focal points are enabled, or |
| |
The file field is reserved and cannot be overridden.
Version fields
The _status field is added to collections and globals when drafts are enabled. Define a top-level _status field to merge custom configuration into Payload's default field.
Was this page helpful?