POST
/api/echoPublicEcho 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_echoDemoAuthentication & permissionsPublic
Anyone — no credentials required
- Accepted credentials
- None required
Request body
Required — Message to echo back
application/json
EchoRequest
| Property | Type | Description |
|---|---|---|
| message* | string | minLength: 1maxLength: 280 |
| repeat | integer | How many times to repeat the message (1-5) minimum: 1maximum: 5default: 1 |
JSONExample
"message""hello"
"repeat"1
Responses
application/json
EchoResponse
| Property | Type | Description |
|---|---|---|
| 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
}'