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

# Update Verified Question

> Change a verified question: only the fields sent change. Send useAsAgentContext alone to switch it in or out of agent context. Every test case that asks it sees the change.



## OpenAPI

````yaml patch /v2/api/projects/{projectId}/workspaces/{workspaceId}/verified-questions/{verifiedQuestionId}
openapi: 3.1.0
info:
  title: Upsolve API
  version: 1.5.0
servers:
  - url: https://api.upsolve.ai
security: []
tags: []
paths:
  /v2/api/projects/{projectId}/workspaces/{workspaceId}/verified-questions/{verifiedQuestionId}:
    patch:
      summary: 'Change a verified question: only the fields sent …'
      description: >-
        Change a verified question: only the fields sent change. Send
        useAsAgentContext alone to switch it in or out of agent context. Every
        test case that asks it sees the change.
      operationId: >-
        PatchV2ApiProjectsProjectIdWorkspacesWorkspaceIdVerifiedQuestionsVerifiedQuestionId
      parameters:
        - name: projectId
          in: path
          required: true
          description: The project the workspace belongs to.
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
            description: The project the workspace belongs to.
        - name: workspaceId
          in: path
          required: true
          description: The workspace.
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
            description: The workspace.
        - name: verifiedQuestionId
          in: path
          required: true
          description: The verified question's id (its key, stable across versions).
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
            description: The verified question's id (its key, stable across versions).
      requestBody:
        description: >-
          PATCH
          /v2/api/projects/:projectId/workspaces/:workspaceId/verified-questions/:verifiedQuestionId
          Request body
        content:
          application/json:
            schema:
              type: object
              properties:
                apiKey:
                  type: string
                  minLength: 1
                  description: >-
                    Upsolve API key, generated under Account → Developer
                    settings in the Upsolve Hub. Keys are user-scoped: pass
                    organizationId alongside the key to select which org to act
                    on.
                  examples:
                    - up_embed_************
                organizationId:
                  description: >-
                    Your Upsolve organization's UUID — the org that owns the API
                    key and project. This is NOT a project organization: do not
                    pass a value registered via /projects/register-organization,
                    and do not pass an `externalId` (only
                    `projectOrganizationId` accepts those). Omit it when using
                    an org-bound API key — the org is read from the key and any
                    value sent here is ignored. Required only for user-scoped
                    API keys (created under Account → Developer settings) and
                    for the Supabase JWT path, where the org is ambiguous and
                    membership is verified against it.
                  examples:
                    - 123e4567-e89b-12d3-a456-426614174000
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                question:
                  type: string
                  minLength: 1
                  maxLength: 4000
                  description: The question the agent is asked.
                sql_query:
                  type: string
                  minLength: 1
                  maxLength: 100000
                  description: >-
                    The reference SQL that verifiably answers the question. Must
                    be a single read-only query.
                chart_definition:
                  description: >-
                    The reference chart config, as JSON text. Presence makes it
                    a chart question.
                  type: string
                useAsAgentContext:
                  description: >-
                    Use as agent context: whether the agent sees this question
                    and its answer as a worked example. Off means it is used
                    only by tests. On create, omitted means off. On update,
                    omitted leaves it unchanged. Takes effect on the draft;
                    production follows on publish.
                  type: boolean
                useAsExampleQuestion:
                  description: >-
                    Use as example question: offer this question as a starter
                    question when a person opens a new chat with nothing
                    personal to suggest (at most three, oldest first). On
                    create, omitted means off. On update, omitted leaves it
                    unchanged. Saved on the question's version, so production
                    follows on publish.
                  type: boolean
                dataPreview:
                  description: >-
                    Sampled rows stored alongside the SQL, for the chart
                    preview.
                  type: array
                  items: {}
                lockVersion:
                  description: >-
                    The question's lockVersion as you last read it. Sent, a
                    write is refused with 412 LOCK_VERSION_CONFLICT when the
                    question changed since; omitted, the write applies to
                    whatever the draft holds now.
                  type: integer
                  minimum: 0
                  maximum: 9007199254740991
              required: []
            examples:
              example1:
                value:
                  apiKey: up_embed_************
                  organizationId: 123e4567-e89b-12d3-a456-426614174000
      responses:
        '200':
          description: >-
            PATCH
            /v2/api/projects/:projectId/workspaces/:workspaceId/verified-questions/:verifiedQuestionId
            Positive response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    const: success
                  data:
                    type: object
                    properties:
                      success:
                        type: boolean
                        description: Always true on success.
                      id:
                        type: string
                        description: The verified question's id (its key).
                      versionId:
                        type: string
                        description: The content id of the version the draft now serves.
                      version:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        description: That version's number.
                      lockVersion:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        description: >-
                          The question's lockVersion now: send it on the next
                          write.
                    required:
                      - success
                      - id
                      - versionId
                      - version
                      - lockVersion
                    additionalProperties: false
                required:
                  - status
                  - data
                additionalProperties: false
        '400':
          description: >-
            PATCH
            /v2/api/projects/:projectId/workspaces/:workspaceId/verified-questions/:verifiedQuestionId
            Negative response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    const: error
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      code:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                    required:
                      - message
                    additionalProperties: false
                required:
                  - status
                  - error
                additionalProperties: false
      security:
        - APIKEY_1: []
components:
  securitySchemes:
    APIKEY_1:
      type: apiKey
      in: query
      name: apiKey
      x-in-actual: body
      description: apiKey MUST be supplied within the request body instead of query

````

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