RAG (1.2.6)

Download OpenAPI specification:

RAG API for the different use cases like create corpus, create index, delete index, generate content api

Service Token Retrieval

Obtaining a Bearer service token to make API requests

Authenticate and retrieve an access token

This endpoint authenticates users and provides access tokens for subsequent API calls. In production additional HTTP response headers like X-Frame-Options, X-XSS-Protection, and Content-Security-Policy would be included to enhance security against common web vulnerabilities. Please note this token expires every hour and a new token can be requested using the same API.

Authorizations:
apiKeyHeader
header Parameters
X-API-KEY
required
string
Request Body schema: application/json
required
clientId
required
string

Unique Allymar defined ID for the client

secret
required
string

Allymar provided client secret information

username
required
string

Name of the user using the system

organizationId
required
string

Allymar defined organization identifier

Responses

Request samples

Content type
application/json
{
  • "clientId": "string",
  • "secret": "string",
  • "username": "string",
  • "organizationId": "string"
}

Response samples

Content type
application/json
{
  • "accessToken": "string",
  • "tokenType": "Bearer",
  • "expiresIn": 3600
}

Indexing

API related to create Patient Index and Add Documents

Create Corpus

This endpoint creates a corpus for the patient

Authorizations:
service
header Parameters
Authorization
required
string

Authentication Bearer token to allow request to be processed. This is the token that is provided during the 'token' API request.

Content-Type
required
string
Default: application/json

Media type of the body of the request.

Request Body schema: application/json
required
patientId
required
string

Unique Allymar defined ID for the patient

metaData
object

provider patient meta data in key value pair

Responses

Request samples

Content type
application/json
{
  • "patientId": "string",
  • "metaData": { }
}

Response samples

Content type
application/json
{
  • "message": "string"
}

check patient Index

Check whether index is created for that patient or not

Authorizations:
service
header Parameters
Authorization
required
string

Authentication Bearer token to allow request to be processed. This is the token that is provided during the 'token' API request.

Content-Type
required
string
Default: application/json

Media type of the body of the request.

Request Body schema: application/json
required
patientId
required
string

Unique Allymar defined ID for the patient

Responses

Request samples

Content type
application/json
{
  • "patientId": "string"
}

Response samples

Content type
application/json
{
  • "message": "string"
}

Add index file to the corpus

This endpoint add the embeddings to the specific corpus.

Authorizations:
service
header Parameters
Authorization
required
string

Authentication Bearer token to allow request to be processed. This is the token that is provided during the 'token' API request.

Content-Type
required
string
Default: application/json

Media type of the body of the request.

Request Body schema: application/json
required
patientId
required
string

Unique Allymar defined ID for the patient

required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "patientId": "string",
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "id": "string"
}

Delete file from Corpus

This endpoint removes the embedding file from the corpus

Authorizations:
service
header Parameters
Authorization
required
string

Authentication Bearer token to allow request to be processed. This is the token that is provided during the 'token' API request.

Content-Type
required
string
Default: application/json

Media type of the body of the request.

Request Body schema: application/json
required
patientId
required
string

Unique Allymar defined ID for the patient

required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "patientId": "string",
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "id": "string"
}

check status of added document

This endpoint is used to check the status of the added document.

Authorizations:
service
header Parameters
Authorization
required
string

Authentication Bearer token to allow request to be processed. This is the token that is provided during the 'token' API request.

Content-Type
required
string
Default: application/json

Media type of the body of the request.

Request Body schema: application/json
required
id
required
string

published Id when you add or remove the document

Responses

Request samples

Content type
application/json
{
  • "id": "string"
}

Response samples

Content type
application/json
[
  • {
    }
]

Context

API related to create Context for the patient

Create Context for the Patient

This endpoint is used to create patient Context which will be used to ask the question

Authorizations:
service
header Parameters
Authorization
required
string

Authentication Bearer token to allow request to be processed. This is the token that is provided during the 'token' API request.

Content-Type
required
string
Default: application/json

Media type of the body of the request.

Request Body schema: application/json
required
patientId
required
string

Unique Allymar defined ID for the patient

sessionId
required
string

Unique Session ID for the login user

documentId
string

specific document to query

Responses

Request samples

Content type
application/json
{
  • "patientId": "string",
  • "sessionId": "string",
  • "documentId": "string"
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "id": "string"
}

Search in Context

Search details based on the context created

get details from the prompt

This endpoint will be used Search The Data from the patient details

Authorizations:
service
header Parameters
Authorization
required
string

Authentication Bearer token to allow request to be processed. This is the token that is provided during the 'token' API request.

Content-Type
required
string
Default: application/json

Media type of the body of the request.

Request Body schema: application/json
required
contextId
required
string

Unique Context Id generated from create Patient Context

userPrompt
required
string

Question which is asked to the AI

Responses

Request samples

Content type
application/json
{
  • "contextId": "string",
  • "userPrompt": "string"
}

Response samples

Content type
application/json
{
  • "message": "string"
}