Skip to main content

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.

note

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 nameSpring beanPurpose
EchoechoGatewayReflects input parameters back as output — useful for testing
AiaiGatewayExtracts structured field values from free-form text using Gemini
DocumentTriagedocumentTriageGatewayClassifies a document and generates a title using Gemini
MarkdownConversionmarkdownConversionGatewayConverts a PDF to Markdown via Google Document AI
InvoiceinvoiceGatewayExtracts structured invoice data from a PDF via Google Document AI
AddressSearchaddressSearchGatewayLooks up a Dutch address by postal code and house number
CompanyExtractcompanyExtractGatewayFetches an official company extract PDF (NL only)
CompanyRegistercompanyRegisterGatewayEnriches an object with company data from KvK (NL) or Companies House (GB)
DataEnrichmentdataEnrichmentGatewayPOSTs 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 nameSpring beanPurpose
CompanySearchcompanySearchGatewaySearches a national business register by company name
companyLookupGatewaycompanyLookupGatewayFetches the full company profile for a single company by composite key
companyRelationsGatewaycompanyRelationsGatewayDirectors, officers, and shareholders for a Dutch company (NL only)
organizationTreeGatewayorganizationTreeGatewayCorporate organisation tree for a Dutch company (NL only)

Consumer gateways

Consumer gateways call an external service and do not return a result.

Gateway nameSpring beanPurpose
MailmailGatewaySends a transactional email
ReplicationreplicationGatewayReplicates object data to an external endpoint
UserInvitationuserInvitationGatewayCreates a user invitation and sends a confirmation email
WebhookwebhookGatewaySends 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:

NameTypeRequiredDescription
generalInformationTEXTYesSource text to extract data from
useProBOOLEANNoUse the Pro model instead of Flash (default: false)
<targetName>TEXTPer targetExtraction 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:

NameTypeDescription
inputTokensINTEGERPrompt token count
outputTokensINTEGERResponse token count
estimatedCostCURRENCYEstimated 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:

NameTypeRequiredDescription
markdownContentLONGTEXTYesMarkdown content of the document (produced by MarkdownConversion)
<typeKey>TEXTAt least oneA candidate type key (e.g. incorporation.deed) with a short Dutch description as value

Output:

NameTypeDescription
documentTypeTEXTOne of the provided type keys, or unknown
titleTEXTConcise 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:

NameTypeRequiredDescription
fileFILEYesThe uploaded PDF binary

Output:

NameTypeDescription
markdownContentLONGTEXTMarkdown representation of the document
statusTEXTREADY on success, ERROR on failure
pageCountINTEGERNumber 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:

NameTypeRequiredDescription
fileFILEYesThe 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:

NameTypeRequiredDescription
postalCodeTEXTYesDutch postal code (e.g. 1234AB, spaces allowed)
houseNumberINTEGERYesHouse number
houseNumberAdditionTEXTNoHouse number addition (e.g. A, bis)

Output:

NameTypeDescription
postalCodeTEXTNormalised postal code (e.g. 1234AB)
streetNameTEXTStreet name
houseNumberTEXTHouse number
houseNumberAdditionTEXTAddition, if present
addressTEXTFull formatted address line
cityTEXTCity name
municipalityTEXTMunicipality name
provinceTEXTProvince 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:

NameTypeRequiredDescription
countryCodeTEXTYesISO country code. Currently only NL is supported.
registrationNumberTEXTYes8-digit KvK registration number

Output:

NameTypeDescription
uriTEXTBinary URI of the stored PDF (/binaries/{uuid}), usable directly as a FILE field value
referenceDateDATEReference 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:

NameTypeRequiredDescription
registrationNumberTEXTYes*Company registration number
countryCodeTEXTYes*ISO country code (see CompanySearch for supported countries)
keyTEXTYes*Composite key COUNTRY:registrationNumber (e.g. NL:12345678) — alternative to the two fields above
verificationDateDATETIMENoIf set and within 24 hours, the lookup is skipped

* Either key or both registrationNumber + countryCode must be provided.

Output:

