Skip to content
moxon home

Case

The /case endpoint converts text between 9 case formats using universal tokenization (camelCase splitting, _, -, ., spaces).

gethttps://api.moxon.dev/v6/case
Try itget/v6/case

Parameters

  • textstringrequired
    —

    Text to convert

  • tostringoptional

    Default: camel.

    Target case format

    • camel
    • pascal
    • snake
    • kebab
    • constant
    • title
    • sentence
    • upper
    • lower

Available Targets

TargetDescriptionExample (hello_world)
camelcamelCasehelloWorld
pascalPascalCaseHelloWorld
snakesnake_casehello_world
kebabkebab-casehello-world
constantCONSTANT_CASEHELLO_WORLD
titleTitle CaseHello World
sentenceSentence caseHello world
upperUPPERCASEHELLO_WORLD
lowerlowercasehello_world

Response Fields

  • textstring

    The original input text

  • tostring

    The target case format

  • resultstring

    The converted text

Code Examples

Error Handling

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

  • 400Please provide a text (?text={text})The text parameter is missing
  • 400Text cannot exceed 1000 charactersThe text exceeds the maximum length
  • 400Text must contain at least one alphanumeric characterThe text contains only separators/punctuation (e.g. ---), leaving nothing to convert
  • 400Invalid target case. Valid values: camel, pascal, snake, kebab, constant, title, sentence, upper, lowerThe to value is not valid