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
| Property | Value |
|---|---|
| Request Method | POST |
| Request URL | https://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
| Field | Type | Required | Description |
|---|---|---|---|
| accept | string | Yes | Accepted response format. Use application/json |
| Content-Type | application/json | Yes | Data type, must be application/json. |
Request Body
Request Body Schema
{
"description": "string",
"project_key": "string",
"name": "string",
"create_from": "string"
}
Request Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| description | string | Yes | A description of the AI agent's purpose and functionality. |
| project_key | string | Yes | The project key for your project. |
| name | string | Yes | The name of the AI agent to be created. |
| create_from | string | Yes | Source 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
| Field | Type | Description |
|---|---|---|
| is_success | boolean | Indicates whether the agent creation was successful. |
| item_id | string | Unique identifier for the created agent. |
| detail | string | Success or failure message with additional context. |
| error | object | Error 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
| Field | Type | Description |
|---|---|---|
| detail | array | Array of validation error objects. |
| loc | array | Location of the error in the request (e.g., body field). |
| msg | string | Human-readable error message. |
| type | string | Error type identifier. |
Error Codes
| Status Code | Description | Response Type |
|---|---|---|
| 200 | Successful Response | Success |
| 422 | Validation Error - Invalid request parameters | Unprocessable Entity |