v1

latestOpenAPI 3.0.3MIT2026-07-22153276289.7 KB
Webhook API

Create a resthook subscription

After a subscription is successfully created, we'll send a POST request to your target URL with a X-Hook-Secret header. <br /> You need to response to this request with a 200 status code to confirm your subscribe intention. <br /> Then, you need to use the X-Hook-Secret to activate the subscription using the /resthook_subscriptions/activate endpoint. <br /> For more information and detailed instructions, see our webhooks documentation here.

post/v2/resthook_subscriptions

Request body

targetUrlstring required

URL of the resthook's receiver.

event'resume.parse.succeeded' | 'resume.parse.failed' | 'resume.parse.completed' | 'invoice.parse.succeeded' | 'invoice.parse.failed' | 'invoice.parse.completed' | 'invoice.validate.completed' | 'document.parse.succeeded' | 'document.parse.failed' | 'document.parse.completed' | 'document.validate.completed' | 'document.classify.succeeded' | 'document.classify.failed' | 'document.classify.completed' | 'document.rejected' | 'annotation.validated' required

The event name to subscribe to.

organizationstring

Specify to create an organization scope resthook. Not required if you're a member of only 1 organization.

workspacestring

Specify to create a workspace scope resthook.

version'v1' | 'v2' | 'v3'

Version of the resthook subscription. Determines the resthook body being fired.

Example request

{
  "targetUrl": "https://my-site.com/receive",
  "event": "document.parse.succeeded",
  "organization": "mEFayXdO",
  "workspace": "mEFayXdO",
  "version": "v3"
}

Response

Successfully created a resthook subscription.

idinteger required

Resthook subscription's ID.

event'resume.parse.succeeded' | 'resume.parse.failed' | 'resume.parse.completed' | 'invoice.parse.succeeded' | 'invoice.parse.failed' | 'invoice.parse.completed' | 'invoice.validate.completed' | 'document.parse.succeeded' | 'document.parse.failed' | 'document.parse.completed' | 'document.validate.completed' | 'document.classify.succeeded' | 'document.classify.failed' | 'document.classify.completed' | 'document.rejected' | 'annotation.validated' required

The event name to subscribe to.

targetUrlstring required

URL of the resthook's receiver.

activeboolean required

Resthooks only fire for active subscriptions.

autoDeactivatedboolean required

Resthook subscriptions can be auto deactivated if the receiver continuously returns error status code over a period of time.

autoDeactivateReasonstring required

The reason for the subscription being auto deactivated. May contains the error response that the receiver returned.

version'v1' | 'v2' | 'v3' required

Version of the resthook subscription. Determines the resthook body being fired.

Example response

{
  "event": "document.parse.succeeded",
  "organization": {
    "identifier": "mEFayXdO",
    "name": "Grove Street King",
    "userRole": "admin",
    "avatar": "https://affinda-api.s3.amazonaws.com/media/org-avatar.png?AWSAccessKeyId=KEY&Signature=SIG",
    "resthookSignatureKey": "465c6598bd34c0558f0ce256c43209d49fa85b0ff3e4c18b24e408b7563143ad"
  },
  "workspace": {
    "identifier": "mEFayXdO",
    "organization": {
      "identifier": "mEFayXdO",
      "name": "Grove Street King",
      "userRole": "admin",
      "avatar": "https://affinda-api.s3.amazonaws.com/media/org-avatar.png?AWSAccessKeyId=KEY&Signature=SIG",
      "resthookSignatureKey": "465c6598bd34c0558f0ce256c43209d49fa85b0ff3e4c18b24e408b7563143ad"
    }
  },
  "targetUrl": "https://my-site.com/receive",
  "active": true,
  "autoDeactivated": true,
  "autoDeactivateReason": "Resthook fails after 10 retries. The last error received was: 500 - Internal server error.",
  "version": "v3"
}