Skip to main content
Endpoints Cover

Overview

Endpoints allow you to create custom API interfaces with secure, controlled access. You can define three types of endpoints:
  1. Query Endpoints - Execute SQL queries on your datasets with dynamic filters
  2. Action Endpoints - Execute serverless Python functions for custom logic
  3. Vector Endpoints - Perform semantic similarity search on vectorized data
Endpoint Detail

Creating Endpoints

  1. Navigate to your Project
  2. Create a new YAML file for your endpoint (e.g., api-orders.yaml)
  3. Define your endpoint configuration
  4. Reference it in your config.yaml file
Create Endpoint Step 1
Create Endpoint Step 2

Endpoint Types

Although the YAML syntax uses an endpoints: array, only one endpoint definition per file is supported. Defining multiple entries in a single file will result in an error. Use a separate YAML file for each endpoint and register each file individually in config.yaml.

Query-Based Endpoints

Query endpoints execute SQL queries on your data with dynamic filtering using Jinja templating. Example YAML Configuration:

Action-Based Endpoints

Action endpoints execute serverless Python functions when called. Perfect for sending notifications, processing data, calling external APIs, or automating workflows. Example YAML Configuration:
The action_id references an action function in your project. Get the ID from your action details page.
The action function must return a list. Returning any other type raises ActionEndpointResultMustBeListError.

Vector-Based Endpoints

Vector endpoints enable semantic similarity search on your vectorized data via HTTP API. Perfect for building search features, recommendation systems, or RAG applications. Example YAML Configuration:
The vector_id references a Vector in your project. Get the ID from your vector details page.

Register in config.yaml

Reference your endpoint file in config.yaml:
Learn more about the configuration file in the Project Configuration section.

Configuration Reference

Common Attributes

Query Config Attributes

Action Config Attributes

Vector Config Attributes

Filter Configuration

Filters are only for query endpoints and define dynamic parameters:

Filter Types

Using Endpoints

Endpoints are accessible via HTTP requests. Query and vector endpoints use GET requests, while action endpoints may vary based on implementation:

Response Format

Query Endpoint Response

Query endpoints return JSON data with query results:

Action Endpoint Response

Action endpoints return the list your Python function returns:
Your action function must return a list. Returning any other type (dict, string, None, etc.) raises ActionEndpointResultMustBeListError. Always wrap your result in a list, even when there is only one item.

Vector Endpoint Response

Vector endpoints return semantically similar results based on your search query:
Using Vector Endpoints:
Query Parameters for Vector Endpoints:

Authentication

Endpoints use API key authentication via the x-api-key header:

Error Responses

Example error response:

Advanced Query Features

Jinja Templating

Endpoints support Jinja templating for dynamic queries:

Caching

Endpoint responses can be cached:
  • Default cache TTL: 60 minutes
  • Cache headers indicate freshness
  • Use cache-busting parameters when needed