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/v1/token

Parameters

  • lennumberoptional

    Token length (12-4096). Default: 24

  • typestringoptional

    Token type (see options below). Default: alpha

Available Types

TypeDescription
alphaLetters only (lowercase and uppercase)
alphanumLetters and numbers
base64Base64 encoding
hexHexadecimal digits
numNumbers only
punctPunctuation characters
urlsafeURL-safe characters
uuidUniversally Unique Identifier (UUID)

Request Example

Request
POST /v1/token
Content-Type: application/x-www-form-urlencoded

len=24&type=alphanum

Response

Response
{
    "token": "6tMdlDV90x4Sm52dRS7MuGyn"
}

cURL

cURL
curl -X POST -d "len=24&type=alphanum" "https://api.moxon.dev/v1/token"

Error Handling

If the len value is out of bounds or the type is invalid, a 12-character alphanumeric token will be generated.