Managing copilots via API
Create Copilot
This endpoint creates a new copilot from a swagger file
POST
/
backend
/
api
/
copilot
/
swagger
Body
curl --location --request POST 'http://example.com/backend/api/copilot/swagger' \
--header 'Accept: application/json' \
--form 'name="My Copilot"' \
--form 'prompt_message="You are AI copilot, your job is to help the user whenever needed ... "' \
--form 'swagger_file=""'
{
"copilot": {
"id": "1ca91513-fc59-4868-9965-0112ca3393f4",
"name": "Hey",
"token": "2RX5OFLTTrh4ovONfFBt",
"website": "https://www.example.com",
"status": "draft",
"prompt_message": "Hello",
"enhanced_privacy": 0,
"smart_sync": 0,
"created_at": "2023-08-31T10:25:21.000000Z",
"updated_at": "2023-08-31T10:57:00.000000Z",
"deleted_at": null,
"swagger_url": "hfBh7WIRr3m1FMek3YJk.json",
"is_premade_demo_template": 0
}
}
Body
name
string or null
The name of the copilot, if empty a default name will be given.
prompt_message
string or null
The initial prompt message for the copilot, if empty a default prompt will be given (highly recommended to customize it for the best results)
swagger_file
file
Your backend swagger file, it will help the copilot to know your backend in order to communicate with it whenever needed.
Response
copilot
object
copilot information
curl --location --request POST 'http://example.com/backend/api/copilot/swagger' \
--header 'Accept: application/json' \
--form 'name="My Copilot"' \
--form 'prompt_message="You are AI copilot, your job is to help the user whenever needed ... "' \
--form 'swagger_file=""'
{
"copilot": {
"id": "1ca91513-fc59-4868-9965-0112ca3393f4",
"name": "Hey",
"token": "2RX5OFLTTrh4ovONfFBt",
"website": "https://www.example.com",
"status": "draft",
"prompt_message": "Hello",
"enhanced_privacy": 0,
"smart_sync": 0,
"created_at": "2023-08-31T10:25:21.000000Z",
"updated_at": "2023-08-31T10:57:00.000000Z",
"deleted_at": null,
"swagger_url": "hfBh7WIRr3m1FMek3YJk.json",
"is_premade_demo_template": 0
}
}