Integration Methods

Direct API Integration

Build custom integrations using awRAG's REST API endpoints. This method provides full control and flexibility for custom applications, enterprise integrations, and server-side implementations.

Example: Search Function

Implement document search in your application:

javascript
async function searchDocuments(query, options = {}) {
  const response = await fetch('https://awrag.io/api/v1/search', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.AWRAG_API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      query,
      limit: options.limit || 5,
      projectIds: options.projectIds
    })
  });

  if (!response.ok) {
    throw new Error(`Search failed: ${response.statusText}`);
  }

  const data = await response.json();
  return data.results;
}

Authentication

Two authentication methods are available:

API Keys (Developer Access)

Simple, direct access using your personal API key. Best for server-side applications and development.

text
Authorization: Bearer rbx_YOUR_API_KEY_HERE
OAuth 2.0 (Application Access)

Secure, user-delegated access for applications. Required for accessing user documents on their behalf.

text
Authorization: Bearer oauth_access_token

Use Cases

  • Custom web applications - Integrate document search into your app's UI
  • Enterprise systems - Connect awRAG to CRM, ERP, or internal tools
  • Backend services - Build APIs that leverage awRAG's search capabilities
  • Data pipelines - Automate document processing and analysis workflows
  • Mobile applications - Add intelligent document search to mobile apps
💡 Pro Tip

Start with API keys for development and testing, then implement OAuth 2.0 when you're ready to access user documents in production. This gives you the fastest path to integration.