Submit a Form
Sends one set of answers, keyed by field, and returns the confirmation to show. Invalid answers come back per field (422). A form for signed-in people only answers 401 without a session; with one, the answer records the signed-in user. Rate-limited per caller address. `website` must stay empty: it is a trap for bots.
post
/forms/submitcurl --request POST \
--url 'https://api.tries.care/forms/submit' \
--header 'authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"slug": "string",
"answers": {
"key": "string"
},
"website": "string",
"sourceUrl": "string",
"utm": {
"source": "string",
"medium": "string",
"campaign": "string",
"term": "string",
"content": "string"
}
}'const response = await fetch("https://api.tries.care/forms/submit", {
method: "POST",
headers: {
authorization: "<authorization>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"slug": "string",
"answers": {
"key": "string"
},
"website": "string",
"sourceUrl": "string",
"utm": {
"source": "string",
"medium": "string",
"campaign": "string",
"term": "string",
"content": "string"
}
}),
});
const data = await response.json();{
"confirmation": "string"
}Headers
authorizationstringnullable
Body Parameters
application/jsonslugstringrequiredlength ≤ 60
answersobjectrequiredwebsitestringrequiredsourceUrlstringnullablerequiredlength ≤ 2000
utmobjectrequiredProperties (5)
sourcestringnullablerequiredlength ≤ 200
mediumstringnullablerequiredlength ≤ 200
campaignstringnullablerequiredlength ≤ 200
termstringnullablerequiredlength ≤ 200
contentstringnullablerequiredlength ≤ 200
Responses
- 200FormSubmissionReceiptapplication/json
confirmationstringnullablerequired
- 401SessionNotFoundError | AccountClosedError | SessionExpiredError | SessionUserNotFoundError | FormSignInRequiredErrorapplication/json
- SessionNotFoundError | AccountClosedError | SessionExpiredError | SessionUserNotFoundError | FormSignInRequiredError
One of:SessionNotFoundErrorAccountClosedErrorSessionExpiredErrorSessionUserNotFoundErrorFormSignInRequiredError
- 403AccessDeniedErrorapplication/json
_tagenum<string>required
- 404FormNotFoundErrorapplication/json
_tagenum<string>requiredformstringrequired
- 409ConcurrentModificationErrorapplication/json
_tagenum<string>requiredentitystringrequiredidstringrequired
- 422FormAnswersInvalidErrorapplication/json
_tagenum<string>requiredproblemsobjectrequired
- 429RateLimitedErrorapplication/json
_tagenum<string>requiredretryAfterSecondsnumberrequired
- 500DatabaseErrorapplication/json
_tagenum<string>requiredmessagestringrequired