Tenant API - Forms

Create form template

A form template is a list of questions you would like to ask users. When sending content you can attach a form you would like a user to complete.

Form templates are owned by the client that created them. What this means is that only the client can call the response endpoints. However if the client has the tenant scope it can call form template endpoints and even include a form when sending content.

How to send a form to the user

When sending a content to the user include the form template key in the context object. See Tenant API - Content -> Send content (v2) for more information.

post/v2/tenant/{tenantKey}/form

Request

  • Base URL: https://sender.api.kivra.com
  • URL: https://sender.api.kivra.com/v2/tenant/{tenantKey}/form
  • Auth: oAuth2Client (defined in the document in a form this page cannot read)

Path parameters

tenantKeystring hexadecimal required

The tenant key for the tenant who is creating the form template.

Request body

titlestring required

The title of the form.

descriptionstring required

The purpose of the form.

start_questionstring required

The id of the first question in questions that will be asked to the user.

keystring uuid required

The key of the newly created form template.

created_atstring required

The date the form template was created.

versioninteger required

The form template version

Example request

{
  "title": "Customer KYC",
  "description": "Your bank has some questions",
  "start_question": "number_deposits",
  "questions": [
    {
      "label": "How many times per month do you deposit into your account?",
      "id": "number_deposits",
      "type": "number",
      "next_question": "largest_sum"
    },
    {
      "label": "What is the largest amount deposited?",
      "id": "largest_sum",
      "type": "options",
      "options": [
        {
          "id": "small",
          "label": "10000 - 20000"
        },
        {
          "id": "medium",
          "label": "20000 - 30000"
        },
        {
          "id": "large",
          "label": "30000 - 40000",
          "next_question": "source"
        }
      ],
      "next_question": "citizenship"
    },
    {
      "label": "Select your country of citizenship",
      "id": "citizenship",
      "type": "multi_options",
      "options": [
        {
          "id": "swe",
          "label": "Sweden"
        },
        {
          "id": "no",
          "label": "Norway"
        },
        {
          "id": "dk",
          "label": "Denmark"
        }
      ],
      "min": 1,
      "max": 2,
      "next_question": "comments"
    },
    {
      "label": "What is the source of the deposit?",
      "id": "source",
      "type": "free_text",
      "next_question": "account"
    },
    {
      "label": "Select your salary account",
      "id": "account",
      "type": "verified_account",
      "next_question": "comments"
    },
    {
      "label": "Do you have any further comments?",
      "id": "comments",
      "type": "free_text",
      "help_text": "This can be any type of feedback that you have."
    }
  ],
  "key": "2877d684-a340-4e4c-867f-d93283787b01",
  "created_at": "2022-11-23T14:51:23.874434Z",
  "version": 1
}

Response

Form template created

titlestring required

The title of the form.

descriptionstring required

The purpose of the form.

start_questionstring required

The id of the first question in questions that will be asked to the user.

keystring uuid required

The key of the newly created form template.

created_atstring required

The date the form template was created.

versioninteger required

The form template version

Example response

{
  "title": "Customer KYC",
  "description": "Your bank has some questions",
  "start_question": "number_deposits",
  "questions": [
    {
      "label": "How many times per month do you deposit into your account?",
      "id": "number_deposits",
      "type": "number",
      "next_question": "largest_sum"
    },
    {
      "label": "What is the largest amount deposited?",
      "id": "largest_sum",
      "type": "options",
      "options": [
        {
          "id": "small",
          "label": "10000 - 20000"
        },
        {
          "id": "medium",
          "label": "20000 - 30000"
        },
        {
          "id": "large",
          "label": "30000 - 40000",
          "next_question": "source"
        }
      ],
      "next_question": "citizenship"
    },
    {
      "label": "Select your country of citizenship",
      "id": "citizenship",
      "type": "multi_options",
      "options": [
        {
          "id": "swe",
          "label": "Sweden"
        },
        {
          "id": "no",
          "label": "Norway"
        },
        {
          "id": "dk",
          "label": "Denmark"
        }
      ],
      "min": 1,
      "max": 2,
      "next_question": "comments"
    },
    {
      "label": "What is the source of the deposit?",
      "id": "source",
      "type": "free_text",
      "next_question": "account"
    },
    {
      "label": "Select your salary account",
      "id": "account",
      "type": "verified_account",
      "next_question": "comments"
    },
    {
      "label": "Do you have any further comments?",
      "id": "comments",
      "type": "free_text",
      "help_text": "This can be any type of feedback that you have."
    }
  ],
  "key": "2877d684-a340-4e4c-867f-d93283787b01",
  "created_at": "2022-11-23T14:51:23.874434Z",
  "version": 1
}

Changes

No recorded changes to this operation across all 1 revision of this API.