Skip to content
moxon home

UUID Generation

The /uuid endpoint generates random UUID v4 values, or parses an existing UUID to extract its version and variant.

gethttps://api.moxon.dev/v5/uuid

How it works?

The endpoint has two modes. When uuid is provided, it switches to parsing and count is ignored. Otherwise it generates count random UUID v4 values (a single one by default). A malformed UUID is not an error: it is returned with valid: false and null components.

Try itget/v5/uuid

Parameters

  • uuidstringoptional

    UUID to parse. When provided, nothing is generated and count is ignored

  • countnumberoptional

    Number of UUIDs to generate, an integer between 1 and 50. Default: 1

UUID Variants

The variant is derived from the first character of the fourth group:

CharacterVariant
0 – 7NCS
8 – bRFC 4122
c – dMicrosoft
e – fFuture

Response Fields

Single UUID (generated, or count of 1):

  • uuidstring

    The generated UUID

  • versionnumber

    UUID version — always 4 when generated

  • variantstring

    Always RFC 4122 when generated

Batch (count greater than 1):

  • uuidsstring[]

    Array of generated UUID v4 values

  • countnumber

    Number of UUIDs returned

Parsing (uuid provided):

  • uuidstring

    The original input UUID

  • versionnumber|null

    UUID version, null if the input is not a valid UUID

  • variantstring|null

    UUID variant, null if the input is not a valid UUID

  • validboolean

    Whether the input matches the UUID format

Code Examples

Error Handling

If parameters are missing or invalid, the API will return an error:

  • 400Please provide a valid UUID (?uuid={uuid})The uuid parameter is not a single string value
  • 400Count must be a numberThe count value is not a number
  • 400Count must be between 1 and 50The count value is not an integer between 1 and 50