Hook Template
Hook template is a definition of hook in Rossum extension store.
Hook template variables
You can use variable substitution in Hook Templates. To use it, surround an available variable like
so {{magic_variable}} anywhere in the request body. If the variable is available, it will be replaced.
If the variable is not available, response will return 500.
Currently available Hook Template variables:
| Variable |
|---|
| api_url |
| webhook_base_domain |
| webhook_domain_prefix |
Hook template
ID of the hook template.
Hook type.
Default:"webhook"Name of the hook template.
URL of the hook template.
List of events, when the hook should be notified. For the list of events see Webhook events.
List of related objects that should be included in hook request. For the list of possible sideloads see Webhook events.
Default:[]Client data. May be used to store e.g. external system object IDs. See Metadata for more details.
Default:{}Configuration of the hook.
Input saved for hook testing purposes, see Test a hook.
Default:{}Hook description text.
Import source of the extension. For more, see Extension sources.
Default:"rossum_store"Specific settings that will be included in the payload when executing the hook.
Default:{}JSON schema for settings field, specifying the JSON structure of this field.
Default:nullJSON schema for secrets field, specifying the JSON structure of this field.
Default:nullDescription how to use the extension.
URL address leading to more info page.
URL address of extension picture.
Description of hook displayed in Rossum store.
External URL to be called (relates to webhook type).
Whether the hook should use token owner.
Default:falseWhether the hook is added directly via application (copy) or on customer's request (request_access).
Default:"copy"Lifetime number of seconds for rossum_authorization_token (min=0, max=7200). This setting will ensure the token will be valid after hook response is returned. If null, default lifetime of 600 is used.
min: 0, max: 7200Default:nullHook templates can be ordered or grouped by this parameter.
Default:0List hook templates
GET api / v1 / hook_templates
Retrieve all hook template objects.
curl -X GET "https://example.rossum.app/api/v1/hook_templates"{
"pagination": {
"next": null,
"previous": null
},
"results": [
{
"id": 1,
"type": "function",
"name": "Document sorting",
"url": "https://example.rossum.app/api/v1/hook_templates/1",
"events": [
"annotation_status.changed"
],
"sideload": [
"queues"
],
"metadata": {
"some_key": "some_value"
},
"config": {
"runtime": "nodejs22.x",
"code": "exports.rossum_hook_request_handler = () => {\nconst messages = [{\"type\": \"info\", \"content\": \"Yup!\"}];\nconst operations = [];\nreturn {\nmessages,\noperations\n};\n};",
"schedule": {
"cron": "*/10 * * * *"
}
},
"test": {},
"description": "Automatically sort documents into specific queues based on document type (i.e. invoice, bill, PO etc.), POs, vendor, total amount, due date, product or locale.",
"extension_source": "rossum_store",
"settings": {},
"settings_schema": null,
"secrets_schema": null,
"guide": "Here we explain how the extension should be used.",
"read_more_url": "https://github.com/rossumai/simple-vendor-matching-webhook-python",
"extension_image_url": "https://rossum.ai/wp-content/themes/rossum/static/img/logo.svg",
"settings_description": [],
"store_description": "<p>Automatically sort documents into specific queues based on document type (i.e. invoice, bill, PO etc.), POs, vendor, total amount, due date, product or locale.</p>",
"external_url": "",
"use_token_owner": true,
"install_action": "copy",
"token_lifetime_s": null,
"order": 0
}
]
}{
"detail": "Bad Request.",
"code": "bad_request"
}{
"detail": "Invalid token.",
"code": "authentication_failed"
}{
"detail": "Access to the requested resource is forbidden.",
"code": "access_forbidden"
}{
"detail": "Not found.",
"code": "not_found"
}{
"detail": "Conflict.",
"code": "conflict_status"
}{
"detail": "Request was rate limited.",
"code": "rate_limited",
"url": "https://rossum.app/api/docs/openapi/guides/overview/#rate-limiting"
}{
"detail": "Server error.",
"code": "error"
}{
"detail": "Bad Gateway.",
"code": "bad_gateway"
}{
"detail": "Service Unavailable.",
"code": "service_unavailable"
}{
"detail": "Gateway timeout.",
"code": "gateway_timeout"
}Response
OK
Invalid input data.
Detail of the error
Code of the error
The username/password is invalid or token is invalid (e.g. expired).
Detail of the error
Code of the error
Insufficient permission, missing authentication, invalid CSRF token and similar issue.
Detail of the error
Code of the error
The specified resource was not found.
Detail of the error
Code of the error
Conflict
Detail of the error
Code of the error
Request rate is too high, wait before sending more requests. See Rate Limiting for more details.
Detail of the error
Code of the error
Link to the rate limiting documentation
Server failure while processing the request.
Detail of the error
Code of the error
Invalid response from the upstream server.
Detail of the error
Code of the error
We're temporarily offline for maintenance. Please try again later.
Detail of the error
Code of the error
Upstream server could not complete the request in time.
Detail of the error
Code of the error
Retrieve hook template
GET api / v1 / hook_templates / {hookTemplateID}
Get a hook template object.
curl -X GET "https://example.rossum.app/api/v1/hook_templates/0"{
"id": 1,
"type": "function",
"name": "Document sorting",
"url": "https://example.rossum.app/api/v1/hook_templates/1",
"events": [
"annotation_status.changed"
],
"sideload": [
"queues"
],
"metadata": {
"some_key": "some_value"
},
"config": {
"runtime": "nodejs22.x",
"code": "exports.rossum_hook_request_handler = () => {\nconst messages = [{\"type\": \"info\", \"content\": \"Yup!\"}];\nconst operations = [];\nreturn {\nmessages,\noperations\n};\n};",
"schedule": {
"cron": "*/10 * * * *"
}
},
"test": {},
"description": "Automatically sort documents into specific queues based on document type (i.e. invoice, bill, PO etc.), POs, vendor, total amount, due date, product or locale.",
"extension_source": "rossum_store",
"settings": {},
"settings_schema": null,
"secrets_schema": null,
"guide": "Here we explain how the extension should be used.",
"read_more_url": "https://github.com/rossumai/simple-vendor-matching-webhook-python",
"extension_image_url": "https://rossum.ai/wp-content/themes/rossum/static/img/logo.svg",
"settings_description": [],
"store_description": "<p>Automatically sort documents into specific queues based on document type (i.e. invoice, bill, PO etc.), POs, vendor, total amount, due date, product or locale.</p>",
"external_url": "",
"use_token_owner": true,
"install_action": "copy",
"token_lifetime_s": null,
"order": 0
}{
"detail": "Bad Request.",
"code": "bad_request"
}{
"detail": "Invalid token.",
"code": "authentication_failed"
}{
"detail": "Access to the requested resource is forbidden.",
"code": "access_forbidden"
}{
"detail": "Not found.",
"code": "not_found"
}{
"detail": "Conflict.",
"code": "conflict_status"
}{
"detail": "Request was rate limited.",
"code": "rate_limited",
"url": "https://rossum.app/api/docs/openapi/guides/overview/#rate-limiting"
}{
"detail": "Server error.",
"code": "error"
}{
"detail": "Bad Gateway.",
"code": "bad_gateway"
}{
"detail": "Service Unavailable.",
"code": "service_unavailable"
}{
"detail": "Gateway timeout.",
"code": "gateway_timeout"
}Response
OK
ID of the hook template.
Hook type.
Default:"webhook"Name of the hook template.
URL of the hook template.
List of events, when the hook should be notified. For the list of events see Webhook events.
List of related objects that should be included in hook request. For the list of possible sideloads see Webhook events.
Default:[]Client data. May be used to store e.g. external system object IDs. See Metadata for more details.
Default:{}Configuration of the hook.
Input saved for hook testing purposes, see Test a hook.
Default:{}Hook description text.
Import source of the extension. For more, see Extension sources.
Default:"rossum_store"Specific settings that will be included in the payload when executing the hook.
Default:{}JSON schema for settings field, specifying the JSON structure of this field.
Default:nullJSON schema for secrets field, specifying the JSON structure of this field.
Default:nullDescription how to use the extension.
URL address leading to more info page.
URL address of extension picture.
Description of hook displayed in Rossum store.
External URL to be called (relates to webhook type).
Whether the hook should use token owner.
Default:falseWhether the hook is added directly via application (copy) or on customer's request (request_access).
Default:"copy"Lifetime number of seconds for rossum_authorization_token (min=0, max=7200). This setting will ensure the token will be valid after hook response is returned. If null, default lifetime of 600 is used.
min: 0, max: 7200Default:nullHook templates can be ordered or grouped by this parameter.
Default:0Invalid input data.
Detail of the error
Code of the error
The username/password is invalid or token is invalid (e.g. expired).
Detail of the error
Code of the error
Insufficient permission, missing authentication, invalid CSRF token and similar issue.
Detail of the error
Code of the error
The specified resource was not found.
Detail of the error
Code of the error
Conflict
Detail of the error
Code of the error
Request rate is too high, wait before sending more requests. See Rate Limiting for more details.
Detail of the error
Code of the error
Link to the rate limiting documentation
Server failure while processing the request.
Detail of the error
Code of the error
Invalid response from the upstream server.
Detail of the error
Code of the error
We're temporarily offline for maintenance. Please try again later.
Detail of the error
Code of the error
Upstream server could not complete the request in time.
Detail of the error
Code of the error