Skip to main content
Custom Endpoints let you define serverless-like HTTP endpoints that execute action pipelines — all configured through the REST API. Define a path, choose an HTTP method, configure actions, and your endpoint is live.

Overview

Custom endpoints are dispatched through a dedicated URL namespace:
When a request arrives, SnackBase matches it to an endpoint definition, evaluates authorization conditions, executes the action pipeline, and returns the configured response.

Key Features

  • No Code Required: Define endpoints via API or Admin UI
  • Path Parameters: Support for :param segments (e.g., /users/:user_id/orders)
  • Authorization Conditions: Gate access with rule expressions
  • Action Pipelines: Chain multiple actions with access to results from previous steps
  • Response Templates: Customize response status, body, and headers
  • Execution History: Track every invocation with timing and status

How It Works

Endpoint Definition

Path Parameters

Use :param syntax to capture path segments:
These values are available as {{request.params.user_id}} and {{request.params.order_id}} in action templates.

Uniqueness

Each endpoint is uniquely identified by the combination of (account_id, path, method). You cannot create two endpoints with the same path and method within one account.

Actions

Actions execute sequentially. Each action’s result is available to subsequent actions.

Supported Action Types

Query Records

Aggregate Records

Supported functions: count, sum, avg, min, max.

Transform

Reshape data from previous action results:

Template Variables

All string values in action configs and response templates support these variables:

Response Templates

Customize what your endpoint returns:
If no response template is configured, the endpoint returns HTTP 200 with the last action’s result as the body.

Authorization

Authentication

Set auth_required: true (the default) to require a valid authentication token. Set to false for public endpoints.

Condition Expressions

Add a condition to control who can access the endpoint:
If the condition evaluates to false, the endpoint returns 403 Forbidden.

Example: Customer Order Summary Endpoint

Call it:

Limits