Risk API

Risk Endpoints

Analysis

Purpose

Analyze any text input—messages, journal entries, surveys, essays, chat logs—and generate:

  • A risk category
  • A full explanatory analysis describing the linguistic and emotional cues that informed the classification

mutation CreateAnalysis

mutation CreateAnalysis {
    createAnalysis(input: { 
       user: string, 
       text: string, 
       context: string, 
       model: "gemini" | "gpt-5" 
   }) {
        id
        context
        created_at
        model
        response
        score
        text
        updated_at
        user
    }
}

query GetAnalysis

query GetAnalysis {
    getAnalysis(id: string) {
        id
        context
        created_at
        model
        response
        score
        text
        updated_at
        user
    }
}

query ListAnalyses

query ListAnalyses {
    listAnalyses(
        created_to: String
        created_from: String
        score: Int
        page_token: String
        page_size: Int
        user: String
        model: String
    ) {
        next_page_token
        analyses {
            id
            context
            created_at
            model
            response
            score
            text
            updated_at
            user
        }
    }
}

Feedback

Purpose

Allow human moderators or clinicians to provide structured feedback to improve the model for their specific tenant.

Examples of feedback:

  • The LLM misclassified a text → correct category provided
  • A clinician adds context supporting a different label
  • Recurrent patterns or edge cases unique to a population

Provides a framework for tenant-specific adaptation, ensuring the model reflects the needs and context of each organization’s population.This endpoint is the foundation of per-tenant customization, gradually shaping the model to align with that organization’s cultural, linguistic, or demographic patterns.



mutation CreateFeedback

mutation CreateFeedback {
    createFeedback(
        input: {
            model: String
            build: String
            input: String!
            feedback: String!
            analyze: String!
            scale: String!
            _id: ID!
        }
    ) {
        id
        analyze
        created_at
        feedback
        model
        response
        score
        text
        updated_at
        user
    }
}

query ListFeedbacks

query ListFeedbacks {
    listFeedbacks(analyze: String!, page_size: Int, page_token: String) {
        next_page_token
        feedbacks {
            id
            analyze
            created_at
            feedback
            model
            response
            score
            text
            updated_at
            user
        }
    }
}

Risk Categories

Purpose

Enable organizations to define their own risk scale based on their internal protocols or compliance requirements.

Examples:

  • Corporate wellness programs may simplify to a smaller number of categorization0–3 model
  • Clinical partners may expand subcategories for suicidal ideation
  • Youth programs may add categories related to bullying or harassment
  • Blueprint’s default 0–6 scale is maintained unless overridden.

mutation createRiskCategory

mutation CreateRiskCategory {
    createRiskCategory(input: { label: String!, scale: Int!, description: String! }) {
        id
       label
       scale
       description
    }
}

query ListRiskCategories

query ListRiskCategories { ListRiskCategories(label: String, scale: Int, id: ID) { next_page_token riskCategories { id label scale description } } }