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

# Update a project grader's policy

> Change model settings, scope, or threshold for future work. Existing simulation plans keep their selected definitions and settings, including when regraded. Expected behaviors has fixed scope; its model and threshold are editable.



## OpenAPI

````yaml openapi.json PATCH /v1/graders/{graderId}
openapi: 3.1.0
info:
  title: Egma Platform API
  version: 1.0.0
  description: >-
    The customer-facing HTTP interface used by Egma's web app, CLI, and outside
    clients.
servers:
  - url: https://app.egma.ai
security: []
paths:
  /v1/graders/{graderId}:
    patch:
      tags:
        - Graders
      summary: Update a project grader's policy
      description: >-
        Change model settings, scope, or threshold for future work. Existing
        simulation plans keep their selected definitions and settings, including
        when regraded. Expected behaviors has fixed scope; its model and
        threshold are editable.
      operationId: updateGrader
      parameters:
        - name: graderId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
        - name: projectId
          in: query
          required: false
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                scope:
                  type: object
                  properties:
                    simulations:
                      type: array
                      items:
                        oneOf:
                          - type: object
                            properties:
                              kind:
                                type: string
                                enum:
                                  - all
                            required:
                              - kind
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                enum:
                                  - test_suite
                              id:
                                type: string
                                minLength: 1
                            required:
                              - kind
                              - id
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                enum:
                                  - test
                              id:
                                type: string
                                minLength: 1
                            required:
                              - kind
                              - id
                            additionalProperties: false
                    production:
                      anyOf:
                        - type: object
                          properties:
                            samplePercent:
                              type: number
                              minimum: 1
                              maximum: 100
                          required:
                            - samplePercent
                          additionalProperties: false
                        - type: 'null'
                  required:
                    - simulations
                    - production
                  additionalProperties: false
                  description: >-
                    Simulation selectors and an optional production sample. Only
                    graders with scopeEditable set to true accept scope changes.
                settings:
                  type: object
                  additionalProperties: true
                  description: >-
                    Complete values for the definition's settingDefinitions. LLM
                    graders use llm_provider and llm_model. Response latency
                    uses maximum_response_time_ms, a positive integer in
                    milliseconds. These settings belong to this project and do
                    not create a definition version.
                passThreshold:
                  type: number
                  minimum: 0
                  maximum: 1
                  description: >-
                    This grader passes when its score is at least this value.
                    There is no overall run pass threshold.
              minProperties: 1
              additionalProperties: false
              examples:
                - passThreshold: 1
      responses:
        '200':
          description: The updated project grader.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  projectId:
                    type: string
                    minLength: 1
                  graderDefinitionId:
                    type: string
                    minLength: 1
                  name:
                    type: string
                  description:
                    anyOf:
                      - type: string
                      - type: 'null'
                  owner:
                    type: string
                    enum:
                      - egma
                      - project
                  type:
                    type: string
                    enum:
                      - llm_as_judge
                      - code
                  modalities:
                    type: array
                    items:
                      type: string
                      enum:
                        - chat
                        - voice
                    minItems: 1
                    uniqueItems: true
                  scopeEditable:
                    type: boolean
                  removable:
                    type: boolean
                  scope:
                    type: object
                    properties:
                      simulations:
                        type: array
                        items:
                          oneOf:
                            - type: object
                              properties:
                                kind:
                                  type: string
                                  enum:
                                    - all
                              required:
                                - kind
                              additionalProperties: false
                            - type: object
                              properties:
                                kind:
                                  type: string
                                  enum:
                                    - test_suite
                                id:
                                  type: string
                                  minLength: 1
                              required:
                                - kind
                                - id
                              additionalProperties: false
                            - type: object
                              properties:
                                kind:
                                  type: string
                                  enum:
                                    - test
                                id:
                                  type: string
                                  minLength: 1
                              required:
                                - kind
                                - id
                              additionalProperties: false
                      production:
                        anyOf:
                          - type: object
                            properties:
                              samplePercent:
                                type: number
                                minimum: 1
                                maximum: 100
                            required:
                              - samplePercent
                            additionalProperties: false
                          - type: 'null'
                    required:
                      - simulations
                      - production
                    additionalProperties: false
                  settings:
                    type: object
                    additionalProperties: true
                  passThreshold:
                    type: number
                    minimum: 0
                    maximum: 1
                  createdAt:
                    type: string
                    format: date-time
                  updatedAt:
                    type: string
                    format: date-time
                required:
                  - id
                  - projectId
                  - graderDefinitionId
                  - name
                  - description
                  - owner
                  - type
                  - modalities
                  - scopeEditable
                  - removable
                  - scope
                  - settings
                  - passThreshold
                  - createdAt
                  - updatedAt
                additionalProperties: false
        '400':
          description: The request was refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refusal'
        '401':
          description: The request was refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refusal'
        '403':
          description: The request was refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refusal'
        '404':
          description: The request was refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refusal'
        '422':
          description: The request was refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refusal'
        '429':
          description: The request rate limit was reached.
          headers:
            Retry-After:
              description: Seconds to wait before trying again.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refusal'
      security:
        - bearerAuth: []
        - sessionCookie: []
components:
  schemas:
    Refusal:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        details:
          type: object
          additionalProperties: true
      required:
        - error
        - message
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: An Egma API key.
    sessionCookie:
      type: apiKey
      in: cookie
      name: egma.session_token
      description: >-
        The browser session cookie issued by Egma. HTTPS deployments add the
        standard __Secure- prefix.

````