REST API Integration
Complete HTTP API for integrating infaza into your applications with comprehensive endpoints for memory management, agent coordination, and team collaboration.
Quick Start
Get started with the infaza REST API in minutes. The API follows RESTful conventions and returns JSON responses with comprehensive error handling.
curl -X POST "https://api.infaza.dev/v1/memories" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": {
"text": "Important project milestone achieved",
"tags": ["project", "milestone"]
},
"agent_id": "your-agent-id",
"importance": 0.8
}'This example creates a new memory entry with text content and metadata. Replace YOUR_API_KEY with your actual API key.
Authentication
infaza uses API key authentication with support for different access levels and permissions based on your subscription plan.
Production Keys
Full access to all features and production data
sk_prod_...Development Keys
Sandbox environment for testing and development
sk_dev_...Read-Only Keys
Limited to read operations only
sk_ro_...# Header Authentication Authorization: Bearer sk_prod_abc123... # Query Parameter (not recommended) ?api_key=sk_prod_abc123... # Environment Variable export infaza_API_KEY="sk_prod_abc123..."
Always use the Authorization header for security. Query parameters should only be used for testing.
Base URL & Headers
API Configuration
Base URL
https://api.infaza.dev/v1Required Headers
Authorization: Bearer YOUR_API_KEY Content-Type: application/json User-Agent: YourApp/1.0.0 X-Request-ID: unique-request-identifier (optional)
Response Format
All responses are JSON with consistent error formats and HTTP status codes.
Memory Management Endpoints
Core endpoints for creating, retrieving, updating, and deleting memory entries with full CRUD operations.
Create Memory
POSTPOST /memoriesRequest Body
{
"content": {
"text": "Memory content",
"embedding": [0.1, 0.2, ...],
"structured_data": {...},
"media_refs": ["file-id"]
},
"metadata": {
"tags": ["tag1", "tag2"],
"importance": 0.8,
"retention_policy": "30d"
},
"agent_id": "agent-id",
"team_id": "team-id",
"access_level": "private"
}Response
{
"memory_id": "mem_abc123",
"status": "created",
"created_at": "2024-01-01T12:00:00Z",
"encryption": {
"algorithm": "homomorphic",
"key_id": "key_xyz789"
}
}Get Memory
GETGET /memories/{memory_id}Query Parameters
include_content- Include full content (default: true)include_relationships- Include related memoriesdecrypt- Return decrypted content (requires permissions)
Response
{
"memory_id": "mem_abc123",
"content": {...},
"metadata": {...},
"relationships": [...],
"access_info": {
"can_edit": true,
"can_delete": false
}
}Update Memory
PATCHPATCH /memories/{memory_id}Supports partial updates with automatic versioning and conflict resolution. Only provided fields are updated.
Search & Retrieval
Powerful search capabilities including semantic search, temporal queries, and graph traversal for comprehensive memory retrieval.
Semantic Search
POST /search/semanticRequest
{
"query": "machine learning optimization",
"limit": 10,
"threshold": 0.8,
"filters": {
"agent_id": "specific-agent",
"team_id": "team-id",
"tags": ["ml", "optimization"],
"date_range": {
"start": "2024-01-01",
"end": "2024-12-31"
}
},
"include_content": true
}Response
{
"results": [
{
"memory_id": "mem_abc123",
"score": 0.95,
"content": {...},
"metadata": {...}
}
],
"total": 25,
"query_time_ms": 45
}Team Management
Team Operations
POST /teams
POST /teams/{id}/agents
GET /teams/{id}/memories
Webhooks
Real-time notifications for memory updates, team changes, and workflow events with secure webhook delivery.
Webhook Events
Memory Events
- •
memory.created - •
memory.updated - •
memory.deleted - •
memory.shared
Team Events
- •
team.agent_added - •
team.agent_removed - •
team.workflow_completed - •
team.error_occurred
Official SDKs
Official SDKs provide idiomatic integration for popular programming languages with built-in error handling and retry logic.
pip install infazafrom infaza import infaza
client = infaza(api_key="...")
memory = client.memories.create({
"content": {"text": "Hello"},
"agent_id": "agent-123"
})npm install @infaza/sdkimport { infaza } from '@infaza/sdk';
const client = new infaza({
apiKey: process.env.infaza_API_KEY
});
const memory = await client.memories.create({
content: { text: "Hello" },
agentId: "agent-123"
});go get github.com/infaza/go-sdkimport "github.com/infaza/go-sdk"
client := infaza.NewClient("api-key")
memory, err := client.Memories.Create(&infaza.CreateMemoryRequest{
Content: map[string]interface{}{
"text": "Hello",
},
AgentID: "agent-123",
})Rate Limits & Best Practices
- • Implement exponential backoff for retries
- • Cache frequently accessed memories
- • Use batch operations when possible
- • Monitor rate limit headers
- • Implement request queuing