Gamma API

Add a form template version

POST
/api/projects/{projectId}/form-templates/{templateId}/versions

Numbered next. Forms already started keep the version they were started from; new ones get this one. The body depends on the template's kind.

Who may call it: Anyone on the project whose permission profile allows form-template.update. API keys: yes, given form-template.update for this project.

Authorization

cookiegamma.session_token<token>

The session cookie a sign-in sets. Over HTTPS its name carries the __Secure- prefix. Browsers send it on their own; other clients keep it from the sign-in response.

Path Parameters

projectId*string

The project's id.

templateId*string

Request Body

application/json
  1. body

A native template: its whole new layout.

sections*array<>

Response Body

Created.

application/json
  1. response
version*

One immutable version of a template's contents; forms are pinned to the version they were started from.

Example Request
curl -X POST 'http://localhost:3000/api/projects/string/form-templates/string/versions' \  -H 'Content-Type: application/json' \  -d '{  "sections": [    {      "id": "string",      "title": "string",      "fields": [        {          "id": "string",          "label": "string",          "required": true,          "type": "text"        }      ]    }  ]}'
Example Response
{  "version": {    "id": "string",    "version": -9007199254740991,    "createdById": "string",    "createdAt": "2019-08-24T14:15:22Z",    "fileName": "string",    "sections": [      {        "id": "string",        "title": "string",        "fields": [          {            "id": "string",            "label": "string",            "description": "string",            "required": true,            "requiredWhen": {              "logic": "and",              "conditions": [                {                  "fieldId": "string",                  "operator": "eq",                  "value": "string"                }              ]            },            "type": "text",            "multiline": true,            "maxLength": -9007199254740991          }        ]      }    ],    "pdfFields": [      {        "name": "string",        "type": "text",        "options": [          "string"        ],        "multiline": true,        "maxLength": -9007199254740991,        "required": true,        "widgets": [          {            "page": -9007199254740991,            "rect": [              0            ]          }        ]      }    ],    "pdfPages": [      {        "width": 0,        "height": 0      }    ]  }}