πŸ“Search API

This section explains different REST APIs which enable the users to insert or search data within Engines.

List Private Engines

GET /v1/engine/user/list

This endpoint allows the users to list all the Private Engines associated with a private API key.

x-api-key: user private api key

Request Example:

curl --location --request GET \
'https://api.sepana.io/v1/engine/user/list' \
--header 'x-api-key: <replace-with-your-api-key>'
Private Engines: Response
[
    {
        "engine_id": "<engine-id-1>",
        "engine_name": "<engine-name-1>",
        "namespace": "4439953c-885a-4cb0-b895-b2e0c186f073",
        "network": "",
        "total_records": 186,
        "total_size": 23178,
        "created_at": {
            "val": "11/24/2022 12:29:15 PM ",
            "_spec_type": "<class 'datetime.datetime'>"
        }
    },
    {
        "engine_id": "<engine-id-2>",
        "engine_name": "<engine-name-2>",
        "namespace": "4439953c-885a-4cb0-b895-b2e0c186f073",
        "network": "",
        "total_records": 410,
        "total_size": 48688,
        "created_at": {
            "val": "11/25/2022 01:11:23 PM ",
            "_spec_type": "<class 'datetime.datetime'>"
        }
    }
]

List Public Engines

GET /v1/engine/public/list

This endpoint allows the users to list all the Public Engines existing within Sepana via any private API key belonging to them.

Header:

Request Example:

Public Engines: Response

Insert Data

POST /v1/engine/insert_data

This endpoint is responsible for ingesting the data within a Sepana Engine. The data is provided in the form of JSON documents. Upon successful call to this endpoint, an internal data indexing job is created which is responsible for persisting the data. A maximum of 500 records can be inserted at a time.

Note: While ingesting the data, users can send unique _id along with each record. This acts as an identifier for that row in the dataset. If not specified explicitly by the user, Sepana automatically assigns one to each row.

Example below:

RfEFzoQBxqv6fmT099iM and RvELzoQBxqv6fmT0odgB are system generated identifiers (_id) for the two records present within <engine-id-1>. If the user wants to update the data within these two data points in future, they can simply create an ingestion request with new data while adding _id identifier to it. This will overwrite the older data present with _id.

Header:

Parameters:

Request Example:

Insert Data: Response

Delete Data

DELETE /v1/engine/data/delete

This endpoint is responsible for deleting data from a Sepana Engine. The users can delete the data providing delete_query and engine_id as inputs. Users can initially perform search with a query and delete those records using the same query as delete_query. To perform deletion, the user must own an API key for an Engine with a minimum of Admin access.

Header:

Parameters:

Request Example:

Delete the records from Engine "a88d58e6-15bf-409c-a09d-84603894c56e" where user_name is Louis Pearson

Delete Data: Response

Engine Remapping

POST /v1/engine/remap_fields

This endpoint allows users to reconfigure Engines for which they have admin access. It allows users to redefine and update the field data types. Upon calling this endpoint, an asynchronous pipeline is created which updates the data mapping of the engines based on the past configurations. The example mentioned updates the Engine mapping from previous endpoint (/engine/insert_data). Changes field "age" from "float" to "integer" and adds another field "expense" with data type "integer"

Header:

Parameters:

Request Example:

Engine Remmaping: Response

Job Status

GET /v1/job/status/{job_id}

Both Data Ingestion and Engine Reconfiguration are long running tasks. The system, therefore, creates asynchronous pipelines to execute those tasks. Every task is assigned a Job ID. You can track and update Job IDs using this endpoint.

Header:

Parameters:

Request Example:

Job Status: Response

POST /v1/search

This endpoint allows users to search through data in a single or multiple Engines. There are various filters and options to choose from.

Header:

Parameters:

Request Examples:

Search: Response

Last updated

Was this helpful?