AI Employee API

This page documents the REST API endpoints for creating, updating, and managing AI Employees (personas).

CreateAIEmployee

Create a new AI Employee within a tenant.

PropertyValue
URL/api/personas/create_persona
HTTP MethodPOST
ProtocolREST (HTTP/JSON)

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token
Content-TypestringYesapplication/json

Request Body

FieldTypeRequiredDescription
namestringYesDisplay name of the AI Employee
descriptionstringNoDescription of the AI Employee's purpose
template_idstringConditionalTemplate ID to base the AI Employee on. Provide exactly one of template_id or source_persona_id.
source_persona_idstringConditionalSource AI Employee to clone from. Provide exactly one of template_id or source_persona_id.
proto_configobjectNoFull protobuf configuration (widgets, display settings, etc.)
trigger_typestringNoOptional trigger type such as CHAT or DASHBOARD
clone_databooleanNoWhen cloning from source_persona_id, also replicate uploaded files and scraped URLs

Example

curl -X POST https://your-instance.ema.co/api/personas/create_persona \
 -H "Authorization: Bearer <access_token>" \
 -H "Content-Type: application/json" \
 -d '{
 "name": "IT Support Agent",
 "description": "Handles IT helpdesk tickets and troubleshooting",
 "template_id": "<template-uuid>",
 "trigger_type": "CHAT",
 "proto_config": {
 "widgets": [],
 "display_settings": {
 "display_type": "SINGLE_PAGE"
 }
 }
 }'

Response

FieldTypeDescription
persona_idstringUUID of the created AI Employee
statestringInitial state of the created AI Employee
workflow_idstringAssociated workflow ID, if one was created

UpdateAIEmployee

Update an existing AI Employee's configuration.

PropertyValue
URL/api/personas/update_persona
HTTP MethodPOST
ProtocolREST (HTTP/JSON)

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token
Content-TypestringYesapplication/json

Request Body

FieldTypeRequiredDescription
persona_idstringYesUUID of the AI Employee (sent in the request body, not as a path parameter)
namestringNoUpdated display name
descriptionstringNoUpdated description
proto_configobjectYesUpdated protobuf configuration
workflowobjectNoUpdated workflow definition when changing the associated workflow

Example

curl -X POST https://your-instance.ema.co/api/personas/update_persona \
 -H "Authorization: Bearer <access_token>" \
 -H "Content-Type: application/json" \
 -d '{
 "persona_id": "<persona-uuid>",
 "name": "Updated IT Support Agent",
 "description": "Enhanced IT helpdesk support with broader knowledge base",
 "proto_config": {
 "widgets": []
 }
 }'

Response

Returns the updated PersonaDTO.

GetAccessLevel

Retrieve the current user's access level for a specific AI Employee.

PropertyValue
URL/api/personas/{persona_id}/access_level
HTTP MethodGET
ProtocolREST (HTTP/JSON)

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token

Path Parameters

ParameterTypeDescription
persona_idstringUUID of the AI Employee

Example

curl -X GET https://your-instance.ema.co/api/personas/<persona_id>/access_level \
 -H "Authorization: Bearer <access_token>"

Response

FieldTypeDescription
idstringUUID of the AI Employee
access_levelstringThe user's access level for this AI Employee

GetPersonasForTenant

Retrieve all AI Employees for the authenticated tenant.

PropertyValue
URL/api/personas/get_personas_for_tenant
HTTP MethodGET
ProtocolREST (HTTP/JSON)

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token

Example

curl -X GET https://your-instance.ema.co/api/personas/get_personas_for_tenant \
 -H "Authorization: Bearer <access_token>"

Response

Returns a list of AI Employee objects for the tenant.

FieldTypeDescription
personasarrayList of PersonaDTO objects

Each PersonaDTO includes fields such as id, template_id, name, description, status, proto_config, access_level, and other metadata.

DeleteAIEmployee

Delete an AI Employee.

PropertyValue
URL/api/personas/{persona_id}
HTTP MethodDELETE
ProtocolREST (HTTP/JSON)

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token

Path Parameters

ParameterTypeDescription
persona_idstringUUID of the AI Employee

Example

curl -X DELETE https://your-instance.ema.co/api/personas/<persona_id> \
 -H "Authorization: Bearer <access_token>"

Last updated: Jul 3, 2026