Skip to main content

Webhooks End-to-End

Use this guide to create a FormKiQ webhook, tag it, submit a payload through the webhook endpoint, and inspect the webhook configuration.

Webhooks are useful when another system needs a stable endpoint for sending document-related payloads into FormKiQ.

Before You Begin​

Confirm you have:

  • A deployed FormKiQ environment. See Quick Start.
  • A JWT access token with permission to manage webhooks.
  • cURL or an API client such as Postman.

Variables Used​

PlaceholderDescription
HTTP_API_URLFormKiQ API endpoint from the CloudFormation stack output, including https://.
AUTHORIZATION_TOKENJWT access token used in the Authorization header.
SITE_IDFormKiQ site ID. Use default unless your deployment uses multiple sites.
WEBHOOK_IDWebhook ID returned when a webhook is created.

The examples below use shell variables. Replace the values before running the commands:

export HTTP_API_URL="https://your-formkiq-api.example.com"
export AUTHORIZATION_TOKEN="your-jwt-access-token"
export SITE_ID="default"

Step 1: Create a Webhook​

Use POST /webhooks to create a private webhook. A private webhook accepts posts only from authenticated callers. For the difference between public and private webhooks, see Webhooks.

curl -X POST "${HTTP_API_URL}/webhooks?siteId=${SITE_ID}" \
-H "Authorization: ${AUTHORIZATION_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"name": "Partner invoice intake",
"enabled": "private",
"tags": [
{
"key": "source",
"value": "partner"
}
]
}'

Set WEBHOOK_ID to the ID returned in the response.

export WEBHOOK_ID="returned-webhook-id"

Step 2: Add a Webhook Tag​

Use POST /webhooks/{webhookId}/tags to add routing or classification tags to the webhook.

curl -X POST "${HTTP_API_URL}/webhooks/${WEBHOOK_ID}/tags?siteId=${SITE_ID}" \
-H "Authorization: ${AUTHORIZATION_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"key": "documentType",
"value": "invoice"
}'

Step 3: Inspect the Webhook​

Use GET /webhooks/{webhookId} to confirm the webhook's settings. The response includes the url to give to the sending system.

curl -X GET "${HTTP_API_URL}/webhooks/${WEBHOOK_ID}?siteId=${SITE_ID}" \
-H "Authorization: ${AUTHORIZATION_TOKEN}"

Step 4: Submit a Payload Through the Private Webhook Endpoint​

Use POST /private/webhooks/{webhookId} to submit an authenticated payload. The path segment is the webhook ID. FormKiQ stores the payload as a new document and returns its documentId.

curl -X POST "${HTTP_API_URL}/private/webhooks/${WEBHOOK_ID}?siteId=${SITE_ID}" \
-H "Authorization: ${AUTHORIZATION_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"externalId": "invoice-1001",
"fileName": "invoice-1001.pdf",
"source": "partner"
}'

A webhook created with "enabled": "true" is public: it is posted to at POST /public/webhooks/{webhookId} without a JWT, and only when public URLs are enabled for the deployment. Use public webhooks only for payloads your architecture is prepared to accept from anyone who has the URL.

Step 5: List Webhooks​

Use GET /webhooks to review all configured webhooks.

curl -X GET "${HTTP_API_URL}/webhooks?siteId=${SITE_ID}" \
-H "Authorization: ${AUTHORIZATION_TOKEN}"

Verify the Result​

Confirm that:

  • The webhook appears in GET /webhooks.
  • GET /webhooks/{webhookId} shows the expected name, enabled state, and tags.
  • The private webhook endpoint accepts the sample payload and returns a documentId.
  • The new document appears under the path webhooks/{webhookId}.

Troubleshooting​

ProblemLikely causeWhat to check
Webhook is not acceptedThe webhook is disabled or expired, or the wrong ID or URL is used.Check enabled and compare the request URL with the url returned by GET /webhooks/{webhookId}.
401 UnauthorizedThe private webhook request is missing a JWT.Add Authorization: ${AUTHORIZATION_TOKEN}.
Tags are missingTags were not added to the webhook or payload.Check GET /webhooks/{webhookId}/tags.
Public webhook intake is too permissivePublic endpoints do not require JWT authentication.Use private webhooks unless anonymous intake is intentional.

Next Steps​

Privacy settings

Analytics is optional. Your analytics choice is shared with formkiq.com and remembered for up to six months. Change it here at any time.

Essential preferences and search

We remember your privacy choice and display preferences. Search runs in your browser using Pagefind files hosted with the docs. It works whether you accept or reject analytics.

Measure page views, installation-link clicks, and selected navigation. This does not enable advertising on the docs. Existing marketing choices for the main website are kept unchanged.

Read the docs privacy notice or manage other main-website privacy choices.