Configure the UID Field

This article explains what the UID field is and how to configure it in the Custom Type builder.


The UID field is a unique identifier used to create SEO-friendly website URLs. These are the characteristics of the UID field:

  • The value is unique to the Custom Type and locale.
  • It is space-free and written in lowercase, such as about-us. Spaces are replaced with dashes.
  • It can't contain special characters (except hyphens and underscores).
  • The Prismic development kits provide special helper functions for querying by UID.
  • When a UID is changed, the old value is permanently saved, so documents can always be queries by old UIDs. (This prevents links on your website from breaking.)
Screenshot of the UID field in the drag-and-drop editor.

Edit UIDs

To learn more about how to create and edit UIDs, see Edit a Document's Unique Identifier.

The visual builder

The UID field has two options: Field name and Field placeholder.

Screenshot of the UID editor in the Custom Type Builder.

JSON model

The following table displays the JSON configuration options available in the JSON editor.

type

string (required)

Must be UID

config

object

Object for the configuration options

config.label

string

The label that shows up for the field in the entry editor

config.placeholder

string

A user-friendly placeholder for the field in the entry editor

Example JSON configuration

The following JSON defines a UID field with label and placeholder:

Copy
"uid":{
  "type":"UID",
  "config":{
    "label":"Unique ID",
    "placeholder":"Enter a meaningful unique identifier..."
  }
}

API response example

Here is an API response example of a UID field:

Copy
// API response example of a UID field

{
 //...
 "uid": "unique-value"
}

Was this article helpful?
Not really
Yes, Thanks

Can't find what you're looking for? Get in touch with us on our Community Forum.