Skip to main content

Suggest and Create an AI Agent

Used to suggest the creation of an AI agent based on the provided description and, if successful, proceeds to create the agent. Returns a success or failure detail.

API Endpoint

PropertyValue
Request MethodPOST
Request URLhttps://api.seliseblocks.com/agents/create

Request

Request Example

curl -X POST 'https://api.seliseblocks.com/agents/create' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"description": "An AI agent that helps with customer support inquiries",
"project_key": "YOUR_PROJECT_KEY",
"name": "Customer Support Agent",
"create_from": "template"
}'

Request Headers

FieldTypeRequiredDescription
acceptstringYesAccepted response format. Use application/json
Content-Typeapplication/jsonYesData type, must be application/json.

Request Body

Request Body Schema

{
"description": "string",
"project_key": "string",
"name": "string",
"create_from": "string"
}

Request Body Parameters

FieldTypeRequiredDescription
descriptionstringYesA description of the AI agent's purpose and functionality.
project_keystringYesThe project key for your project.
namestringYesThe name of the AI agent to be created.
create_fromstringYesSource for agent creation (e.g., template, scratch, existing).

Response

Success Response (200 OK)

Returns an object containing the creation status and details.

{
"is_success": true,
"item_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"detail": "Agent created successfully",
"error": {}
}

Response Fields

FieldTypeDescription
is_successbooleanIndicates whether the agent creation was successful.
item_idstringUnique identifier for the created agent.
detailstringSuccess or failure message with additional context.
errorobjectError details if the operation failed (empty if successful).

Error Response (422 Unprocessable Entity)

Returns validation error details when the request body is invalid.

{
"detail": [
{
"loc": [
"body",
"project_key"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}

Error Response Fields

FieldTypeDescription
detailarrayArray of validation error objects.
locarrayLocation of the error in the request (e.g., body field).
msgstringHuman-readable error message.
typestringError type identifier.

Error Codes

Status CodeDescriptionResponse Type
200Successful ResponseSuccess
422Validation Error - Invalid request parametersUnprocessable Entity