Policies APIs
The Policies APIs enable Hyperflow users to create, update, delete or retrieve policies and codes of conduct and communication styles.
/admin/policies/get
Retrieve the information about your existing Policies
REST API
GET /admin/policies/get
Input query parameters
id
Optional
if provided, this API returns information about the policy matching the id provided. Otherwise, it returns the full list of policies.
Example of a call to retrieve the full list of Policies:
curl https://{{ tenant }}.lightenup.ai/admin/policies/get \
--request GET \
--header "Authorization: Bearer xyz"
Example a call to retrieve a particular Policies:
curl https://{{ tenant }}.lightenup.ai/admin/policies/get?id={{id}} \
--request GET \
--header "Authorization: Bearer xyz"
Outputs
Response Code
200
This API returns an array of Policies 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/policies/create
Creates a new Policy
REST API
POST /admin/policies/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 a Policy:
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 an array of Actions in JSON format:
message
Policy created
id
The id of the Policy created
Response example:
{
"message": "Policy 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/policies/update
Updates an existing Policy
REST API
POST /admin/policies/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
Action 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"
}