Roles APIs

The Roles APIs empower Hyperflow users to create, update, delete or retrieve AI Roles

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

Outputs
Response Code
200

This API returns an array of Roles in JSON format:

id
Id of the Policy retrieved
name
Name of the Policy
content
Text of the Policy
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/roles/create
Creates a new Role
REST API
POST /admin/role/create
Input Body parameters (JSON)
name
required
Name of the Role to be created
description
required
Description of the Role to be created
content
required
The Role in plain text or markdown
Example of a call to create a Role:
curl https://{{ tenant }}.lightenup.ai/admin/roles/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 the following  JSON chema:

message
Role created
id
The id of the Role created
Response example:
{ 
  "message": "Role 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/roles/update
Updates an existing Role
REST API
POST /admin/roles/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 update a Policy
curl https://{{ tenant }}.lightenup.ai/admin/policies/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
Role updated
id
The id of the Action created
Response example:
{ 
  "message": "Policy updated",
  "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/policies/delete
Deletes an existing Policy
REST API
POST /admin/policies/delete
Input Body parameters (JSON)
id
required
Id of the Policy to be deleted
Example of a call to delete a Policy
curl https://{{ tenant }}.lightenup.ai/admin/policies/delete?id=111 \
--request DELETE \
--header "Authorization: Bearer xyz"

Outputs
Response Code
200

This API returns the following JSON payload schema:

message
Policy deleted
id
The id of the Policy created
Response example:
{ 
  "message": "Policy 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"
}