Skip to content
moxon home

Token Generation

The /token endpoint generates secure strings called tokens. This endpoint is particularly useful for creating random identifiers for various applications.

posthttps://api.moxon.dev/v6/token
Try itpost/v6/token

Parameters

  • lennumberoptional

    Default: 24.

    Token length (12-4096). Default: 24

  • typestringoptional

    Token type (see options below). Default: alphanum

    • alpha
    • alphanum
    • base64
    • hex
    • num
    • punct
    • urlsafe
    • uuid

Token Types

TypeDescriptionExample
alphaLetters only (a-z, A-Z)AbCdEfGhIjKl
alphanumLetters and numbers6tMdlDV90x4S
base64Base64 encodingdGVzdDEyMzQ=
hexHexadecimal digitsa1b2c3d4e5f6
numNumbers only123456789012
punctPunctuation characters!@#$%^&*()_+
urlsafeURL-safe charactersabc-123_XYZ
uuidUUID format550e8400-e29b-41d4-a716-446655440000

Code Examples

Response Fields

  • tokenstring

    The generated secure token

Error Handling

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

  • 400Invalid number.The len parameter is not a valid number
  • 400Length cannot exceed 4096.The len parameter is greater than 4096
  • 400Length cannot be less than 12.The len parameter is less than 12