History API

History API

Base URL

The base URL for all endpoints is: https://api.omnilex.ai

Endpoints

Search Results History

POST /results-history/search

Search through historical results based on user emails, and date range.

TypeScript Interfaces

export interface SearchResultsRequest {
  userEmails: string[];
  dateFrom?: Date;
  dateTo?: Date;
}
 
export interface SearchResultsResponse {
  results: OmnilexResultThread[]; // see Legal Research API for more details
}

Parameters

FieldTypeRequiredDescription
userEmailsstring[]YesArray of user email addresses to search for
dateFromDateNoStart date for date range filter
dateToDateNoEnd date for date range filter

Response Schema

FieldTypeDescription
resultsOmnilexResultThread[]Array of matching result objects

Simple example

search-history.js
async function searchResultsHistory(request, token) {
  const response = await fetch('https://api.omnilex.ai/results-history/search', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        Authorization: `Bearer ${token}`,
    },
    body: JSON.stringify({
      userEmails: ["john@example.com"],
      dateFrom: new Date("2024-01-01"),
      dateTo: new Date("2024-01-31")
    }),
  });
 
  if (!response.ok) {
    throw new Error(`Failed to search results: ${response.statusText}`);
  }
 
  const data = await response.json();
  return data.results;
}

Response

{
  "results": [
    {
      "id": "123",
      "date": "2024-01-03",
      "ownerUsername": "john@example.com",
      "can_read": [],
      "can_write": [],
      "status": "COMPLETED",
      "type": "thread",
      "thread": {
        ...
      }
    },
    {
      "id": "124",
      "date": "2024-01-05",
      "ownerUsername": "john@example.com",
      "can_read": [],
      "can_write": [],
      "status": "COMPLETED",
      "type": "thread",
      "thread": {
        ...
      }
    }
  ]
}