Update a draft form.

PUT https://aws.consentgrid.io/v1/esign/form/{formId}
Content-Type: application/json

This API updates a form that is in published or draft state. The call fails if the form is in any other state. If the form is published, after updating it is put back into draft state.

Content-Type: application/json

{
  "parties": [
    {
      "role": "signer",
      "required": true,
      "id": {
        "type": "user",
        "id": "12874-8488297-439834"
      }
    },
    ...
  ],
  "minOptional": 2,
  "completeWhen": "signed",
  "dateRange": {
    "from": "2006-01-02T15:04:05Z07:00",
    "to": "2006-01-02T15:04:05Z07:00"
  },
  "data": {...},
  "uiData": {...},
  "template": {
    "name": "templateName",
    "locale": "en"
  },
  "by": {
    "type": "user",
    "id": "123-34345"
  }     
}
parties
One or more data subjects that is allowed to sign this form. All parties with required=true must sign the form for it to be accepted. If required=false then the data subject is optional. At least minOptional data subjects must sign the form. The optional role field includes an additional qualifier for the data subject, such as "witness".
minOptional
Minimum number of optional parties required to sign the form. Can be 0.
completeWhen
This field is one of the following:
signed
When all required parties and at least minOptional parties sign the form, it will be closed and consent records will be created.
expired
When the report expiration time passes, if all the required parties and at least minOptional optional parties signed the form, it will be closed and consent records will be created. If there are not enought signatures, the form will be canceled.
explicit
An explicit API call is required to close or cancel the form.
dateRange
Determines the active period for the report. Both the from and to dates are optional. The report will not be accessible until from date, and the report will be closed, or canceled after to date.
data
This is a JSON object that will be stored with the consent records once the form is signed. The contents of this JSON object is also available during form interactions, so these fields can be used to populate fields for the signers.
uiData
This is a JSON object that will be available during form interactions, but they will not be stored with the consent. Use this field to populate list fields, etc.
template
The form template name and locale. If locale is omitted, the default locale will be used.
by
The use that created/modified this form

Response

200 Ok

Returns the form ID.

{
  "id": "esgn_1298749987ae4434"
}
400 Bad Request

Malformed request, invalid value, etc. The return value is a JSON error object containing diagnostic information.

403 Forbidden

The authenticated key does not have the privileges for this operation. The return value is a JSON error object containing diagnostic information.