Gamma API

Create a form template

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

With its first version: a native template's sections, or a PDF template's file — uploaded through upload-url first, then named by fileKey and fileName. 409 when the name is taken.

Who may call it: Anyone on the project whose permission profile allows form-template.create. API keys: yes, given form-template.create 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.

Request Body

application/json
  1. body
name*string
Length1 <= length <= 200
description?|null
folderId?|null
reviewEnabled?boolean

Send submitted forms to review before they are final.

approvers?array<>

Who may approve or reject: members and companies on the project. Empty for the organization's owners and admins.

Itemsitems <= 200
kind*string
Value in"native""pdf"
sections?unknown

A native template's layout, FormSection[]: 1 to 50 sections, at most 200 fields in all, every id unique.

fileKey?string

From upload-url, once the file is uploaded.

Length1 <= length <= 500
fileName?string
Match^[^/\\]+$
Length1 <= length <= 255

Response Body

Created.

application/json
  1. response
template*

What a project's forms are filled in from.

Example Request
curl -X POST 'http://localhost:3000/api/projects/string/form-templates' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "kind": "native"}'
Example Response
{  "template": {    "id": "string",    "folderId": "string",    "name": "string",    "description": "string",    "kind": "native",    "lastVersion": -9007199254740991,    "reviewEnabled": true,    "approvers": [      {        "kind": "member",        "id": "string"      }    ],    "archived": true,    "formCount": -9007199254740991,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }}