Data sources APIs

The Data sources APIs empower Hyperflow users to create ,update, ingest, delete and retrieve data sources

/admin/datasources/get
Retrieve the information about your existing Data sources
REST API
GET /admin/datasources/get
Input query parameters
id
Optional
if provided, this API returns information about the data sources matching the id provided. Otherwise, it returns the full list of data sources.
Example of a call to retrieve the full list of Data sources:
curl https://{{ tenant }}.lightenup.ai/admin/datasources/get \
--request GET \
--header "Authorization: Bearer xyz"
Example a call to retrieve a particular  Data sources:
curl https://{{ tenant }}.lightenup.ai/admin/datasources/get?id={{id}} \
--request GET \
--header "Authorization: Bearer xyz"

Outputs
Response Code
200

This API returns an array of Data Sources  in JSON format:

id
Id of the Data source retrieved
name
Name of the Datasource
source_type
Type of source: s3, postgresql,...
state
The current state,
0 - disabled an 1 - enabled
created_at
Date and time of Policy creation
last_updated
Date and of Policy latest update
Response example:
{ 
  "id": "52fa41b7-021d-4efc-af6f-9f1e9e19b3a9",
  "name": "code_of_conduct",
  "description": "This policy contains our company codes of conduct for internal communications",
  "content": "- Please be polite and professional. \n - No Vulgar language. \n -No racist remarks, sexually oriented remarks, or religious persecution will be tolerated; any such remarks will trigger the immediate termination of the chat session.",
  "created_at": "2024-02-16T20:23:54.025Z",
  "last_update": "2024-02-16T20:23:54.025Z"
}

Response Code
400

Error message in JSON format:

message
Error message
Response Example:
{ 
  "message": "Missing required parameters"
}

Response Code
500

Error message in JSON format:

message
Internal server error
Response exdmple:
{ 
  "message": "Internal Server error"
}
/admin/datasources/create
Creates a new Data source
REST API
POST /admin/datasources/create
Input Body parameters (JSON)
name
required
Name of the Policy to be created
description
required
Description of the Policy to be created
content
required
The Policy in plain text or markdown
Example of a call to create API:
curl https://{{ tenant }}.lightenup.ai/admin/policies/create
--request POST \
--header "Authorization: Bearer xyz" \
--header "Content-Type: application/json" \
--data @- << EOF
{
 "name": "code_of_conduct",
 "description": "This policy contains our company codes of ..",
 "content": "- Please be polite and professional. \n - No vulgar.."
}
EOF


Outputs
Response Code
200

This API returns a response payload that follows this JSON schema:

message
Data source created
id
The id of the Data source created
Response example:
{ 
  "message": "Data source created",
  "id": "52fa41b7-021d-4efc-af6f-9f1e9e19b3a9"
}

Response Code
400

Error message in JSON format:

Mesage
Missing parameters
Response Example:
{ 
  "message": "Missing required parameters"
}

Response Code
500

Error message in JSON format:

message
Internal server error
Response exdmple:
{ 
  "message": "Internal Server error"
}
/admin/datasources/update
Updates an existing Data source
REST API
POST /admin/datasources/update
Input Body parameters (JSON)
id
required
Id of the Policy  to be updated
name
required
Updated name of the Policy
description
required
Updated description of the Policy
content
required
Updated Policy in plain text or markdown
Example of a call to retrieve the full list of Actions:
curl https://{{ tenant }}.lightenup.ai/admin/datasources/update \
--request POST \
--header "Authorization: Bearer xyz" \
--header "Content-Type: application/json" \
--data @- << EOF
{
 "id": "52fa41b7-021d-4efc-af6f-9f1e9e19b3a9",
 "name": "code_of_conduct",
 "description": "This policy contains our company codes if conduct...",
 "content": "- Please be polite \n - No vulgar language..."
}
EOF

Outputs
Response Code
200

This API returns the following JSON payload schema:

message
Data source updated
id
The id of the Data source created
Response example:
{ 
  "message": "Data source updated",
  "id": "52fa41b7-021d-4efc-af6f-9f1e9e19b3a9"
}

Response Code
400

Error message in JSON format:

message
Error message
Response Example:
{ 
  "message": "Missing required parameters"
}

Response Code
500

Error message in JSON format:

message
Error message
Response exdmple:
{ 
  "message": "Internal Server error"
}
/admin/datasources/delete
Deletes an existing Data source
REST API
POST /admin/datasources/delete
Input Body parameters (JSON)
id
required
Id of the Data source to be deleted
Example of a call to delete a Data sources:
curl https://{{ tenant }}.lightenup.ai/admin/datasources/delete?id=111 \
--request DELETE \
--header "Authorization: Bearer xyz"

Outputs
Response Code
200

This API returns the following JSON payload schema:

message
Datasource deleted
id
The id of the Policy created
Response example:
{ 
  "message": "Data source deleted",
  "id": "52fa41b7-021d-4efc-af6f-9f1e9e19b3a9"
}

Response Code
400

Error message in JSON format:

Mesage
Error message
Response Example:
{ 
  "message": "Missing required parameters"
}

Response Code
500

Error message in JSON format:

message
Internal server error
Response exdmple:
{ 
  "message": "Internal Server error"
}