ibl-data-manager (3.59.0-ai-plus)
API for iblai
Request
Endpoint to create and view, update and delete periodic agents.
Periodic agents are schedulers issued for mentors. These are configured with input prompt (if any) as well as a cron schedule to trigger the periodic agent.
Access to these are restricted to platform admins and tenant administrators
Session information for running the periodic agent will be generated with the credentials of the user (platform administrator) who created the agent.
A Periodic Agent is allowed to have a callback_url
and callback_secret
. When a callback_url
is set for a Periodic Agent, a post request with data entries containing the log and timestamp of the run will be made to the callback_url provided. Here is the payload structure:
{
"timestamp": "timestamp when the run completed",
"status": "status of the periodic agent",
"prompt": "input prompt to agent,
"agent_output": "...final response of agent",
"log": "... full agent run log",
"log_id": periodic agent log id.,
}
The payload is encrypted using the callback_secret
provided.
You can validate the payload using the X-Hub-Signature-256 signature header for request data. This is a Sha256 encoded HMAC hex digest of the payload body.
import hmac
import haslib
def validate_payload(request: HttpRequest, callback_secret: str):
# Get the X-Hub-Signature-256 header from the request
received_signature = request.META.get("HTTP_X_HUB_SIGNATURE_256", "")
if not received_signature.startswith("sha256="):
# Invalid signature format
return False
received_signature = received_signature[len("sha256=") :]
try:
# Get the raw request body
payload = request.body
# Compute the expected signature using the app_secret
expected_signature = hmac.new(
callback_secret.encode(), payload, hashlib.sha256
).hexdigest()
if hmac.compare_digest(received_signature, expected_signature):
# Signatures match, the payload is genuine
return True
else:
# Signatures don't match
return False
except Exception as e:
# Handle any errors that may occur during validation
return False
- application/json
- application/x-www-form-urlencoded
- multipart/form-data
Cron Minutes to Run. Use "*" for "all". (Example: "0,30")
Cron Hours to Run. Use "*" for "all". (Example: "8,20")
Cron Days Of The Week to Run. Use "*" for "all", Sunday is 0 or 7, Monday is 1. (Example: "0,5")
Cron Days Of The Month to Run. Use "*" for "all". (Example: "1,15")
Datetime when the schedule should begin triggering the task to run
- Mock server
https://docs.ibl.ai/_mock/apis/ibl/api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agents/{id}/
https://base.manager.iblai.app/api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agents/{id}/
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
'https://docs.ibl.ai/_mock/apis/ibl/api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agents/{id}/' \
-H 'Authorization: YOUR_API_KEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"mentor": 0,
"title": "string",
"description": "string",
"prompt": "string",
"task": {
"crontab": {
"minute": "string",
"hour": "string",
"day_of_week": "string",
"day_of_month": "string",
"month_of_year": "string"
},
"one_off": true,
"start_time": "2019-08-24T14:15:22Z",
"enabled": true
},
"pathway": "string",
"callback_url": "http://example.com",
"callback_secret": "string",
"parent_session_id": "string",
"parent_mentor_id": -9223372036854776000,
"previous_agent": 0,
"previous_agent_status": "success"
}'
Cron Minutes to Run. Use "*" for "all". (Example: "0,30")
Cron Hours to Run. Use "*" for "all". (Example: "8,20")
Cron Days Of The Week to Run. Use "*" for "all", Sunday is 0 or 7, Monday is 1. (Example: "0,5")
Cron Days Of The Month to Run. Use "*" for "all". (Example: "1,15")
Datetime when the schedule should begin triggering the task to run
success
- Successerror
- Errorrunning
- Runningpending
- Pending
{ "id": 0, "mentor": 0, "title": "string", "username": "string", "description": "string", "prompt": "string", "task": { "id": 0, "name": "string", "crontab": { … }, "one_off": true, "start_time": "2019-08-24T14:15:22Z", "enabled": true }, "created_at": "2019-08-24T14:15:22Z", "modified_at": "2019-08-24T14:15:22Z", "enabled": true, "one_off": true, "platform_key": "string", "pathway": "string", "callback_url": "http://example.com", "callback_secret": "string", "parent_session_id": "string", "parent_mentor_id": -9223372036854776000, "previous_agent": 0, "previous_agent_status": "success", "previous_agent_output": "string" }
Request
Endpoint to create and view, update and delete periodic agents.
Periodic agents are schedulers issued for mentors. These are configured with input prompt (if any) as well as a cron schedule to trigger the periodic agent.
Access to these are restricted to platform admins and tenant administrators
Session information for running the periodic agent will be generated with the credentials of the user (platform administrator) who created the agent.
A Periodic Agent is allowed to have a callback_url
and callback_secret
. When a callback_url
is set for a Periodic Agent, a post request with data entries containing the log and timestamp of the run will be made to the callback_url provided. Here is the payload structure:
{
"timestamp": "timestamp when the run completed",
"status": "status of the periodic agent",
"prompt": "input prompt to agent,
"agent_output": "...final response of agent",
"log": "... full agent run log",
"log_id": periodic agent log id.,
}
The payload is encrypted using the callback_secret
provided.
You can validate the payload using the X-Hub-Signature-256 signature header for request data. This is a Sha256 encoded HMAC hex digest of the payload body.
import hmac
import haslib
def validate_payload(request: HttpRequest, callback_secret: str):
# Get the X-Hub-Signature-256 header from the request
received_signature = request.META.get("HTTP_X_HUB_SIGNATURE_256", "")
if not received_signature.startswith("sha256="):
# Invalid signature format
return False
received_signature = received_signature[len("sha256=") :]
try:
# Get the raw request body
payload = request.body
# Compute the expected signature using the app_secret
expected_signature = hmac.new(
callback_secret.encode(), payload, hashlib.sha256
).hexdigest()
if hmac.compare_digest(received_signature, expected_signature):
# Signatures match, the payload is genuine
return True
else:
# Signatures don't match
return False
except Exception as e:
# Handle any errors that may occur during validation
return False
- application/json
- application/x-www-form-urlencoded
- multipart/form-data
- Mock server
https://docs.ibl.ai/_mock/apis/ibl/api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agents/{id}/
https://base.manager.iblai.app/api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agents/{id}/
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PATCH \
'https://docs.ibl.ai/_mock/apis/ibl/api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agents/{id}/' \
-H 'Authorization: YOUR_API_KEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"mentor": 0,
"title": "string",
"description": "string",
"prompt": "string",
"task": {
"crontab": {
"minute": "string",
"hour": "string",
"day_of_week": "string",
"day_of_month": "string",
"month_of_year": "string"
},
"one_off": true,
"start_time": "2019-08-24T14:15:22Z",
"enabled": true
},
"pathway": "string",
"callback_url": "http://example.com",
"callback_secret": "string",
"parent_session_id": "string",
"parent_mentor_id": -9223372036854776000,
"previous_agent": 0,
"previous_agent_status": "success"
}'
Cron Minutes to Run. Use "*" for "all". (Example: "0,30")
Cron Hours to Run. Use "*" for "all". (Example: "8,20")
Cron Days Of The Week to Run. Use "*" for "all", Sunday is 0 or 7, Monday is 1. (Example: "0,5")
Cron Days Of The Month to Run. Use "*" for "all". (Example: "1,15")
Datetime when the schedule should begin triggering the task to run
success
- Successerror
- Errorrunning
- Runningpending
- Pending
{ "id": 0, "mentor": 0, "title": "string", "username": "string", "description": "string", "prompt": "string", "task": { "id": 0, "name": "string", "crontab": { … }, "one_off": true, "start_time": "2019-08-24T14:15:22Z", "enabled": true }, "created_at": "2019-08-24T14:15:22Z", "modified_at": "2019-08-24T14:15:22Z", "enabled": true, "one_off": true, "platform_key": "string", "pathway": "string", "callback_url": "http://example.com", "callback_secret": "string", "parent_session_id": "string", "parent_mentor_id": -9223372036854776000, "previous_agent": 0, "previous_agent_status": "success", "previous_agent_output": "string" }
Request
Endpoint to create and view, update and delete periodic agents.
Periodic agents are schedulers issued for mentors. These are configured with input prompt (if any) as well as a cron schedule to trigger the periodic agent.
Access to these are restricted to platform admins and tenant administrators
Session information for running the periodic agent will be generated with the credentials of the user (platform administrator) who created the agent.
A Periodic Agent is allowed to have a callback_url
and callback_secret
. When a callback_url
is set for a Periodic Agent, a post request with data entries containing the log and timestamp of the run will be made to the callback_url provided. Here is the payload structure:
{
"timestamp": "timestamp when the run completed",
"status": "status of the periodic agent",
"prompt": "input prompt to agent,
"agent_output": "...final response of agent",
"log": "... full agent run log",
"log_id": periodic agent log id.,
}
The payload is encrypted using the callback_secret
provided.
You can validate the payload using the X-Hub-Signature-256 signature header for request data. This is a Sha256 encoded HMAC hex digest of the payload body.
import hmac
import haslib
def validate_payload(request: HttpRequest, callback_secret: str):
# Get the X-Hub-Signature-256 header from the request
received_signature = request.META.get("HTTP_X_HUB_SIGNATURE_256", "")
if not received_signature.startswith("sha256="):
# Invalid signature format
return False
received_signature = received_signature[len("sha256=") :]
try:
# Get the raw request body
payload = request.body
# Compute the expected signature using the app_secret
expected_signature = hmac.new(
callback_secret.encode(), payload, hashlib.sha256
).hexdigest()
if hmac.compare_digest(received_signature, expected_signature):
# Signatures match, the payload is genuine
return True
else:
# Signatures don't match
return False
except Exception as e:
# Handle any errors that may occur during validation
return False
- Mock server
https://docs.ibl.ai/_mock/apis/ibl/api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agents/{id}/
https://base.manager.iblai.app/api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agents/{id}/
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
'https://docs.ibl.ai/_mock/apis/ibl/api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agents/{id}/' \
-H 'Authorization: YOUR_API_KEY_HERE'