Template API

Templates are reusable configurations for creating AI Employees. This page documents the API endpoints for creating, updating, and managing access to templates.

CreateTemplate

Create a new AI Employee template.

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

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token
Content-TypestringYesapplication/json

Request Body

FieldTypeRequiredDescription
namestringYesDisplay name of the template
descriptionstringNoDescription of the template's purpose
categorystringNoTemplate category such as GENERAL or EMPLOYEE_EXPERIENCE
proto_configobjectNoDefault protobuf configuration
workflow_defobjectNoDefault workflow definition
trigger_typestringNoTrigger type for personas created from this template

Example

curl -X POST https://your-instance.ema.co/api/personas/create_persona_template \
 -H "Authorization: Bearer <access_token>" \
 -H "Content-Type: application/json" \
 -d '{
 "name": "Basic Q&A Template",
 "description": "Template for knowledge-base Q&A AI Employees",
 "category": "GENERAL",
 "proto_config": {
 "widgets": [],
 "display_settings": {
 "display_type": "SINGLE_PAGE"
 }
 }
 }'

Response

FieldTypeDescription
template_idstringUUID of the created template

UpdateTemplate

Update an existing template's configuration.

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

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token
Content-TypestringYesapplication/json

Request Body

FieldTypeRequiredDescription
template_idstringYesUUID of the template to update
namestringNoUpdated display name
descriptionstringNoUpdated description
categorystringNoUpdated category
proto_configobjectNoUpdated protobuf configuration
workflow_defobjectNoUpdated workflow definition

Example

curl -X POST https://your-instance.ema.co/api/personas/update_persona_template \
 -H "Authorization: Bearer <access_token>" \
 -H "Content-Type: application/json" \
 -d '{
 "template_id": "<template-uuid>",
 "name": "Enhanced Q&A Template",
 "description": "Updated template with improved search and response"
 }'

GrantAccess

Grant a tenant access to use a specific template.

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

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token
Content-TypestringYesapplication/json

Request Body

FieldTypeRequiredDescription
template_idstringYesUUID of the template
grantee_tenant_idstringYesUUID of the tenant to grant access to

Example

curl -X POST https://your-instance.ema.co/api/personas/grant_persona_template_access \
 -H "Authorization: Bearer <access_token>" \
 -H "Content-Type: application/json" \
 -d '{
 "template_id": "<template-uuid>",
 "grantee_tenant_id": "<tenant-uuid>"
 }'

RevokeAccess

Revoke a tenant's access to a specific template.

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

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token
Content-TypestringYesapplication/json

Request Body

FieldTypeRequiredDescription
template_idstringYesUUID of the template
target_tenant_idstringYesUUID of the tenant to revoke access from

Example

curl -X POST https://your-instance.ema.co/api/personas/revoke_persona_template_access \
 -H "Authorization: Bearer <access_token>" \
 -H "Content-Type: application/json" \
 -d '{
 "template_id": "<template-uuid>",
 "target_tenant_id": "<tenant-uuid>"
 }'

GetPersonaTemplates

Retrieve available templates.

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

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token

Example

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

Response

FieldTypeDescription
templatesarrayList of PersonaTemplateDTO objects

Each template includes id, name, description, category, icon, and configuration details.

GetPersonaTemplate

Retrieve a specific template by ID.

PropertyValue
URL/api/personas/persona_template/{template_id}
HTTP MethodGET
ProtocolREST (HTTP/JSON)

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token

Path Parameters

ParameterTypeDescription
template_idstringUUID of the template

Example

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

Last updated: Jul 3, 2026