POST/api/echoPublic

Echo a message

Demonstrates JSON body validation: the body is parsed with the declared zod schema and a 400 with per-field issues is returned when it does not match.

operationId post_api_echoDemo

Authentication & permissionsPublic

Anyone — no credentials required

Accepted credentials
None required

Request body

Required — Message to echo back

application/json
EchoRequest
PropertyTypeDescription
message*string

minLength: 1maxLength: 280

repeatinteger

How many times to repeat the message (1-5)

minimum: 1maximum: 5default: 1

JSONExample
"message""hello"
"repeat"1

Responses

application/json
EchoResponse
PropertyTypeDescription
echoes*string[]
JSONExample
"echoes"
"string"

Example request

bashcurl
curl -X POST 'https://example-nextjs-resource-server.schemavaults.com/api/echo' \
  -H 'Content-Type: application/json' \
  -d '{
  "message": "hello",
  "repeat": 1
}'