Skip to main content

Overview

This guide provides detailed instructions for frontend developers to integrate with the Conformly.ai Backend API. The API follows RESTful principles with comprehensive authentication, error handling, and real-time job processing.

Base Configuration

API Base URL

https://your-api-domain.com/api/v1

Authentication

All API requests require a valid Supabase JWT token in the Authorization header:
const headers = {
  'Authorization': `Bearer ${supabaseToken}`,
  'Content-Type': 'application/json'
}

Quick Start Example

// Get user profile
const getUserProfile = async (token) => {
  const response = await fetch('/api/v1/auth/me', {
    headers: {
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json'
    }
  });
  
  if (!response.ok) {
    throw new Error('Failed to get user profile');
  }
  
  return await response.json();
};

Common Patterns

File Upload Flow

  1. Initialize upload
  2. Upload file to presigned URL
  3. Complete upload

Analysis Tracking Flow

  1. Start analysis (returns immediately)
  2. List analyses for the workspace to view status (pending, processing, completed, error)
  3. Get analysis by ID to access gaps and recommendations when completed

Error Handling

All endpoints return consistent error responses:
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human readable error message",
    "details": {},
    "timestamp": "2024-01-15T10:30:00Z",
    "request_id": "req_123456789"
  }
}

Response Formats

Paginated Response

{
  "items": [...],
  "total": 100,
  "page": 1,
  "limit": 20,
  "next_cursor": "cursor_string"
}
Polling job status is no longer required. Persisted analyses expose status and timestamps directly.

Complete Integration Guide

View the complete frontend integration guide with examples

API Reference

Browse all API endpoints