Core

Start - Start a new session

get

This endpoint starts a new session that can be used in subsequent API calls. By default it will start a session using the live version of the given knowledge map. If no version has been set live it will default to using the draft version. Alternatively the query parameters “useDraft” or “version” can be used as an override to request either the draft or a specific version.

Authorizations
Path parameters
kmIDstringRequired

The knowledge map ID to start a session against

Query parameters
useDraftbooleanOptional

Flag to use the draft version of the knowledge map, cannot be used simultaneously with 'version' parameter

versionintegerOptional

Parameter to use a specific version of the map, cannot be used simultaneously with 'useDraft' parameter

Responses
200
Session start information
application/json
get
GET /start/{kmID} HTTP/1.1
Host: api.rainbird.ai
X-API-Key: YOUR_API_KEY
Accept: */*
200

Session start information

{
  "id": "12345678-1234-1234-1234567890ac",
  "kmVersion": {
    "id": "abcdefgh-abcd-abcd-abcdefghijkl"
  }
}

Inject - Inject facts into a session

post
Path parameters
sessionIDstringRequired

The session to inject facts into

Bodyobject[]
subjectstringRequired

The subject side concept instance or value

relationshipstringRequired

The relationship between subject and object

objectone ofRequired

The object side concept instance or value

stringOptional
or
numberOptional
or
booleanOptional
certaintynumber · min: 1 · max: 100Required

How certain this fact or answer is

Responses
200
Facts were injected successfully
application/json
post
POST /{sessionID}/inject HTTP/1.1
Host: api.rainbird.ai
Content-Type: application/json
Accept: */*
Content-Length: 323

[
  {
    "subject": "John",
    "relationship": "lives in",
    "object": "England",
    "certainty": 100
  },
  {
    "subject": "Will",
    "relationship": "lives in",
    "object": "England",
    "certainty": 100
  },
  {
    "subject": "Ellie",
    "relationship": "lives in",
    "object": "England",
    "certainty": 100
  },
  {
    "subject": "David",
    "relationship": "lives in",
    "object": "England",
    "certainty": 100
  }
]
200

Facts were injected successfully

{
  "result": "OK"
}

Query - Query a running session

post
Path parameters
sessionIDstringRequired

The session to query against

Body
subjectstringOptional

The subject side concept instance or value

relationshipstringRequired

The relationship between subject and object

objectone ofOptional

The object side concept instance or value

stringOptional
or
numberOptional
or
booleanOptional
Responses
200
An answer if one is reached, or a question
application/json
Responseone of
or
post
POST /{sessionID}/query HTTP/1.1
Host: api.rainbird.ai
Content-Type: application/json
Accept: */*
Content-Length: 42

{
  "subject": "John",
  "relationship": "speaks"
}
200

An answer if one is reached, or a question

{
  "result": [
    {
      "subject": "text",
      "relationshipType": "text",
      "object": "text",
      "certainty": 1,
      "factID": "text",
      "relationship": "text",
      "subjectMetadata": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "objectMetadata": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    }
  ],
  "queryProfile": [],
  "sid": "text",
  "stats": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}

Response - Respond to an asked question

post
Path parameters
sessionIDstringRequired

The session to send responses to

Body
Responses
200
An answer if one is reached, or a question
application/json
Responseone of
or
post
POST /{sessionID}/response HTTP/1.1
Host: api.rainbird.ai
Content-Type: application/json
Accept: */*
Content-Length: 93

{
  "answers": [
    {
      "subject": "John",
      "relationship": "lives in",
      "object": "England",
      "certainty": 100
    }
  ]
}
200

An answer if one is reached, or a question

{
  "result": [
    {
      "subject": "text",
      "relationshipType": "text",
      "object": "text",
      "certainty": 1,
      "factID": "text",
      "relationship": "text",
      "subjectMetadata": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "objectMetadata": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    }
  ],
  "queryProfile": [],
  "sid": "text",
  "stats": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}

Undo - Undoes previous interaction with the engine

post
Path parameters
sessionIDstringRequired

The session to step back with an undo

Body
objectOptional
Responses
200
Session stepped back to a previous question or answer
application/json
Responseone of
or
post
POST /{sessionID}/undo HTTP/1.1
Host: api.rainbird.ai
Content-Type: application/json
Accept: */*
Content-Length: 2

{}
200

Session stepped back to a previous question or answer

{
  "result": [
    {
      "subject": "text",
      "relationshipType": "text",
      "object": "text",
      "certainty": 1,
      "factID": "text",
      "relationship": "text",
      "subjectMetadata": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "objectMetadata": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    }
  ],
  "queryProfile": [],
  "sid": "text",
  "stats": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}

Version - Reports engine version

get
Responses
200
Engine version (semver)
text/plain
ResponsestringExample: 2.34.5
get
GET /version HTTP/1.1
Host: api.rainbird.ai
Accept: */*
200

Engine version (semver)

2.34.5