NameType
registrationNumberTEXT
legalNameTEXT
registrationDateDATE
startDateDATE
endDateDATE
noMailingBOOLEAN
totalEmployeesINTEGER
rsinTEXT
legalFormTEXT
legalFormExtendedTEXT
primaryActivityCodeTEXT
primaryActivityDescriptionTEXT
visitAddressTEXT
visitPostalCodeTEXT
visitCityTEXT
mailingAddressTEXT
mailingPostalCodeTEXT
mailingCityTEXT
verificationDateDATETIME
{
"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:

NameTypeRequiredDescription
_apiEndpointHYPERLINKYesThe HTTPS endpoint to POST to
_header_<name>TEXTNoAdditional request headers (e.g. _header_Authorization)
<fieldName>anyNoAny 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:

SourceCountries
KvKNL
Companies HouseGB
OpenCorporatesDE FR BE AT CH LU IT ES DK SE NO FI IE PL SG HK NZ

Input parameters:

NameTypeRequiredDescription
countryCodeTEXTYesISO country code (see supported countries above)
queryTEXTYesCompany name search query

Output: A list of results, each with:

NameTypeDescription
keyTEXTComposite key COUNTRY:registrationNumber — pass directly to CompanyRegister or companyLookupGateway
registrationNumberTEXT
nameTEXT
activeBOOLEAN
legalFormTEXT
cityTEXT
postalCodeTEXT
countryTEXT
registrationDateDATE
endDateDATE
{
"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:

NameTypeRequiredDescription
keyTEXTYesComposite 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:

NameTypeRequiredDescription
countryCodeTEXTYesISO country code. Currently only NL is supported.
registrationNumberTEXTYes8-digit KvK registration number.

Output: A list of position records — one item per role held at the company.

NameTypeDescription
relationTypeTEXTSHARES, DIRECTOR, PROXYHOLDER, or OTHER
subjectRoleTEXTRole label for the company (always "Company")
counterpartyRoleTEXTRole label for the holder ("Shareholder", "Officer", or "Counterparty")
functionTypeTEXTKvK function type code
functionTitleTEXTFunction title
functionDescriptionTEXTFunction description
functionAuthorizationSigningPowerTEXTSigning power description
functionAuthorizationDescriptionTEXTAuthorization description
startDateDATEFunction start date
endDateDATEFunction end date
authorizationStartDateDATEAuthorization start date
authorizationEndDateDATEAuthorization end date
dateSinceDATEDate since the position is held
personFullNameTEXTFull name — person holders only
personFirstNameTEXT
personLastNameTEXT
personInitialsTEXT
personTitleTEXT
personGenderTEXT
personDateOfBirthDATE
organizationNameTEXTOrganisation name — organisation holders only
organizationRegistrationNumberTEXTKvK 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:

NameTypeRequiredDescription
countryCodeTEXTYesISO country code. Currently only NL is supported.
registrationNumberTEXTYes8-digit KvK registration number.

Output fields:

NameTypeDescription
registrationNumberTEXTKvK registration number of the root company
nameTEXTCompany name
rootOBJECTRoot node of the organisation tree

Each node in root (and its children, recursively) has:

NameTypeDescription
idTEXTNode identifier
nameTEXTEntity name
typeTEXTEntity type
childrenARRAYChild 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.

ParameterTypeRequiredDescription
toEMAILYesRecipient email address
subjectTEXTYesEmail subject line
bodyTEXTBLOCKYesEmail body (HTML or plain text). Use templateFile to render from a template.
ctaHrefTEXTNoCall-to-action URL rendered as a button in the email
ctaNameTEXTNoButton 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.

ParameterTypeDescription
_apiEndpointTEXTDestination 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.

ParameterTypeRequiredDescription
emailEMAILYesEmail address to invite
firstNameTEXTNoFirst name of the invitee
lastNameTEXTNoLast name of the invitee
personRefTEXTNoReference 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:

NameTypeRequiredDescription
urlTEXTYesTarget URL. Must be HTTPS.
methodTEXTNoHTTP method (GET, POST, PUT, etc.). Default: POST.
payload_<name>TEXTNoA payload field. For POST/PUT: assembled into a flat JSON object body. For GET: appended as a query parameter.
header.<name>TEXTNoAdditional 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.