API

Integrate Documate with your favorite apps and services. The API is available to users under the Enterprise plans.

Authentication:

Authentication with the api is done via X-Api-Key header:

X-Api-Key:  <YOUR_DOCUMATE_API_KEY>

Create Workflow Session with Data:

Method: POST

Content-Type: application/json

Path: /api/documate/v1/interviews/<interview_name>/new 

Path Parameters:

interview_name: The url encoded, case sensitive name of the interview that we are creating a new session and inserting data into.

Request Body:

variables: a JSON object where the keys are variable names and the values are the values. All values of the object should be a string/number representing the variable they are setting with the exception of the following special variables/data types:

  • Date variables need to be in ISO8601 format.
  • ~Note: variables/parameters in the wrong format (e.g., dates in the wrong format) will be ignored.
  • Repeating Items:
  • ~Repeating item values can be set as {"itemname[itemindex].itemproperty":"property value"}
  • ~To skip the “Please Review YourEntries” screen, set {"itemname.reviewed":true} (example below)
  • Multi Select fields are JSON objects with the following required properties:
  • ~_class: docassemble.base.core.DADict
  • ~instanceName: %VARIABLE_NAME%
  • ~elements: A JSON object as {"name of option": true}
  • review_answers - Set this to true to skip the “Please review your answers”.
  • ~If all required workflow variables are present in the request, the continuation_url will present the document download page
  • ~If all required workflow variables are not present in the request, the continuation_url will prompt for the missing data and skip the review page, directing to the document download page when missing values are entered.
  • ~Setting review_answers to true will skip the review page in all cases, even where you are directed to enter additional data in the Documate workflow.
Example:

For a workflow named: My Documate Workflow with the following data types for variables:

  • my_date_variable: Date
  • dependents: Repeating Item
  • ~firstname: Text
  • ~lastname: Text
  • ~age: Number
  • my_multi: Multi Select

POST /api/documate/v1/interviews/My%20Documate%20Workflow/new HTTP/1.1
Host: yourdomain.documate.org
X-Api-Key: YOUR_DOCUMATE_API_KEY
Content-Type: application/json  

{    
  "variables": {      
    "my_date_variable": "2021-05-01T23:02:02.098Z",      
    "dependents[0].firstname":  "First",      
    "dependents[0].lastname":  "Dependent",      
    "dependents[0].age": "10",       
    "dependents[1].firstname": "Second",      
    "dependents[1].lastname":  "Dependent",      
    "dependents[1].age": "8",      
    "dependents.reviewed": true,      
    "review_answers": true,      
    "my_multi":{        
      "_class": "docassemble.base.core.DADict",        
      "instanceName": "my_multi",        
      "elements": {            
          "one": true,            
          "two": true
      }      
    }    
  }  
}
Response:
{      
    "continuation_url": "https://yourdomain.documate.org/run/playground6/My%20Documate%20Workflow/?session=TerMtx6W3o4xhhEq76MqaKL5t2FQcJ2a",
    "session_id": "TerMtx6W3o4xhhEq76MqaKL5t2FQcJ2a"  
}

List Workflows Names:

Method: GET

Path: /api/playground?folder=questions

Example Response:

[ "Continued.yml", "Divorce Workflow.yml", "Evictions.yml", "Express Workflow.yml" ]

List Workflow Variables:

Method: GET

Path: /officeaddin?pgtypes=<workflow name>.yml

Path Parameters:

pgtypes: name of the workflow returned from List Workflows endpoint.

Example Response:
{ "attachments": [], "success": true, "types_json": { "types_list": [ { "datatype": "text", "inputtype": "radio", "label": "Marital Status", "required": true, "selections": [ "Married", "Single" ], "variable": "marital_status" }, { "datatype": "text", "label": "My Text 2", "required": true, "variable": "my_text2" }, ] } }

Note: This API overlaps with the Documate Office add-in API, so it will also allow for additional data such as variable names for buttons and instruction blocks.