Skip to main content

Personas API

Manage analyst personas with their roles and information needs. Each persona represents a different analytical perspective and has an associated ontology.

List Personas

Retrieve all personas in the system.

Request

GET /api/personas

Response

Status: 200 OK

[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Sports Scout",
"role": "Professional Baseball Scout",
"informationNeed": "Evaluate player performance and technique",
"details": "Focus on batting mechanics and pitch recognition",
"isSystemGenerated": false,
"hidden": false,
"createdAt": "2025-10-06T14:30:00.000Z",
"updatedAt": "2025-10-06T14:30:00.000Z"
}
]

Example

curl http://localhost:3001/api/personas

Create Persona

Create a new persona with an empty ontology.

Request

POST /api/personas

Content-Type: application/json

{
"name": "Sports Scout",
"role": "Professional Baseball Scout",
"informationNeed": "Evaluate player performance and technique",
"details": "Focus on batting mechanics and pitch recognition",
"isSystemGenerated": false,
"hidden": false
}

Request Body Schema

FieldTypeRequiredDescription
namestringYesDisplay name for the persona (min length: 1)
rolestringYesProfessional role or perspective (min length: 1)
informationNeedstringYesWhat the persona wants to learn (min length: 1)
detailsstringNoAdditional context or focus areas
isSystemGeneratedbooleanNoWhether created by system (default: false)
hiddenbooleanNoWhether hidden from UI (default: false)

Response

Status: 201 Created

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Sports Scout",
"role": "Professional Baseball Scout",
"informationNeed": "Evaluate player performance and technique",
"details": "Focus on batting mechanics and pitch recognition",
"isSystemGenerated": false,
"hidden": false,
"createdAt": "2025-10-06T14:30:00.000Z",
"updatedAt": "2025-10-06T14:30:00.000Z"
}

Example

curl -X POST http://localhost:3001/api/personas \
-H "Content-Type: application/json" \
-d '{
"name": "Sports Scout",
"role": "Professional Baseball Scout",
"informationNeed": "Evaluate player performance and technique"
}'

Get Persona

Retrieve a specific persona by ID.

Request

GET /api/personas/:id

Parameters

ParameterTypeDescription
idUUIDPersona identifier

Response

Status: 200 OK

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Sports Scout",
"role": "Professional Baseball Scout",
"informationNeed": "Evaluate player performance and technique",
"details": "Focus on batting mechanics and pitch recognition",
"isSystemGenerated": false,
"hidden": false,
"createdAt": "2025-10-06T14:30:00.000Z",
"updatedAt": "2025-10-06T14:30:00.000Z"
}

Status: 404 Not Found

{
"error": "Persona not found"
}

Example

curl http://localhost:3001/api/personas/550e8400-e29b-41d4-a716-446655440000

Update Persona

Update fields of an existing persona. All fields are optional for partial updates.

Request

PUT /api/personas/:id

Content-Type: application/json

{
"name": "Senior Sports Scout",
"details": "Added focus on defensive positioning"
}

Parameters

ParameterTypeDescription
idUUIDPersona identifier

Request Body Schema

All fields are optional. Only provided fields will be updated.

FieldTypeDescription
namestringDisplay name (min length: 1)
rolestringProfessional role (min length: 1)
informationNeedstringInformation need (min length: 1)
detailsstringAdditional context
isSystemGeneratedbooleanSystem-generated flag
hiddenbooleanHidden from UI flag

Response

Status: 200 OK

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Senior Sports Scout",
"role": "Professional Baseball Scout",
"informationNeed": "Evaluate player performance and technique",
"details": "Added focus on defensive positioning",
"isSystemGenerated": false,
"hidden": false,
"createdAt": "2025-10-06T14:30:00.000Z",
"updatedAt": "2025-10-06T16:45:00.000Z"
}

Status: 404 Not Found

{
"error": "Persona not found"
}

Example

curl -X PUT http://localhost:3001/api/personas/550e8400-e29b-41d4-a716-446655440000 \
-H "Content-Type: application/json" \
-d '{
"name": "Senior Sports Scout"
}'

Delete Persona

Delete a persona and its associated ontology. This operation cascades to remove the ontology but does not affect world state data.

Request

DELETE /api/personas/:id

Parameters

ParameterTypeDescription
idUUIDPersona identifier

Response

Status: 200 OK

{
"message": "Persona deleted successfully"
}

Status: 404 Not Found

{
"error": "Persona not found"
}

Example

curl -X DELETE http://localhost:3001/api/personas/550e8400-e29b-41d4-a716-446655440000

Notes

  • Creating a persona automatically creates an empty ontology with empty arrays for entity types, event types, role types, and relation types.
  • Deleting a persona cascades to delete the ontology via database foreign key constraint.
  • Personas are returned sorted by creation date (most recent first).
  • The isSystemGenerated field is intended for personas created automatically by AI processes.
  • The hidden field allows personas to be hidden from the UI without deletion.