> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prisme.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Replace an agent's evaluation criteria

> Replaces the full list of evaluation criteria of the agent. The new
criteria apply to future analyses only. Each criterion needs `id`,
`type`, and `question`; a `score` criterion also needs a non-zero
`min` (`min: 0` is rejected).

Requires `ai-insights-v2:conversations` (`write`). Rate limit: 50
requests per minute.




## OpenAPI

````yaml /api-reference/ai-insights-v2/swagger.yml put /v1/agents/{agent_id}/evaluation-criteria
openapi: 3.0.3
info:
  version: 1.0.0
  title: AI Insights API
  description: |
    Public REST API for the Prisme.ai AI Insights workspace - analyzed
    conversations, analysis triggering and status, evaluation criteria,
    message feedback, organization analytics, LLM consumption, memory
    analytics, and the agent relationship graph.

    **Organization scope.** Every endpoint reads and writes the data of the
    caller's organization, taken from the session (or from the org API key).
    No parameter lets a caller target another organization.

    **Permissions.** Each endpoint checks an organization IAM permission
    `ai-insights-v2:<resource>` with the action `read` or `write`
    (`manage` grants both). The resources are `conversations`, `feedback`,
    `analytics`, and `queue`; each operation states the one it requires.
    Platform admins and workspace admins are always allowed.

    **Rate limits.** Limits are counted per caller (user, or org API key)
    and per endpoint, over a sliding window. Depending on the endpoint, an
    exceeded limit returns one of two 429 bodies; both are documented on
    each operation.
  contact:
    name: Prisme.ai
    url: https://prisme.ai
servers:
  - url: https://{host}/v2/workspaces/slug:ai-insights-v2/webhooks
    description: Prisme.ai workspace webhooks
    variables:
      host:
        default: api.studio.prisme.ai
        description: API host (override for self-hosted or sandbox)
security:
  - BearerAuth: []
  - OrgApiKeyAuth: []
tags:
  - name: Insights
    description: Per-conversation analysis results and analysis status.
  - name: Agents
    description: >-
      Analysis triggering, evaluation criteria, conversations, and users of one
      agent.
  - name: Feedback
    description: Like / dislike feedback on agent messages.
  - name: Analytics
    description: Organization-wide usage, quality, latency, and adoption metrics.
  - name: Consumption
    description: LLM requests, tokens, cost, and carbon footprint, per user and over time.
  - name: Queue
    description: State of the conversation analysis queue.
  - name: Memories
    description: Analytics built from the memories users accumulate with agents.
  - name: Graph
    description: >-
      Agent relationship graph - tools, categories, delegations, similarity, and
      clusters.
paths:
  /v1/agents/{agent_id}/evaluation-criteria:
    put:
      tags:
        - Agents
      summary: Replace an agent's evaluation criteria
      description: |
        Replaces the full list of evaluation criteria of the agent. The new
        criteria apply to future analyses only. Each criterion needs `id`,
        `type`, and `question`; a `score` criterion also needs a non-zero
        `min` (`min: 0` is rejected).

        Requires `ai-insights-v2:conversations` (`write`). Rate limit: 50
        requests per minute.
      operationId: updateEvaluationCriteria
      parameters:
        - $ref: '#/components/parameters/AgentId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - criteria
              properties:
                criteria:
                  type: array
                  items:
                    $ref: '#/components/schemas/EvaluationCriterion'
            example:
              criteria:
                - id: resolution
                  type: boolean
                  question: Was the user's issue resolved?
                  weight: 0.4
                - id: accuracy
                  type: score
                  question: Rate the accuracy of information provided
                  min: 1
                  max: 5
                  weight: 0.4
                - id: tone
                  type: category
                  question: How would you describe the agent's tone?
                  options:
                    - formal
                    - friendly
                    - curt
                  weight: 0.2
      responses:
        '200':
          description: Criteria saved.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  agent_id:
                    type: string
                  criteria:
                    type: array
                    items:
                      $ref: '#/components/schemas/EvaluationCriterion'
                  message:
                    type: string
                    example: Evaluation criteria updated
        '400':
          description: One or more criteria are invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Validation failed
                  validation_errors:
                    type: array
                    items:
                      type: string
                    example:
                      - Score criterion accuracy missing min
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/AgentNotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  parameters:
    AgentId:
      in: path
      name: agent_id
      required: true
      schema:
        type: string
        maxLength: 64
        pattern: ^[a-zA-Z0-9_-]+$
      description: Agent ID (as returned by the Agent Creator API).
  schemas:
    EvaluationCriterion:
      type: object
      required:
        - id
        - type
        - question
      properties:
        id:
          type: string
          description: |
            Criterion identifier. The `resolution` boolean criterion drives the
            insight's `resolved` field.
        type:
          type: string
          enum:
            - boolean
            - score
            - category
        question:
          type: string
          description: Question the LLM answers for each conversation.
        context:
          type: string
          description: Extra guidance given to the LLM.
        weight:
          type: number
          description: Weight of the criterion in `evaluation_score`.
        min:
          type: number
          description: Lowest score. Required and non-zero for `score` criteria.
        max:
          type: number
          description: Highest score, for `score` criteria.
        options:
          type: array
          items:
            type: string
          description: Allowed answers, for `category` criteria.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: >-
            Error code (e.g. `FORBIDDEN`), or error message on some validation
            errors.
        message:
          type: string
          description: Human-readable message.
    RuntimeError:
      type: object
      description: Error raised by the Prisme.ai runtime before the endpoint logic runs.
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
        details:
          type: object
          additionalProperties: true
  responses:
    Unauthenticated:
      description: Missing or invalid credentials, or no organization context.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: UNAUTHORIZED
            message: Authentication required
    Forbidden:
      description: The caller lacks the permission required by the endpoint.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: FORBIDDEN
            message: 'Access denied: missing permission ''ai-insights-v2:analytics:read'''
    AgentNotFound:
      description: Agent not found, or not accessible to the caller.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Agent not found
    TooManyRequests:
      description: >-
        Rate limit exceeded. Retry after the number of seconds given in the
        `Retry-After` header.
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RuntimeError'
          example:
            error: TooManyRequests
            message: Too many requests for 'Insights'
            details:
              name: Insights
              ok: false
              retryAfter: 42.5
              limit: 100
              window: 60
              remaining: 0
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        User-bound credential carrying an identity: either a session JWT
        or a user access token (`at:*`) generated from the user settings UI.
        Send as `Authorization: Bearer <token>`. The organization and the
        permissions applied are those of this user.
    OrgApiKeyAuth:
      type: apiKey
      in: header
      name: x-prismeai-api-key
      description: |
        Organization API key (`iak_{orgSlug}_{uuid}`), managed from the
        AI Governance UI. It is not tied to a user: its access is defined by
        the permissions attached to it, and all keys of an organization share
        the same rate-limit counters. Endpoints that describe "your own"
        data, such as `GET /v1/users/{user_id}`, need a user credential.
        Send as `x-prismeai-api-key: iak_...`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.