curl --request POST \
--url https://{region}.affinda.com/v3/resthook_subscriptions/activate \
--header 'Authorization: Bearer <token>' \
--header 'X-Hook-Secret: <x-hook-secret>'{
"id": 123,
"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",
"isTrial": true,
"validationToolConfig": {
"theme": {
"palette": {
"mode": "light",
"background": "<string>",
"text": {
"primary": "<string>",
"secondary": "<string>",
"disabled": "<string>"
},
"divider": "<string>",
"primary": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"secondary": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"success": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"annotation": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"error": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"info": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"warning": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
}
},
"typography": {
"fontFamily": "<string>",
"fontSize": "<string>",
"fontWeightRegular": "<string>",
"fontWeightMedium": "<string>",
"fontWeightBold": "<string>"
},
"borderRadius": 123,
"fontUrl": "<string>"
},
"hideActions": true,
"hideCollection": true,
"hideEditPages": true,
"hideExport": true,
"hideFilename": true,
"hideShowRawValues": true,
"hideReject": true,
"hideReparse": true,
"hideRunOcr": true,
"hideTags": true,
"hideWarnings": true,
"restrictDocumentSplitting": true,
"disableCurrencyFormatting": true,
"disableEditDocumentMetadata": true,
"disableManualAnnotationEditing": true,
"hideDocumentStatus": true
},
"showCustomFieldCreation": true
},
"workspace": {
"identifier": "mEFayXdO",
"name": "<string>",
"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",
"isTrial": true,
"validationToolConfig": {
"theme": {
"palette": {
"mode": "light",
"background": "<string>",
"text": {
"primary": "<string>",
"secondary": "<string>",
"disabled": "<string>"
},
"divider": "<string>",
"primary": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"secondary": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"success": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"annotation": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"error": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"info": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"warning": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
}
},
"typography": {
"fontFamily": "<string>",
"fontSize": "<string>",
"fontWeightRegular": "<string>",
"fontWeightMedium": "<string>",
"fontWeightBold": "<string>"
},
"borderRadius": 123,
"fontUrl": "<string>"
},
"hideActions": true,
"hideCollection": true,
"hideEditPages": true,
"hideExport": true,
"hideFilename": true,
"hideShowRawValues": true,
"hideReject": true,
"hideReparse": true,
"hideRunOcr": true,
"hideTags": true,
"hideWarnings": true,
"restrictDocumentSplitting": true,
"disableCurrencyFormatting": true,
"disableEditDocumentMetadata": true,
"disableManualAnnotationEditing": true,
"hideDocumentStatus": true
},
"showCustomFieldCreation": true
}
},
"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"
}After creating a subscription, we’ll send a POST request to your target URL with a X-Hook-Secret header.
You should response to this with a 200 status code, and use the value of the X-Hook-Secret header that you received to activate the subscription using this endpoint.
curl --request POST \
--url https://{region}.affinda.com/v3/resthook_subscriptions/activate \
--header 'Authorization: Bearer <token>' \
--header 'X-Hook-Secret: <x-hook-secret>'{
"id": 123,
"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",
"isTrial": true,
"validationToolConfig": {
"theme": {
"palette": {
"mode": "light",
"background": "<string>",
"text": {
"primary": "<string>",
"secondary": "<string>",
"disabled": "<string>"
},
"divider": "<string>",
"primary": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"secondary": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"success": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"annotation": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"error": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"info": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"warning": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
}
},
"typography": {
"fontFamily": "<string>",
"fontSize": "<string>",
"fontWeightRegular": "<string>",
"fontWeightMedium": "<string>",
"fontWeightBold": "<string>"
},
"borderRadius": 123,
"fontUrl": "<string>"
},
"hideActions": true,
"hideCollection": true,
"hideEditPages": true,
"hideExport": true,
"hideFilename": true,
"hideShowRawValues": true,
"hideReject": true,
"hideReparse": true,
"hideRunOcr": true,
"hideTags": true,
"hideWarnings": true,
"restrictDocumentSplitting": true,
"disableCurrencyFormatting": true,
"disableEditDocumentMetadata": true,
"disableManualAnnotationEditing": true,
"hideDocumentStatus": true
},
"showCustomFieldCreation": true
},
"workspace": {
"identifier": "mEFayXdO",
"name": "<string>",
"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",
"isTrial": true,
"validationToolConfig": {
"theme": {
"palette": {
"mode": "light",
"background": "<string>",
"text": {
"primary": "<string>",
"secondary": "<string>",
"disabled": "<string>"
},
"divider": "<string>",
"primary": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"secondary": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"success": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"annotation": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"error": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"info": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
},
"warning": {
"main": "<string>",
"light": "<string>",
"dark": "<string>",
"contrastText": "<string>"
}
},
"typography": {
"fontFamily": "<string>",
"fontSize": "<string>",
"fontWeightRegular": "<string>",
"fontWeightMedium": "<string>",
"fontWeightBold": "<string>"
},
"borderRadius": 123,
"fontUrl": "<string>"
},
"hideActions": true,
"hideCollection": true,
"hideEditPages": true,
"hideExport": true,
"hideFilename": true,
"hideShowRawValues": true,
"hideReject": true,
"hideReparse": true,
"hideRunOcr": true,
"hideTags": true,
"hideWarnings": true,
"restrictDocumentSplitting": true,
"disableCurrencyFormatting": true,
"disableEditDocumentMetadata": true,
"disableManualAnnotationEditing": true,
"hideDocumentStatus": true
},
"showCustomFieldCreation": true
}
},
"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"
}Basic authentication using an API key, e.g. {Authorization: Bearer aff_0bb4fbdf97b7e4111ff6c0015471094155f91}.
You can find your API key within the Settings page of the Affinda web app. You can obtain an API key by signing up for a free trial.
The secret received when creating a subscription.
"36bacde97882f563992b00a89163eb9058d956fdc2f914870b8903ec93cdf372"
Successfully activated a resthook subscription.
Resthook subscription's ID.
The event name to subscribe to.
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 "document.parse.succeeded"
Show child attributes
Uniquely identify an organization.
"mEFayXdO"
"Grove Street King"
The role of the logged in user within the organization.
admin, member "admin"
URL of the organization's avatar.
"https://affinda-api.s3.amazonaws.com/media/org-avatar.png?AWSAccessKeyId=KEY&Signature=SIG"
Used to sign webhook payloads so you can verify their integrity.
"465c6598bd34c0558f0ce256c43209d49fa85b0ff3e4c18b24e408b7563143ad"
Configuration of the embeddable validation tool.
Show child attributes
Show child attributes
Show child attributes
light, dark Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Hide the confirm document button and other actions.
Hide the collection selector.
Hide the edit pages button.
Hide the export menu.
Hide the filename input.
Hide the toggle for showing raw annotation values.
Hide the reject document button.
Hide the reparse button.
Hide the run OCR button.
Hide the tags editor.
Hide the warnings panel.
Disable the page editor after a document has been split once.
Disable currency formatting of decimals values.
Disable editing document metadata. Makes the collection selector, filename input and tags editor read only.
Disable manual editing of annotation values via the validation popover.
Hide the document status indicator in the toolbar.
Whether to show the custom field creation in the UI.
Show child attributes
Uniquely identify a workspace.
"mEFayXdO"
Show child attributes
Uniquely identify an organization.
"mEFayXdO"
"Grove Street King"
The role of the logged in user within the organization.
admin, member "admin"
URL of the organization's avatar.
"https://affinda-api.s3.amazonaws.com/media/org-avatar.png?AWSAccessKeyId=KEY&Signature=SIG"
Used to sign webhook payloads so you can verify their integrity.
"465c6598bd34c0558f0ce256c43209d49fa85b0ff3e4c18b24e408b7563143ad"
Configuration of the embeddable validation tool.
Show child attributes
Show child attributes
Show child attributes
light, dark Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Hide the confirm document button and other actions.
Hide the collection selector.
Hide the edit pages button.
Hide the export menu.
Hide the filename input.
Hide the toggle for showing raw annotation values.
Hide the reject document button.
Hide the reparse button.
Hide the run OCR button.
Hide the tags editor.
Hide the warnings panel.
Disable the page editor after a document has been split once.
Disable currency formatting of decimals values.
Disable editing document metadata. Makes the collection selector, filename input and tags editor read only.
Disable manual editing of annotation values via the validation popover.
Hide the document status indicator in the toolbar.
Whether to show the custom field creation in the UI.
URL of the resthook's receiver.
"https://my-site.com/receive"
Resthooks only fire for active subscriptions.
true
Resthook subscriptions can be auto deactivated if the receiver continuously returns error status code over a period of time.
true
The reason for the subscription being auto deactivated. May contains the error response that the receiver returned.
"Resthook fails after 10 retries. The last error received was: 500 - Internal server error."
Version of the resthook subscription. Determines the resthook body being fired.
v1, v2, v3 "v3"