Hook Extensions are an Enterprise Edition feature and are only available on single-tenant deployments.
Overview
Hook Extensions let you inject custom logic into Onyx’s pipeline at defined stages — without modifying Onyx source code. 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
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.How It Works
Onyx POSTs to your endpoint
If an active hook is configured for that point, Onyx sends a JSON payload to your endpoint URL.
Adding a Hook
Fill in the hook details
Complete the form:

| Field | Required | Description |
|---|---|---|
| Display Name | Yes | A human-readable label for this hook |
| Fail Strategy | No | Hard — abort the pipeline. Soft — log and continue. Defaults to the hook point’s recommended strategy |
| Timeout | No | Seconds to wait for your endpoint to respond (1–600). Defaults to the hook point’s recommended timeout |
| Endpoint URL | Yes | The HTTPS URL Onyx will POST to when the hook point is triggered. Must use HTTPS. |
| API Key | No | If provided, Onyx sends this as Authorization: Bearer <api_key> on every request |
Managing a Hook
Once connected, you can:- Activate / Deactivate — toggle whether the hook runs
- Edit — update the name, endpoint URL, API key, timeout, or fail strategy
- Delete — remove the hook entirely
- View Logs — inspect recent execution failures for debugging
Hook Health
Onyx monitors your endpoint after the hook is registered and connected, displays its current health status.| Status | Meaning |
|---|---|
| Reachable, no failures in the last hour | |
| Reachable, but failures occurred in the last hour | |
| Onyx cannot reach your endpoint |
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.| Setting | Value |
|---|---|
| Default Timeout | 30 seconds (configurable) |
| Default Fail Strategy | Hard (configurable) |
| On Hard Fail | The document will not be indexed |
Input Schema
Onyx sends aPOST 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.| Field | Type | Required | Description |
|---|---|---|---|
document_id | string | Yes | Unique identifier for the document. |
title | string | null | Yes | Title of the document. |
semantic_identifier | string | Yes | Human-readable identifier used for display (e.g. file name, page title). |
source | string | Yes | Connector source type. For the full list of possible values, see DocumentSource in the Onyx source code. |
sections | object[] | Yes | All sections of the document — both text sections and image sections. |
sections[].text | string | null | Yes | Text content. Set for text sections, null for image sections. |
sections[].link | string | null | No | Optional URL associated with this section. |
sections[].image_file_id | string | null | No | Opaque image identifier. Set for image sections, null for text sections. Image content is not included — hooks can reorder or drop image sections but cannot read or modify the image. |
metadata | object | Yes | Key-value metadata. Values are always string[]. |
doc_updated_at | string | null | Yes | Timestamp of the last update at the source in the format YYYY-MM-DDTHH:MM:SS.ffffff+00:00, or null if unknown. |
primary_owners | object[] | null | Yes | Primary owners of the document, or null if not available. |
primary_owners[].display_name | string | null | No | Human-readable name of the owner. |
primary_owners[].email | string | null | No | Email address of the owner. |
secondary_owners | object[] | null | Yes | Secondary owners of the document, or null if not available. |
secondary_owners[].display_name | string | null | No | Human-readable name of the owner. |
secondary_owners[].email | string | null | No | Email address of the owner. |
Output Schema
A successful response from your endpoint must return HTTP200 and a JSON body:
| Field | Type | Required | Description |
|---|---|---|---|
sections | object[] | null | Yes | The sections to index, using the same schema as the input sections. The hook controls final ordering. null or empty list drops the document. |
rejection_reason | string | null | No | Logged when sections is null or empty. Falls back to a generic message if omitted. |
Example: Pass through unchanged
Example: Pass through unchanged
Example: Rewrite content (PII redaction)
Example: Rewrite content (PII redaction)
Example: Drop the document
Example: Drop the document
Authentication
If you configured an API key when registering the hook, Onyx includes it in every request: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. This is the earliest possible point in the pipeline — no side effects have occurred yet.| Setting | Value |
|---|---|
| Default Timeout | 5 seconds (configurable) |
| Default Fail Strategy | Hard (configurable) |
| On Hard Fail | The query will be blocked and the user will see an error message |
Input Schema
Onyx sends aPOST request to your endpoint with the following JSON body:
| Field | Type | Required | Description |
|---|---|---|---|
query | string | Yes | The raw query exactly as the user typed it. |
user_email | string | null | Yes | Email of the user submitting the query, or null if unauthenticated. |
chat_session_id | string | Yes | UUID of the chat session. |
Output Schema
A successful response from your endpoint must return HTTP200 and a JSON body:
| Field | Type | Required | Description |
|---|---|---|---|
query | string | null | Yes | The query to use downstream. Set to null or empty string to reject the query. |
rejection_message | string | null | No | Message shown to the user when query is null. Falls back to a generic message if omitted. |
Example: Pass through unchanged
Example: Pass through unchanged
Example: Rewrite the query
Example: Rewrite the query
Example: Reject the query
Example: Reject the query
Authentication
If you configured an API key when registering the hook, Onyx includes it in every request: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?