# uuid

Learn how to generate a random UUID.

Generates a random [UUID v4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_\(random\)) string. Each call produces a new unique value, so calling `uuid()` twice in the same template yields two different identifiers.

## Example

The following template prints a generated identifier:

**template.json5**

```json5
{
  "$schema": "https://schema.croct.com/json/v1/template.json",
  "title": "UUID demo",
  "description": "Prints a generated UUID.",
  "actions": [
    {
      "name": "print",
      "message": "Generated ID: ${uuid()}"
    }
  ]
}
```

Each run produces a different value, for example `Generated ID: 550e8400-e29b-41d4-a716-446655440000`.

## Parameters

This function takes no parameters.

## Return

A UUID v4 string such as `3f2504e0-4f89-11d3-9a0c-0305e82c3301`.

## Explore

- [Define](/reference/cli/templates/actions/define): Learn how to store the UUID in a variable.
- [Expressions](/reference/cli/templates/expressions): Learn how to use dynamic values in templates.
