Skip to main content
Enterprise Plan FeatureHook Extensions require an Enterprise plan and a self-hosted deployment. They are not available on Onyx Cloud. View plans.

Overview

You provide an HTTP endpoint; Onyx calls it at the right moment, sends a JSON payload, and uses your response to influence what happens next.

Concepts

Hook Points

A hook point is a defined stage in Onyx’s pipeline where custom logic can be injected. Each hook point specifies:
  • When it fires in the pipeline
  • What payload it sends to your endpoint
  • What response it expects back
  • A default timeout and fail strategy
Hook points are intentional — once a hook point is added, Onyx commits to maintaining its payload structure, response format, and behavior — meaning it won’t change in a breaking way without a proper deprecation process.

Hooks

A hook connects a hook point to your HTTPS endpoint. When the hook point is triggered, Onyx POSTs a request to your endpoint and uses your response to continue, modify, or abort the pipeline. Only one hook per hook point is allowed at a time. If your endpoint is unreachable, times out, or returns an invalid response, Onyx follows the fail strategy you configured.

Adding a Hook

1

Connect a hook point

Open Admin Panel → Integrations → Hook Extensions, find the hook point you want to use, and click Connect.
2

Fill in the hook details

Add Hook FormClick Connect. Onyx validates your endpoint with a test request before saving.

Managing a Hook

Once connected, you can:
  • Disconnect Hook — stop calling the endpoint. Requests in flight finish. Click Reconnect to resume
  • Delete — remove the hook

Hook Health

Onyx monitors your endpoint after the hook is registered and connected, displays its current health status. Connected Hook Card Hook Errors in the Last Hour Hook Connection Lost Click the status to open Most Recent Errors and the full error log for the past 30 days. Hook Errors in the Last 30 Days

Document Ingestion

The Document Ingestion hook point lets you intercept every document before it enters the Onyx indexing pipeline. Your endpoint receives the fully-formed document and can filter it out, rewrite its content, or pass it through unchanged. It runs immediately after Onyx’s internal validation and before the indexing pipeline begins — no partial writes have occurred yet.

Input Schema

Onyx sends a POST request to your endpoint once per document with the following JSON body:
All input fields are provided for context only. Your endpoint can only influence the pipeline through the output schema — specifically the sections field.

Metadata Keys by Connector

The keys present in metadata depend on the connector source. Below are a few examples: Example

Output Schema

A successful response from your endpoint must return HTTP 200 and a JSON body:

Authentication

If you configured an API key when registering the hook, Onyx includes it in every request:

Lambda Example

You can use an AWS Lambda function as your hook endpoint by exposing it over HTTPS via a Lambda Function URL. When Onyx calls your endpoint, the request arrives as an API Gateway-style event. Your handler reads the JSON body from event["body"], processes the document, and returns a response with a statusCode and a JSON-encoded body. If you configured an API key on the hook, validate it against the Authorization header in the event before processing.

Testing

Use curl to test your Lambda Function URL before connecting it to Onyx. Pass-through (non-file source):
Rejected (file source):
Once the hook is connected, you can validate end-to-end by adding a File connector and uploading a document. After the connector syncs, search for content from that document in the chat window — if the hook is working correctly, the material should not appear in results since file connector documents are being rejected. File Connector Add File Document Ingestion Test — File Content Not Found

Document Push

The Document Push hook point fires after each document is successfully indexed. Use it to push indexed content to an external destination such as a wiki, data warehouse, or audit log. Unlike Document Ingestion (which runs before indexing and can modify or drop documents), this hook fires after the document has been written to the index.
Document Push only fires for public connectors in single-tenant deployments, and only during incremental syncs — it does not fire during an initial index or a full re-index from the beginning.

Input Schema

Onyx sends a POST request to your endpoint once per successfully indexed document with the following JSON body:
Example

Output Schema

The response body is not used — any 2xx status code is treated as success. Your endpoint can return an empty body or any JSON object.

Authentication

If you configured an API key when registering the hook, Onyx includes it in every request:

Lambda Example

You can use an AWS Lambda function as your hook endpoint by exposing it over HTTPS via a Lambda Function URL.

Testing

Use curl to test your endpoint before connecting it to Onyx:

Query Processing

The Query Processing hook point lets you intercept every user query before it enters the Onyx pipeline. Your endpoint receives the raw query and the user’s identity, and can rewrite the query, reject it entirely, or pass it through unchanged. It runs immediately after the user submits a message, before anything is saved to the database or sent to the LLM.

Input Schema

Onyx sends a POST request to your endpoint with the following JSON body:

Output Schema

A successful response from your endpoint must return HTTP 200 and a JSON body:

Authentication

If you configured an API key when registering the hook, Onyx includes it in every request:

Lambda Example

You can use an AWS Lambda function as your hook endpoint by exposing it over HTTPS via a Lambda Function URL. When Onyx calls your endpoint, the request arrives as an API Gateway-style event. Your handler reads the JSON body from event["body"], processes the query, and returns a response with a statusCode and a JSON-encoded body. If you configured an API key on the hook, validate it against the Authorization header in the event before processing.

Testing

Use curl to test your Lambda Function URL before connecting it to Onyx. Pass-through (no blocked keywords):
Rejected (contains blocked keyword):
Once the hook is connected, you can also validate the logic directly in the Onyx chat window. Try sending a query that contains a blocked keyword (e.g. “ssn” or “phone number”) — you should see the rejection message instead of a response. Queries without blocked keywords should pass through normally. Query Processing Hook Test

Suggesting a New Hook Point

If your use case requires a pipeline injection point that doesn’t exist yet, open a GitHub issue describing:
  • Where in the pipeline you need to inject logic (e.g. after retrieval, before document indexing)
  • What your endpoint would receive — what context does it need to do its job?
  • What your endpoint would return — how should Onyx change its behavior based on your response?
  • Use cases — what problem does this solve? Are other customers likely to need the same point?
The Onyx team reviews proposals and implements hook points that have broad applicability. Once a hook point is added, Onyx commits to maintaining its payload structure, response format, and behavior — meaning it won’t change in a breaking way without a proper deprecation process. Because of this long-term commitment, each proposal is evaluated carefully before being added.