---
title: uuid.is_valid
summary: null
url: >-
  https://www.fastly.com/documentation/reference/vcl/functions/uuid/uuid-is-valid
---

```
BOOL uuid.is_valid(STRING uuid)
```

**Available in:** all subroutines

Returns `true` if the string holds a valid textual representation of one of the following UUIDs:

- version 1 (per [RFC 4122](https://tools.ietf.org/html/rfc4122))
- version 3, 4, or 5 (per [RFC 9562](https://datatracker.ietf.org/doc/html/rfc9562))
- version 7 (per the [draft RFC](https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-04))

Returns `false` otherwise.

## Example

```vcl
if (uuid.is_valid(req.http.X-Unique-Id)) {
  set beresp.http.X-Unique-Id-Valid = "yes";
}
```
