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/submit
curl --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"
  }
}'
{
  "confirmation": "string"
}

Headers

  • authorizationstringnullable

Body Parameters

application/json
  • slugstringrequired

    length ≤ 60

  • answersobjectrequired
  • websitestringrequired
  • sourceUrlstringnullablerequired

    length ≤ 2000

  • utmobjectrequired
    Properties (5)
    • sourcestringnullablerequired

      length ≤ 200

    • mediumstringnullablerequired

      length ≤ 200

    • campaignstringnullablerequired

      length ≤ 200

    • termstringnullablerequired

      length ≤ 200

    • contentstringnullablerequired

      length ≤ 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>required
    • formstringrequired
  • 409ConcurrentModificationErrorapplication/json
    • _tagenum<string>required
    • entitystringrequired
    • idstringrequired
  • 422FormAnswersInvalidErrorapplication/json
    • _tagenum<string>required
    • problemsobjectrequired
  • 429RateLimitedErrorapplication/json
    • _tagenum<string>required
    • retryAfterSecondsnumberrequired
  • 500DatabaseErrorapplication/json
    • _tagenum<string>required
    • messagestringrequired