Skip to content

AmgixApi

All URIs are relative to http://localhost:8234

Method HTTP request Description
collectionExists GET /v1/collections/{collection_name}/exists Collection Exists
createCollection POST /v1/collections/{collection_name} Create Collection
deleteCollection DELETE /v1/collections/{collection_name} Delete Collection
deleteCollectionQueue DELETE /v1/collections/{collection_name}/queue Delete Collection Queue
deleteDocument DELETE /v1/collections/{collection_name}/documents/{document_id} Delete Document
deleteDocumentSync DELETE /v1/collections/{collection_name}/documents/{document_id}/sync Delete Document Sync
emptyCollection POST /v1/collections/{collection_name}/empty Empty Collection
getCollectionConfig GET /v1/collections/{collection_name} Get Collection Config
getCollectionQueueInfo GET /v1/collections/{collection_name}/queue/info Get Collection Queue Info
getCollectionStats GET /v1/collections/{collection_name}/stats Get Collection Stats
getDocument GET /v1/collections/{collection_name}/documents/{document_id} Get Document
getDocumentStatus GET /v1/collections/{collection_name}/documents/{document_id}/status Get Document Status
healthCheck GET /v1/health/check Health
healthReady GET /v1/health/ready Readiness Check
listCollections GET /v1/collections List Collections
metricsCurrent GET /v1/metrics/current Metrics Current
metricsDefinitions GET /v1/metrics/definitions Metrics Definitions
metricsPrometheus GET /v1/metrics/prometheus Metrics Prometheus
metricsTrends GET /v1/metrics/trends Metrics Trends
search POST /v1/collections/{collection_name}/search Search
systemInfo GET /v1/system/info System Info
upsertDocument POST /v1/collections/{collection_name}/documents Upsert Document
upsertDocumentSync POST /v1/collections/{collection_name}/documents/sync Upsert Document Sync
upsertDocumentsBulk POST /v1/collections/{collection_name}/documents/bulk Upsert Documents Bulk
version GET /v1/version Version

collectionExists

CollectionExistsResponse collectionExists(collectionName)

Collection Exists

