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
Field | Type | Required | Description |
---|---|---|---|
userEmails | string[] | Yes | Array of user email addresses to search for |
dateFrom | Date | No | Start date for date range filter |
dateTo | Date | No | End date for date range filter |
Response Schema
Field | Type | Description |
---|---|---|
results | OmnilexResultThread[] | 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": {
...
}
}
]
}