Document Actions
This guide show you how to add actions to your documents to automate your document workflows.
Document actions allow you to have your documents automatically perform certain operations.
Prerequisite
-
You have installed FormKiQ; see the FormKiQ One-Click Installation Links for more information
-
Install either: cURL or your favorite API Client, like Postman.
-
Optionally install: JQ, a command-line JSON processor which formats JSON so it is more readable.
-
All shell commands are shown for Unix-based systems. Windows has analogous commands for each.
Get JWT Authentication Token
You first need to get an authorization
token to access the FormKiQ API. See Getting an JWT Authentication Token for steps on how to get the token.
CloudFormation Outputs
We are going to need to know the name FormKiQ of a few AWS resources creating during the FormKiQ installation. Opening the CloudFormation console, find your FormKiQ stack and click the Outputs
tab.

The following are outputs we’ll need to know.
For all API requests the following table describes the values that need to be replaced in the API request.
Argument |
Description |
|
The URL for the API endpoint that uses Cognito authorization. |
|
The token retrieved from Step 1. |
Add Document with Webhook Actions
The webhook action will send a POST request to any endpoint.
In the example below, using pipedream.com we can create an endpoint and then have FormKiQ call that endpoint once the document is created.
curl -X POST https://HTTP_API_URL/documents/DOCUMENT_ID/tags \
-H "Authorization: AUTHORIZATION_TOKEN" -d '{
"path": "test.txt",
"contentType": "text/plain",
"content": "This is sample content",
"actions": [
{
"type": "webhook",
"parameters": {
"url": "https://eos1teg4kuo0fa7.m.pipedream.net"
}
}
]
}'
A successful message return the document id that was created.
{ "documentId":"983a9d66-3833-4e09-b3b0-a1808b87502c" }
Add Document with OCR & FULLTEXT Actions
FormKiQ Pro and Enterprise have an OCR Module and FormKiQ Enterprise has an Advanced Document Search Module which can be used to automatically run a OCR scan on a document and put the OCR results automatically into a Opensearch to enable full text document searching.
curl -X POST https://HTTP_API_URL/documents \
-H "Authorization: AUTHORIZATION_TOKEN" -d '{
"path": "sample.pdf",
"contentType": "application/pdf",
"isBase64":true,
"content": "BASE64_CONTENT",
"actions": [
{
"type": "ocr"
},
{
"type": "fulltext"
},
]
}'
A successful message return the document id that was created.
{ "documentId":"983a9d66-3833-4e09-b3b0-a1808b87502c" }
Get Document Actions Status
The GET /documents/{documentId}/actions
can be used to get the status of the action.
curl -X GET https://HTTP_API_URL/documents/DOCUMENT_ID/actions \
-H "Authorization: AUTHORIZATION_TOKEN"
Which will return a list of document actions like:
{ "actions":[{ "type":"webhook", "parameters":{ "url":"https://eos1teg4kuo0fa7.m.pipedream.net" }, "status":"complete"} ] }
Summary
To learn more about how you can use the FormKiQ API to collect, organize, process, and integrate your documents and web forms, see the full list of FormKiQ How-To.