Gateways Reference
Gateways are registered platform services that scripts can call. The "gateway" property in a script definition names the gateway; most use PascalCase, and the platform resolves it to a Spring bean by lowercasing the first letter and appending Gateway.
JSON "gateway": "CompanyRegister" → Spring bean: companyRegisterGateway
See Gateway Scripts for how to wire gateways into script definitions.
Calls made through gateways to external services count against per-tenant rate limits. When a limit is reached the platform returns HTTP 429 and the calling script or import stops. See External Service Limits for configuration and the usage endpoint.
Function gateways
Function gateways enrich an object by returning structured data that is written back to the object's fields.
| Gateway name | Spring bean | Purpose |
|---|---|---|
Echo | echoGateway | Reflects input parameters back as output — useful for testing |
Ai | aiGateway | Extracts structured field values from free-form text using Gemini |
DocumentTriage | documentTriageGateway | Classifies a document and generates a title using Gemini |
MarkdownConversion | markdownConversionGateway | Converts a PDF to Markdown via Google Document AI |
Invoice | invoiceGateway | Extracts structured invoice data from a PDF via Google Document AI |
AddressSearch | addressSearchGateway | Looks up a Dutch address by postal code and house number |
CompanyExtract | companyExtractGateway | Fetches an official company extract PDF (NL only) |
CompanyRegister | companyRegisterGateway | Enriches an object with company data from KvK (NL) or Companies House (GB) |
DataEnrichment | dataEnrichmentGateway | POSTs field values to a configurable HTTPS endpoint and merges the response |
Producer gateways
Producer gateways query an external source and return a result list. They do not modify any object.
| Gateway name | Spring bean | Purpose |
|---|---|---|
CompanySearch | companySearchGateway | Searches a national business register by company name |
companyLookupGateway | companyLookupGateway | Fetches the full company profile for a single company by composite key |
companyRelationsGateway | companyRelationsGateway | Directors, officers, and shareholders for a Dutch company (NL only) |
organizationTreeGateway | organizationTreeGateway | Corporate organisation tree for a Dutch company (NL only) |
Consumer gateways
Consumer gateways call an external service and do not return a result.
| Gateway name | Spring bean | Purpose |
|---|---|---|
Mail | mailGateway | Sends a transactional email |
Replication | replicationGateway | Replicates object data to an external endpoint |
UserInvitation | userInvitationGateway | Creates a user invitation and sends a confirmation email |
Webhook | webhookGateway | Sends an HTTP request to a configurable endpoint |
Function gateway reference
Echo
Script type: functionGateway
Gateway name: Echo
Reflects input parameters directly back as output. Useful for testing gateway wiring or passing computed formula values to target fields without making an external call.
Input: Any parameters — each input parameter is echoed back to the target field with the same name.
Output: One field per declared target, containing the value of the matching input parameter.
{
"name": "test-echo",
"type": "functionGateway",
"scope": "OBJECT",
"trigger": "MANUAL",
"gateway": "Echo",
"parameters": [
{ "name": "greeting", "value": "hello" }
],
"targets": [
{ "name": "greeting", "actionType": "OVERWRITE" }
]
}
Ai
Script type: functionGateway
Gateway name: Ai
Extracts structured field values from free-form text using Gemini (Vertex AI). Each declared target becomes a typed field in the Gemini response schema. The model omits fields it cannot determine with confidence.
Input parameters:
| Name | Type | Required | Description |
|---|---|---|---|
generalInformation | TEXT | Yes | Source text to extract data from |
usePro | BOOLEAN | No | Use the Pro model instead of Flash (default: false) |
<targetName> | TEXT | Per target | Extraction instruction for that target field (e.g. "The invoice total amount") |
Output: One field per declared target, typed according to the target's dataType. Three meta-fields are also available if declared as targets:
| Name | Type | Description |
|---|---|---|
inputTokens | INTEGER | Prompt token count |
outputTokens | INTEGER | Response token count |
estimatedCost | CURRENCY | Estimated API cost |
{
"name": "extract-contract",
"type": "functionGateway",
"scope": "OBJECT",
"trigger": "MANUAL",
"gateway": "Ai",
"parameters": [
{ "name": "generalInformation", "templateFile": "templates/contractText" },
{ "name": "jobTitle", "value": "The job title, if mentioned" },
{ "name": "startDate", "value": "The contract start date" }
],
"targets": [
{ "name": "jobTitle", "actionType": "OVERWRITE" },
{ "name": "startDate", "actionType": "OVERWRITE" }
]
}
See AI Integrations for model configuration.
DocumentTriage
Script type: functionGateway
Gateway name: DocumentTriage
Classifies an uploaded document into one of a set of candidate types and generates a concise title. Uses Gemini Flash on the first 10,000 characters of the document's Markdown content. The type unknown is always available as a fallback when the model cannot classify with confidence.
Input parameters:
| Name | Type | Required | Description |
|---|---|---|---|
markdownContent | LONGTEXT | Yes | Markdown content of the document (produced by MarkdownConversion) |
<typeKey> | TEXT | At least one | A candidate type key (e.g. incorporation.deed) with a short Dutch description as value |
Output:
| Name | Type | Description |
|---|---|---|
documentType | TEXT | One of the provided type keys, or unknown |
title | TEXT | Concise Dutch document title generated by the model |
{
"name": "triage-document",
"type": "functionGateway",
"scope": "OBJECT",
"trigger": "MANUAL",
"gateway": "DocumentTriage",
"parameters": [
{ "name": "markdownContent", "formula": "markdownContent" },
{ "name": "incorporation.deed", "value": "Notariële akte van oprichting" },
{ "name": "annual.report", "value": "Jaarverslag of jaarrekening" }
],
"targets": [
{ "name": "documentType", "actionType": "OVERWRITE" },
{ "name": "title", "actionType": "OVERWRITE" }
]
}
MarkdownConversion
Script type: functionGateway
Gateway name: MarkdownConversion
Converts an uploaded PDF to Markdown using Google Document AI's Layout Processor. The result is typically passed to DocumentTriage or Ai for further processing.
Input parameters:
| Name | Type | Required | Description |
|---|---|---|---|
file | FILE | Yes | The uploaded PDF binary |
Output:
| Name | Type | Description |
|---|---|---|
markdownContent | LONGTEXT | Markdown representation of the document |
status | TEXT | READY on success, ERROR on failure |
pageCount | INTEGER | Number of pages processed |
{
"name": "convert-pdf",
"type": "functionGateway",
"scope": "OBJECT",
"trigger": "CREATE",
"gateway": "MarkdownConversion",
"parameters": [
{ "name": "file", "formula": "uploadedFile" }
],
"targets": [
{ "name": "markdownContent", "actionType": "OVERWRITE" },
{ "name": "pageCount", "actionType": "OVERWRITE" }
]
}
Invoice
Script type: functionGateway
Gateway name: Invoice
Extracts structured invoice data from an uploaded PDF using Google Document AI's Invoice Processor. Currency amounts are returned as typed CURRENCY values in the document's detected currency.
Input parameters:
| Name | Type | Required | Description |
|---|---|---|---|
file | FILE | Yes | The uploaded invoice PDF |
Output: Structured invoice fields as returned by Document AI's Invoice Processor. Currency fields (e.g. amount, amountDue, taxAmount) are typed as CURRENCY.
{
"name": "process-invoice",
"type": "functionGateway",
"scope": "OBJECT",
"trigger": "CREATE",
"gateway": "Invoice",
"parameters": [
{ "name": "file", "formula": "invoiceFile" }
],
"targets": [
{ "name": "amount", "actionType": "OVERWRITE" },
{ "name": "amountDue", "actionType": "OVERWRITE" },
{ "name": "taxAmount", "actionType": "OVERWRITE" }
]
}
AddressSearch
Script type: functionGateway
Gateway name: AddressSearch
Looks up a Dutch address by postal code and house number via the webservices.nl API. Results are cached for 30 days per unique input combination.
Input parameters:
| Name | Type | Required | Description |
|---|---|---|---|
postalCode | TEXT | Yes | Dutch postal code (e.g. 1234AB, spaces allowed) |
houseNumber | INTEGER | Yes | House number |
houseNumberAddition | TEXT | No | House number addition (e.g. A, bis) |
Output:
| Name | Type | Description |
|---|---|---|
postalCode | TEXT | Normalised postal code (e.g. 1234AB) |
streetName | TEXT | Street name |
houseNumber | TEXT | House number |
houseNumberAddition | TEXT | Addition, if present |
address | TEXT | Full formatted address line |
city | TEXT | City name |
municipality | TEXT | Municipality name |
province | TEXT | Province name |
{
"name": "lookup-address",
"type": "functionGateway",
"scope": "OBJECT",
"trigger": "MANUAL",
"gateway": "AddressSearch",
"parameters": [
{ "name": "postalCode", "formula": "postalCode" },
{ "name": "houseNumber", "formula": "houseNumber" }
],
"targets": [
{ "name": "streetName", "actionType": "OVERWRITE" },
{ "name": "city", "actionType": "OVERWRITE" }
]
}
CompanyExtract
Script type: functionGateway
Gateway name: CompanyExtract
Fetches an official company extract PDF via webservices.nl and stores it as a binary file. Currently available for NL only. Cached for 7 days per registration number.
Input parameters:
| Name | Type | Required | Description |
|---|---|---|---|
countryCode | TEXT | Yes | ISO country code. Currently only NL is supported. |
registrationNumber | TEXT | Yes | 8-digit KvK registration number |
Output:
| Name | Type | Description |
|---|---|---|
uri | TEXT | Binary URI of the stored PDF (/binaries/{uuid}), usable directly as a FILE field value |
referenceDate | DATE | Reference date on the extract (yyyy-MM-dd) |
{
"name": "fetch-company-extract",
"type": "functionGateway",
"scope": "OBJECT",
"trigger": "MANUAL",
"gateway": "CompanyExtract",
"parameters": [
{ "name": "countryCode", "value": "NL" },
{ "name": "registrationNumber", "formula": "kvkNumber" }
],
"targets": [
{ "name": "extractFile", "actionType": "OVERWRITE" },
{ "name": "extractDate", "actionType": "OVERWRITE" }
]
}
CompanyRegister
Script type: functionGateway
Gateway name: CompanyRegister
Enriches a data object with company information from a national business register. Skips the lookup if verificationDate is less than 24 hours ago to prevent redundant API calls. Supports the same countries as CompanySearch.
Input parameters:
| Name | Type | Required | Description |
|---|---|---|---|
registrationNumber | TEXT | Yes* | Company registration number |
countryCode | TEXT | Yes* | ISO country code (see CompanySearch for supported countries) |
key | TEXT | Yes* | Composite key COUNTRY:registrationNumber (e.g. NL:12345678) — alternative to the two fields above |
verificationDate | DATETIME | No | If set and within 24 hours, the lookup is skipped |
* Either key or both registrationNumber + countryCode must be provided.
Output:
| Name | Type |
|---|---|
registrationNumber | TEXT |
legalName | TEXT |
registrationDate | DATE |
startDate | DATE |
endDate | DATE |
noMailing | BOOLEAN |
totalEmployees | INTEGER |
rsin | TEXT |
legalForm | TEXT |
legalFormExtended | TEXT |
primaryActivityCode | TEXT |
primaryActivityDescription | TEXT |
visitAddress | TEXT |
visitPostalCode | TEXT |
visitCity | TEXT |
mailingAddress | TEXT |
mailingPostalCode | TEXT |
mailingCity | TEXT |
verificationDate | DATETIME |
{
"name": "enrich-company",
"type": "functionGateway",
"scope": "OBJECT",
"trigger": "MANUAL",
"gateway": "CompanyRegister",
"parameters": [
{ "name": "registrationNumber", "formula": "kvkNumber" },
{ "name": "countryCode", "value": "NL" },
{ "name": "verificationDate", "formula": "verificationDate" }
],
"targets": [
{ "name": "legalName", "actionType": "OVERWRITE" },
{ "name": "visitAddress", "actionType": "OVERWRITE" },
{ "name": "verificationDate", "actionType": "OVERWRITE" }
]
}
DataEnrichment
Script type: functionGateway
Gateway name: DataEnrichment
POSTs the current data object's field values to a configurable HTTPS endpoint and merges the JSON response back into the data object. Only HTTPS endpoints are accepted.
Input parameters:
| Name | Type | Required | Description |
|---|---|---|---|
_apiEndpoint | HYPERLINK | Yes | The HTTPS endpoint to POST to |
_header_<name> | TEXT | No | Additional request headers (e.g. _header_Authorization) |
<fieldName> | any | No | Any non-_ parameter is included in the request body |
Output: The JSON object returned by the endpoint, merged directly into the declared targets.
{
"name": "enrich-external",
"type": "functionGateway",
"scope": "OBJECT",
"trigger": "MANUAL",
"gateway": "DataEnrichment",
"parameters": [
{ "name": "_apiEndpoint", "value": "https://api.example.com/enrich" },
{ "name": "_header_Authorization", "formula": "concat(\"Bearer \", apiToken)" },
{ "name": "companyId", "formula": "externalId" }
],
"targets": [
{ "name": "enrichedStatus", "actionType": "OVERWRITE" }
]
}
Producer gateway reference
CompanySearch
Script type: producerGateway
Gateway name: CompanySearch
Searches a national business register by company name and returns a list of matching companies.
Supported countries:
| Source | Countries |
|---|---|
| KvK | NL |
| Companies House | GB |
| OpenCorporates | DE FR BE AT CH LU IT ES DK SE NO FI IE PL SG HK NZ |
Input parameters:
| Name | Type | Required | Description |
|---|---|---|---|
countryCode | TEXT | Yes | ISO country code (see supported countries above) |
query | TEXT | Yes | Company name search query |
Output: A list of results, each with:
| Name | Type | Description |
|---|---|---|
key | TEXT | Composite key COUNTRY:registrationNumber — pass directly to CompanyRegister or companyLookupGateway |
registrationNumber | TEXT | |
name | TEXT | |
active | BOOLEAN | |
legalForm | TEXT | |
city | TEXT | |
postalCode | TEXT | |
country | TEXT | |
registrationDate | DATE | |
endDate | DATE |
{
"name": "CompanySearch",
"type": "producerGateway",
"scope": "GENERAL",
"gateway": "CompanySearch",
"parameters": [
{ "name": "countryCode", "dataType": "TEXT" },
{ "name": "query", "dataType": "TEXT" }
]
}
CompanyLookup
Script type: producerGateway
Gateway name: companyLookupGateway
Fetches the full company profile for a single company by composite key. Intended for use after a CompanySearch result is selected; pass the key field from the search result directly. Supports the same countries as CompanySearch.
Input parameters:
| Name | Type | Required | Description |
|---|---|---|---|
key | TEXT | Yes | Composite key COUNTRY:registrationNumber (e.g. NL:12345678) |
Output: Same fields as CompanyRegister.
{
"name": "CompanyLookup",
"type": "producerGateway",
"scope": "GENERAL",
"gateway": "companyLookupGateway",
"parameters": [
{ "name": "key", "dataType": "TEXT" }
]
}
CompanyRelations
Script type: producerGateway
Gateway name: companyRelationsGateway
Returns the directors, officers, shareholders, and other position holders for a Dutch company. Data is sourced from the webservices.nl KvK extract (€3.47 per call). Currently available for NL only.
Input parameters:
| Name | Type | Required | Description |
|---|---|---|---|
countryCode | TEXT | Yes | ISO country code. Currently only NL is supported. |
registrationNumber | TEXT | Yes | 8-digit KvK registration number. |
Output: A list of position records — one item per role held at the company.
| Name | Type | Description |
|---|---|---|
relationType | TEXT | SHARES, DIRECTOR, PROXYHOLDER, or OTHER |
subjectRole | TEXT | Role label for the company (always "Company") |
counterpartyRole | TEXT | Role label for the holder ("Shareholder", "Officer", or "Counterparty") |
functionType | TEXT | KvK function type code |
functionTitle | TEXT | Function title |
functionDescription | TEXT | Function description |
functionAuthorizationSigningPower | TEXT | Signing power description |
functionAuthorizationDescription | TEXT | Authorization description |
startDate | DATE | Function start date |
endDate | DATE | Function end date |
authorizationStartDate | DATE | Authorization start date |
authorizationEndDate | DATE | Authorization end date |
dateSince | DATE | Date since the position is held |
personFullName | TEXT | Full name — person holders only |
personFirstName | TEXT | |
personLastName | TEXT | |
personInitials | TEXT | |
personTitle | TEXT | |
personGender | TEXT | |
personDateOfBirth | DATE | |
organizationName | TEXT | Organisation name — organisation holders only |
organizationRegistrationNumber | TEXT | KvK number of the holding organisation |
The holder is either a person or an organisation — the two field groups are mutually exclusive.
{
"name": "CompanyRelations",
"type": "producerGateway",
"scope": "GENERAL",
"gateway": "companyRelationsGateway",
"parameters": [
{ "name": "countryCode", "dataType": "TEXT" },
{ "name": "registrationNumber", "dataType": "TEXT" }
]
}
OrganizationTree
Script type: producerGateway
Gateway name: organizationTreeGateway
Returns the corporate organisation tree for a Dutch company via webservices.nl (€0.10 per call, cached for 30 days). Currently available for NL only. Returns a single record.
Input parameters:
| Name | Type | Required | Description |
|---|---|---|---|
countryCode | TEXT | Yes | ISO country code. Currently only NL is supported. |
registrationNumber | TEXT | Yes | 8-digit KvK registration number. |
Output fields:
| Name | Type | Description |
|---|---|---|
registrationNumber | TEXT | KvK registration number of the root company |
name | TEXT | Company name |
root | OBJECT | Root node of the organisation tree |
Each node in root (and its children, recursively) has:
| Name | Type | Description |
|---|---|---|
id | TEXT | Node identifier |
name | TEXT | Entity name |
type | TEXT | Entity type |
children | ARRAY | Child nodes (same structure) |
{
"name": "OrganizationTree",
"type": "producerGateway",
"scope": "GENERAL",
"gateway": "organizationTreeGateway",
"parameters": [
{ "name": "countryCode", "dataType": "TEXT" },
{ "name": "registrationNumber", "dataType": "TEXT" }
]
}
Consumer gateway reference
Consumer gateway calls that fail with a transient error are automatically retried with a fixed backoff schedule: after 10 seconds, then 60 seconds, then 15 minutes. If all three attempts fail, the platform writes a system.logEntry with category consumer_gateway_retry and level ERROR, containing the gateway name and the last error message.
Errors that are not retried: HTTP 4xx responses (except 429 Too Many Requests). These indicate a configuration or data problem that retrying cannot resolve.
Mail
Script type: consumerGateway
Gateway name: Mail
Sends a transactional email. The body can be a literal value or rendered from a Handlebars template file.
| Parameter | Type | Required | Description |
|---|---|---|---|
to | Yes | Recipient email address | |
subject | TEXT | Yes | Email subject line |
body | TEXTBLOCK | Yes | Email body (HTML or plain text). Use templateFile to render from a template. |
ctaHref | TEXT | No | Call-to-action URL rendered as a button in the email |
ctaName | TEXT | No | Button label for the call-to-action link |
{
"name": "sendWelcomeMail",
"type": "consumerGateway",
"gateway": "Mail",
"scope": "OBJECT",
"trigger": "MANUAL",
"parameters": [
{ "name": "to", "formula": "emailAddress" },
{ "name": "subject", "value": "Welcome to the platform" },
{ "name": "body", "templateFile": "templates/welcomeMail" },
{ "name": "ctaHref", "formula": "sysInfo(\"appUrl\")" },
{ "name": "ctaName", "value": "Open application" }
]
}
Replication
Script type: consumerGateway
Gateway name: Replication
Replicates object data to an external endpoint.
| Parameter | Type | Description |
|---|---|---|
_apiEndpoint | TEXT | Destination endpoint for replication |
UserInvitation
Script type: consumerGateway
Gateway name: UserInvitation
Creates a user invitation for the specified email address. The invitation email is sent automatically after the record is created.
| Parameter | Type | Required | Description |
|---|---|---|---|
email | Yes | Email address to invite | |
firstName | TEXT | No | First name of the invitee |
lastName | TEXT | No | Last name of the invitee |
personRef | TEXT | No | Reference to an existing person object (e.g. /persons/{uuid}) |
Webhook
Script type: consumerGateway
Gateway name: Webhook
Sends an HTTP request to a configurable endpoint when a trigger fires. Use this to notify external systems of data changes without writing a custom integration.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
url | TEXT | Yes | Target URL. Must be HTTPS. |
method | TEXT | No | HTTP method (GET, POST, PUT, etc.). Default: POST. |
payload_<name> | TEXT | No | A payload field. For POST/PUT: assembled into a flat JSON object body. For GET: appended as a query parameter. |
header.<name> | TEXT | No | Additional request header (e.g. header.Authorization). |
All payload values are serialized as strings. Only TEXT values are supported for payload and header parameters.
{
"name": "notifyWebhook",
"type": "consumerGateway",
"gateway": "Webhook",
"scope": "OBJECT",
"trigger": "UPDATE",
"parameters": [
{ "name": "url", "formula": "systemSetting('rulebooks_webhook_url')" },
{ "name": "method", "value": "POST" },
{ "name": "payload_eventType", "value": "COMPANY_UPDATED" },
{ "name": "payload_href", "formula": "_href" }
]
}
This fires on every UPDATE and POSTs {"eventType":"COMPANY_UPDATED","href":"..."} to the configured URL.