Skip to main content

REST API

Complete HTTP API reference for integrating Trix with any language or platform.

Overview

The Trix REST API provides direct HTTP access to all Trix functionality. Use it to integrate memory capabilities into any application, regardless of programming language or platform.

If you're using Python, TypeScript, or C#, consider using the official SDKs for a more ergonomic experience. The REST API is ideal for other languages or when you need fine-grained control.

Base URL

All API requests should be made to:

API Base URL
https://api.trixdb.com/v1

For self-hosted deployments, replace with your instance URL.

Content Type

All requests and responses use JSON. Include these headers:

Content-Type: application/json
Accept: application/json

Quick Start

Here's a quick example of creating and searching memories:

1. Create a Memory

create.sh
curl -X POST "https://api.trixdb.com/v1/memories" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content": "User prefers dark mode", "tags": ["preferences"]}'

2. Search Memories

search.sh
curl -X GET "https://api.trixdb.com/v1/memories?q=user+preferences" \
  -H "Authorization: Bearer YOUR_API_KEY"

API Reference

The REST API is organized into the following sections:

All Endpoints

Authentication

MethodEndpointDescription
POST/auth/registerUser registration
POST/auth/loginUser login
GET/auth/meGet current user
POST/auth/change-passwordChange password

Memories

MethodEndpointDescription
POST/memoriesCreate memory
GET/memoriesList/search memories
GET/memories/:idGet memory
PATCH/memories/:idUpdate memory
DELETE/memories/:idDelete memory
POST/memories/bulkBulk create

Relationships

MethodEndpointDescription
POST/relationships/:memoryIdCreate relationship
GET/relationships/:memoryIdList relationships
DELETE/relationships/:memoryId/:targetIdDelete relationship

Graph

MethodEndpointDescription
POST/graph/traverseMulti-hop traversal
POST/graph/contextExtract subgraph
POST/graph/pathFind paths

Spaces & Clusters

MethodEndpointDescription
POST/spacesCreate space
GET/spacesList spaces
POST/clustersCreate cluster
GET/clustersList clusters

Webhooks

MethodEndpointDescription
POST/webhooksCreate webhook
GET/webhooksList webhooks
POST/webhooks/:id/testTest webhook

Next Steps