Programming API

Programmable API

Use the Zuplo runtime APIs in your custom handlers and policies to work with requests, responses, cached data, and gateway services. This index groups the references by what you need to do.

Requests and responses

These APIs provide request data, execution context, and response helpers:

APIPurpose
ZuploRequestAccess request parameters, query values, and authenticated user data.
ZuploContextAccess the request ID, logger, route information, and event hooks.
RequestUserRepresent the authenticated caller's identity and data.
HttpProblemsCreate HTTP problem responses.
HttpStatusCodeReference standard HTTP status codes.
ProblemResponseFormatterFormat HTTP problem details.
CorsPolicyConfigurationConfigure a custom CORS policy.

Caching and data

Choose an API for the data you need to store or load:

APIPurpose
ZoneCacheStore key-value data within a zone.
MemoryZoneReadThroughCacheCache values in memory with automatic loading.
StreamingZoneCacheCache streaming responses.
ContextDataStore typed context data.
BackgroundLoaderLoad and cache data in the background.
BackgroundDispatcherEnqueue work for batch processing in the background.

Runtime extensions and hooks

These APIs extend runtime behavior and handle errors:

APIPurpose
RuntimeExtensionsRegister plugins, request and response hooks, and custom error handling.
Request/response hooksRun code at request and response lifecycle events.
RuntimeErrorRepresent a runtime error.
ConfigurationErrorRepresent a configuration error.

Environment and services

These APIs provide environment values, logging, and platform services:

APIPurpose
environmentRead environment variables.
LoggerWrite structured log messages.
ZuploServicesCreate identity tokens with getIDToken to authenticate gateway requests to external services.

Handlers

A route's handler determines how the gateway responds to a request:

HandlerPurpose
awsLambdaHandlerInvoke an AWS Lambda function.
mcpServerHandlerExpose API operations through MCP.
openApiSpecHandlerServe an OpenAPI specification.
redirectHandlerReturn a redirect response.
urlForwardHandlerForward requests to a backend.
urlRewriteHandlerRewrite the URL used to call a backend.
webSocketHandlerHandle WebSocket connections.
Custom functionImplement a handler in your own code.

Plugins

For setup instructions, see the logging and metrics guides. These integrations are also available through runtime plugins:

PluginIntegration
AWSLoggingPluginAWS CloudWatch logging
DataDogLoggingPluginDatadog logging
DynaTraceLoggingPluginDynatrace logging
GoogleCloudLoggingPluginGoogle Cloud Logging
LokiLoggingPluginGrafana Loki logging
NewRelicLoggingPluginNew Relic logging
SplunkLoggingPluginSplunk logging
SumoLogicLoggingPluginSumo Logic logging
VMWareLogInsightLoggingPluginVMware Log Insight logging
DataDogMetricsPluginDatadog metrics
DynatraceMetricsPluginDynatrace metrics
NewRelicMetricsPluginNew Relic metrics
AzureBlobPluginAzure Blob Storage
AzureEventHubsRequestLoggerPluginAzure Event Hubs logging
HydrolixRequestLoggerPluginHydrolix
AkamaiApiSecurityPluginAkamai API security
Last modified on