Check if a collection exists. Always returns 200 with exists true or false.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { CollectionExistsRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  const body = {
    // string | Collection name (alphanumeric, underscores, hyphens only)
    collectionName: collectionName_example,
  } satisfies CollectionExistsRequest;

  try {
    const data = await api.collectionExists(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
collectionName string Collection name (alphanumeric, underscores, hyphens only) [Defaults to undefined]

Return type

CollectionExistsResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createCollection

OkResponse createCollection(collectionName, collectionConfig)

Create Collection

Create a new collection. This endpoint creates a new collection with the specified name and vector configurations. It validates the provided model configurations and ensures all required features are supported by the database. Args: collection_name: The unique name for the new collection (alphanumeric, underscores, hyphens only). config: Configuration details for the collection, including vector types and storage options. Returns: An `OkResponse` object indicating the success of the operation. Raises: HTTPException: - 400 if model validation fails or required features are not supported. - 409 if a collection with the same name already exists. - 500 if the collection creation fails in the database.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { CreateCollectionRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  const body = {
    // string | Collection name (alphanumeric, underscores, hyphens only)
    collectionName: collectionName_example,
    // CollectionConfig
    collectionConfig: ...,
  } satisfies CreateCollectionRequest;

  try {
    const data = await api.createCollection(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
collectionName string Collection name (alphanumeric, underscores, hyphens only) [Defaults to undefined]
collectionConfig CollectionConfig

Return type

OkResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteCollection

OkResponse deleteCollection(collectionName)

Delete Collection

Delete a collection. Deletes a collection and all its associated data. This operation is irreversible. Args: collection_name: The name of the collection to delete. Returns: An `OkResponse` object indicating the success of the operation.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { DeleteCollectionRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  const body = {
    // string | Collection name (alphanumeric, underscores, hyphens only)
    collectionName: collectionName_example,
  } satisfies DeleteCollectionRequest;

  try {
    const data = await api.deleteCollection(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
collectionName string Collection name (alphanumeric, underscores, hyphens only) [Defaults to undefined]

Return type

OkResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteCollectionQueue

OkResponse deleteCollectionQueue(collectionName)

Delete Collection Queue

Delete all queue entries for a collection. Removes all documents from the processing queue for a specified collection. This does not affect documents already indexed in the collection. Args: collection_name: The name of the collection for which to delete queue entries. Returns: An `OkResponse` object indicating the success of the operation.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { DeleteCollectionQueueRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  const body = {
    // string | Collection name (alphanumeric, underscores, hyphens only)
    collectionName: collectionName_example,
  } satisfies DeleteCollectionQueueRequest;

  try {
    const data = await api.deleteCollectionQueue(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
collectionName string Collection name (alphanumeric, underscores, hyphens only) [Defaults to undefined]

Return type

OkResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteDocument

OkResponse deleteDocument(collectionName, documentId, requestTimestamp)

Delete Document

Delete a document asynchronously. Queues a document for deletion and returns immediately. The document will be deleted asynchronously. Args: collection_name: The name of the collection. document_id: The unique identifier of the document to delete. Returns: An `OkResponse` object indicating the success of the operation.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { DeleteDocumentRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  const body = {
    // string | Collection name (alphanumeric, underscores, hyphens only)
    collectionName: collectionName_example,
    // string
    documentId: documentId_example,
    // Date | Caller-supplied delete timestamp (UTC)
    requestTimestamp: 2013-10-20T19:20:30+01:00,
  } satisfies DeleteDocumentRequest;

  try {
    const data = await api.deleteDocument(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
collectionName string Collection name (alphanumeric, underscores, hyphens only) [Defaults to undefined]
documentId string [Defaults to undefined]
requestTimestamp Date Caller-supplied delete timestamp (UTC) [Defaults to undefined]

Return type

OkResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteDocumentSync

OkResponse deleteDocumentSync(collectionName, documentId, requestTimestamp)

Delete Document Sync

Delete a document synchronously. Deletes a specific document by its ID from the specified collection and waits for the operation to complete. Args: collection_name: The name of the collection. document_id: The unique identifier of the document to delete. Returns: An `OkResponse` object indicating the success of the operation.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { DeleteDocumentSyncRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  const body = {
    // string | Collection name (alphanumeric, underscores, hyphens only)
    collectionName: collectionName_example,
    // string
    documentId: documentId_example,
    // Date | Caller-supplied delete timestamp (UTC)
    requestTimestamp: 2013-10-20T19:20:30+01:00,
  } satisfies DeleteDocumentSyncRequest;

  try {
    const data = await api.deleteDocumentSync(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
collectionName string Collection name (alphanumeric, underscores, hyphens only) [Defaults to undefined]
documentId string [Defaults to undefined]
requestTimestamp Date Caller-supplied delete timestamp (UTC) [Defaults to undefined]

Return type

OkResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

emptyCollection

OkResponse emptyCollection(collectionName)

Empty Collection

Empty a collection. Removes all documents and their associated vector data from a specified collection, but keeps the collection\'s configuration. Args: collection_name: The name of the collection to empty. Returns: An `OkResponse` object indicating the success of the operation.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { EmptyCollectionRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  const body = {
    // string | Collection name (alphanumeric, underscores, hyphens only)
    collectionName: collectionName_example,
  } satisfies EmptyCollectionRequest;

  try {
    const data = await api.emptyCollection(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
collectionName string Collection name (alphanumeric, underscores, hyphens only) [Defaults to undefined]

Return type

OkResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getCollectionConfig

CollectionConfig getCollectionConfig(collectionName)

Get Collection Config

Get collection configuration. Retrieves the configuration details for a specific collection. Args: collection_name: The name of the collection. Returns: The configuration of the specified collection.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { GetCollectionConfigRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  const body = {
    // string | Collection name (alphanumeric, underscores, hyphens only)
    collectionName: collectionName_example,
  } satisfies GetCollectionConfigRequest;

  try {
    const data = await api.getCollectionConfig(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
collectionName string Collection name (alphanumeric, underscores, hyphens only) [Defaults to undefined]

Return type

CollectionConfig

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getCollectionQueueInfo

QueueInfo getCollectionQueueInfo(collectionName)

Get Collection Queue Info

Get queue statistics for a collection. Retrieves counts of documents in different queue states (queued, requeued, failed). Args: collection_name: The name of the collection. Returns: A `QueueInfo` object with counts for each queue state.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { GetCollectionQueueInfoRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  const body = {
    // string | Collection name (alphanumeric, underscores, hyphens only)
    collectionName: collectionName_example,
  } satisfies GetCollectionQueueInfoRequest;

  try {
    const data = await api.getCollectionQueueInfo(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
collectionName string Collection name (alphanumeric, underscores, hyphens only) [Defaults to undefined]

Return type

QueueInfo

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getCollectionStats

CollectionStatsResponse getCollectionStats(collectionName)

Get Collection Stats

Get persisted collection statistics and queue counts. Returns document counts maintained by the indexing pipeline (not a live physical count), plus queue entry counts by state (same data as ``GET .../queue/info``). Args: collection_name: The name of the collection. Returns: A `CollectionStatsResponse` with `doc_count` and `queue`. Raises: HTTPException: 404 if the collection does not exist.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { GetCollectionStatsRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  const body = {
    // string | Collection name (alphanumeric, underscores, hyphens only)
    collectionName: collectionName_example,
  } satisfies GetCollectionStatsRequest;

  try {
    const data = await api.getCollectionStats(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
collectionName string Collection name (alphanumeric, underscores, hyphens only) [Defaults to undefined]

Return type

CollectionStatsResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getDocument

Document getDocument(collectionName, documentId)

Get Document

Retrieve a single document. Retrieves a specific document by its ID from the specified collection. Args: collection_name: The name of the collection. document_id: The unique identifier of the document to retrieve. Returns: The retrieved `Document` object. Raises: HTTPException: 404 if the document is not found in the collection.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { GetDocumentRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  const body = {
    // string | Collection name (alphanumeric, underscores, hyphens only)
    collectionName: collectionName_example,
    // string
    documentId: documentId_example,
  } satisfies GetDocumentRequest;

  try {
    const data = await api.getDocument(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
collectionName string Collection name (alphanumeric, underscores, hyphens only) [Defaults to undefined]
documentId string [Defaults to undefined]

Return type

Document

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getDocumentStatus

DocumentStatusResponse getDocumentStatus(collectionName, documentId)

Get Document Status

Get document processing status. Retrieves the processing status of a document, including its current state in the queue and any associated messages. Args: collection_name: The name of the collection. document_id: The unique identifier of the document. Returns: A `DocumentStatusResponse` object containing the processing status of the document. Raises: HTTPException: 404 if the document is not found in the collection\'s queue.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { GetDocumentStatusRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  const body = {
    // string | Collection name (alphanumeric, underscores, hyphens only)
    collectionName: collectionName_example,
    // string
    documentId: documentId_example,
  } satisfies GetDocumentStatusRequest;

  try {
    const data = await api.getDocumentStatus(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
collectionName string Collection name (alphanumeric, underscores, hyphens only) [Defaults to undefined]
documentId string [Defaults to undefined]

Return type

DocumentStatusResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

healthCheck

OkResponse healthCheck()

Health

Check API service responsiveness. This endpoint returns a simple \'ok\' status to indicate that the API service is running and able to respond to requests. Returns: An `OkResponse` object with the \'ok\' field set to True, confirming the service\'s responsiveness.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { HealthCheckRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  try {
    const data = await api.healthCheck();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

This endpoint does not need any parameter.

Return type

OkResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

healthReady

ReadyResponse healthReady()

Readiness Check

Check if service is ready to handle requests. Runs four probes: database, rabbitmq, index workers, query workers. Returns 200 if all pass (fully ready), 218 if some fail (partial ready). Response body always includes all four probe results and a ready flag.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { HealthReadyRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  try {
    const data = await api.healthReady();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

This endpoint does not need any parameter.

Return type

ReadyResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Fully ready -
218 Partial ready (some index/query probes not ready) -
503 Service Unavailable (infra down or all encoder roles down) -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listCollections

Array<string> listCollections()

List Collections

List all available collections. Retrieves a list of all collections managed by the application. Returns: A list of strings, where each string is the name of an available collection.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { ListCollectionsRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  try {
    const data = await api.listCollections();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

This endpoint does not need any parameter.

Return type

Array

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

metricsCurrent

Metrics metricsCurrent(window, keys)

Metrics Current

Return the current metrics state for all nodes over the given window (seconds).

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { MetricsCurrentRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  const body = {
    // number | Aggregation window in seconds - 30 or 60. (optional)
    window: 56,
    // Array<string> | Restrict returned metric series to these keys. Omit for all keys. (optional)
    keys: ...,
  } satisfies MetricsCurrentRequest;

  try {
    const data = await api.metricsCurrent(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
window number Aggregation window in seconds - 30 or 60. [Optional] [Defaults to 60]
keys Array<string> Restrict returned metric series to these keys. Omit for all keys. [Optional]

Return type

Metrics

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

metricsDefinitions

Array<MetricDefinitionItem> metricsDefinitions()

Metrics Definitions

Return catalog entries for all known metric keys, their units, and descriptions.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { MetricsDefinitionsRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  try {
    const data = await api.metricsDefinitions();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

This endpoint does not need any parameter.

Return type

Array<MetricDefinitionItem>

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

metricsPrometheus

string metricsPrometheus()

Metrics Prometheus

Expose current cluster metrics in Prometheus text exposition (60s rolling window).

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { MetricsPrometheusRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  try {
    const data = await api.metricsPrometheus();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

This endpoint does not need any parameter.

Return type

string

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: text/plain

HTTP response details

Status code Description Response headers
200 Successful Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

metricsTrends

Array<MetricTrend> metricsTrends(since, until, resolution, keys)

Metrics Trends

Return historical metric buckets for the given time range and resolution. Args: since: Inclusive start of the time range (ISO 8601, UTC assumed if no timezone given). until: Exclusive end of the time range (ISO 8601, UTC assumed if no timezone given). resolution: Bucket size in seconds - 60 for 1-minute, 300 for 5-minute. keys: One or more metric keys to return. Omit to return all keys.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { MetricsTrendsRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  const body = {
    // Date
    since: 2013-10-20T19:20:30+01:00,
    // Date
    until: 2013-10-20T19:20:30+01:00,
    // number | Bucket size in seconds - 60 for 1-minute, 300 for 5-minute. (optional)
    resolution: 56,
    // Array<string> (optional)
    keys: ...,
  } satisfies MetricsTrendsRequest;

  try {
    const data = await api.metricsTrends(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
since Date [Defaults to undefined]
until Date [Defaults to undefined]
resolution number Bucket size in seconds - 60 for 1-minute, 300 for 5-minute. [Optional] [Defaults to 60]
keys Array<string> [Optional]

Return type

Array<MetricTrend>

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Array<SearchResult> search(collectionName, searchQuery)

Search

Perform a search query on a collection. Executes a search query against the specified collection. Args: collection_name: The name of the collection to search. query: The `SearchQuery` object containing the search text, filters, and other parameters. Returns: A list of `SearchResult` objects, where each object represents a search result.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { SearchRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  const body = {
    // string | Collection name (alphanumeric, underscores, hyphens only)
    collectionName: collectionName_example,
    // SearchQuery
    searchQuery: ...,
  } satisfies SearchRequest;

  try {
    const data = await api.search(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
collectionName string Collection name (alphanumeric, underscores, hyphens only) [Defaults to undefined]
searchQuery SearchQuery

Return type

Array<SearchResult>

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

systemInfo

SystemInfoResponse systemInfo()

System Info

Summarize deployment and infrastructure (no connection URLs).

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { SystemInfoRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  try {
    const data = await api.systemInfo();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

This endpoint does not need any parameter.

Return type

SystemInfoResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

upsertDocument

OkResponse upsertDocument(collectionName, document)

Upsert Document

Upsert a single document asynchronously. Adds or updates a single document in the specified collection by placing it into a processing queue. The document will be vectorized and indexed asynchronously. Args: collection_name: The name of the collection to upsert the document into. document: The document object to be upserted. Returns: An `OkResponse` object indicating that the document has been accepted for processing. Raises: HTTPException: 500 if publishing the event to the internal queue fails.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { UpsertDocumentRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  const body = {
    // string | Collection name (alphanumeric, underscores, hyphens only)
    collectionName: collectionName_example,
    // Document
    document: ...,
  } satisfies UpsertDocumentRequest;

  try {
    const data = await api.upsertDocument(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
collectionName string Collection name (alphanumeric, underscores, hyphens only) [Defaults to undefined]
document Document

Return type

OkResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

upsertDocumentSync

OkResponse upsertDocumentSync(collectionName, document)

Upsert Document Sync

Upsert a single document synchronously. Adds or updates a single document in the specified collection and waits for the operation to complete, including vectorization and indexing. Args: collection_name: The name of the collection to upsert the document into. document: The document object to be upserted. Returns: An `OkResponse` object indicating the success of the operation. Raises: HTTPException: - 409 if a document with the same ID and newer timestamp already exists (conflict). - 500 for other internal server errors during processing.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { UpsertDocumentSyncRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  const body = {
    // string | Collection name (alphanumeric, underscores, hyphens only)
    collectionName: collectionName_example,
    // Document
    document: ...,
  } satisfies UpsertDocumentSyncRequest;

  try {
    const data = await api.upsertDocumentSync(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
collectionName string Collection name (alphanumeric, underscores, hyphens only) [Defaults to undefined]
document Document

Return type

OkResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

upsertDocumentsBulk

OkResponse upsertDocumentsBulk(collectionName, bulkUploadRequest)

Upsert Documents Bulk

Upsert multiple documents in bulk asynchronously. Adds or updates multiple documents in the specified collection by placing them into a processing queue. Documents will be vectorized and indexed asynchronously. This method is optimized for bulk operations. Args: collection_name: The name of the collection to upsert the documents into. request: A `BulkUploadRequest` object containing a list of `Document` objects to be upserted. Returns: An `OkResponse` object indicating that the documents have been accepted for processing. Raises: HTTPException: 500 if publishing events to the internal queue fails for any document.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { UpsertDocumentsBulkRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  const body = {
    // string | Collection name (alphanumeric, underscores, hyphens only)
    collectionName: collectionName_example,
    // BulkUploadRequest
    bulkUploadRequest: ...,
  } satisfies UpsertDocumentsBulkRequest;

  try {
    const data = await api.upsertDocumentsBulk(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
collectionName string Collection name (alphanumeric, underscores, hyphens only) [Defaults to undefined]
bulkUploadRequest BulkUploadRequest

Return type

OkResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

version

VersionResponse version()

Version

Return the system version. Returns: A `VersionResponse` object with the system version.

Example

import {
  Configuration,
  AmgixApi,
} from '';
import type { VersionRequest } from '';

async function example() {
  console.log("🚀 Testing  SDK...");
  const api = new AmgixApi();

  try {
    const data = await api.version();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

This endpoint does not need any parameter.

Return type

VersionResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]