NavigationTap to open

REST API Integration

Complete HTTP API for integrating infaza into your applications with comprehensive endpoints for memory management, agent coordination, and team collaboration.

HTTP/RESTOpenAPI 3.0Production Ready

Quick Start

Get started with the infaza REST API in minutes. The API follows RESTful conventions and returns JSON responses with comprehensive error handling.

Your First API Call
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.

API Key Types

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_...
Authentication Example
# 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/v1

Required 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

POST
POST /memories

Request 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

GET
GET /memories/{memory_id}

Query Parameters

  • include_content - Include full content (default: true)
  • include_relationships - Include related memories
  • decrypt - Return decrypted content (requires permissions)

Response

{
  "memory_id": "mem_abc123",
  "content": {...},
  "metadata": {...},
  "relationships": [...],
  "access_info": {
    "can_edit": true,
    "can_delete": false
  }
}

Update Memory

PATCH
PATCH /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/semantic

Request

{
  "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

Create Team

POST /teams

Create
Add Agent to Team

POST /teams/{id}/agents

Manage
Team Memory Access

GET /teams/{id}/memories

Read

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.

Python SDK
pip install infaza
from infaza import infaza

client = infaza(api_key="...")
memory = client.memories.create({
  "content": {"text": "Hello"},
  "agent_id": "agent-123"
})
Node.js SDK
npm install @infaza/sdk
import { 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 SDK
go get github.com/infaza/go-sdk
import "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

Rate Limits
Standard Plan1,000 req/min
Pro Plan5,000 req/min
EnterpriseCustom limits
Best Practices
  • • Implement exponential backoff for retries
  • • Cache frequently accessed memories
  • • Use batch operations when possible
  • • Monitor rate limit headers
  • • Implement request queuing