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

# Write a label

> Requires labels:write. Stores a human answer for one question. Does not change the evaluation.



## OpenAPI

````yaml /openapi.json post /api/evaluations/{id}/labels
openapi: 3.1.0
info:
  title: judged.systems
  version: 0.1.0
  description: >-
    Judge one support ticket. Product routes accept an API key or a browser
    session. If a key is sent, the session is not used. POST /api/judge and POST
    /api/webhooks/inbound accept an API key only. Send the key in the x-api-key
    header or as Authorization: Bearer.
servers:
  - url: https://judged.systems
security:
  - apiKey: []
  - bearerAuth: []
  - {}
tags:
  - name: Packs
  - name: Judge
  - name: Evaluations
  - name: Reviews
  - name: Labels
  - name: Datasets
  - name: Simulations
  - name: Stats
  - name: Webhooks
paths:
  /api/evaluations/{id}/labels:
    post:
      tags:
        - Labels
      summary: Write a label
      description: >-
        Requires labels:write. Stores a human answer for one question. Does not
        change the evaluation.
      operationId: writeLabel
      parameters:
        - $ref: '#/components/parameters/evaluationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WriteLabelBody'
      responses:
        '200':
          description: The stored label.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Label'
        default:
          $ref: '#/components/responses/Error'
components:
  parameters:
    evaluationId:
      name: id
      in: path
      required: true
      schema:
        type: string
  schemas:
    WriteLabelBody:
      type: object
      required:
        - questionId
        - answer
      properties:
        questionId:
          type: string
          minLength: 1
        answer:
          $ref: '#/components/schemas/LabelAnswer'
        note:
          type: string
          maxLength: 500
    Label:
      type: object
      required:
        - id
        - questionId
        - answer
        - note
      properties:
        id:
          type: string
        questionId:
          type: string
        answer:
          $ref: '#/components/schemas/LabelAnswer'
        note:
          type:
            - string
            - 'null'
    LabelAnswer:
      oneOf:
        - $ref: '#/components/schemas/ChoiceLabel'
        - $ref: '#/components/schemas/ScoreLabel'
        - $ref: '#/components/schemas/BooleanLabel'
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        issues:
          type: array
          items:
            type: object
    ChoiceLabel:
      type: object
      required:
        - type
        - choice
      properties:
        type:
          const: choice
        choice:
          type: string
          minLength: 1
    ScoreLabel:
      type: object
      required:
        - type
        - levelIndex
      properties:
        type:
          const: score
        levelIndex:
          type: integer
          minimum: 0
    BooleanLabel:
      type: object
      required:
        - type
        - value
      properties:
        type:
          const: boolean
        value:
          type: boolean
  responses:
    Error:
      description: >-
        Error body is { error: string }. Status is 400, 401, 403, 404, 409, 429,
        or 500. A 400 from a schema failure also includes issues.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
    bearerAuth:
      type: http
      scheme: bearer
      description: 'The API key, sent as Authorization: Bearer.'

````

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