---
title: "Update Assessment"
method: PATCH
path: "/webchat/assessments/{assessment_id}"
tags: ["Web Chat"]
---

# Update Assessment

`PATCH /webchat/assessments/{assessment_id}`

## Request

- Base URL: `https://be.graph8.com/api/v1`
- URL: `https://be.graph8.com/api/v1/webchat/assessments/{assessment_id}`
- Auth: HTTP bearer

Partial edit of an assessment.

`active: false` takes it out of the widget without deleting it, which is
the reversible way to retire one.

The concurrency field is `revision` here, not `expected_revision`. That is
the app's spelling on this model alone and is mirrored deliberately - a
tidier name would be a field the handler does not read, silently switching
the check off.

## Path parameters

- `assessment_id` string, required: Assessment id.

## Headers

- `Authorization` string, nullable
- `X-Target-Org-Id` string, nullable

## Request body

- AssessmentUpdateRequest: Partial edit of an assessment. `revision` is this model's optimistic-concurrency field. Note it is spelled `revision` here and `expected_revision` on every other webchat model - that is the app's own inconsistency, and it is mirrored rather than tidied, because renaming it would send the app a field it does not read and the concurrency check would silently stop happening.
  - `name` string, nullable
  - `description` string, nullable
  - `definition` AssessmentDefinition: Complete branching graph stored as JSONB in chat_assessments.definition.
    - `start_step_id` string, required
    - `steps` AssessmentStepDef[]
      - `id` string, required
      - `question` string, required
      - `answers` AssessmentAnswerDef[]
        - `id` string, required
        - `text` string, required
        - `next_step_id` string, nullable
        - `result_id` string, nullable
      - `allow_free_text` boolean
    - `results` AssessmentResultDef[]
      - `id` string, required
      - `title` string, required
      - `body` string
      - `booking_enabled` boolean
      - `handoff_enabled` boolean
      - `links` AssessmentResultLink[]
        - `label` string, required
        - `url` string, required
  - `active` boolean, nullable
  - `surface` 'external' | 'internal', nullable
  - `revision` integer, nullable: Revision you last read. See the note above on the name.

## Response `200`

Successful Response

- ApiResponseWebchatPayload
  - `data` WebchatPayload, required: An open envelope for one webchat object. Open because the widget's config grows a field per product decision and a pinned schema would DROP it. Same choice the desk surface made.
  - `pagination` PaginationMeta
    - `page` integer, required: Current page number (1-indexed)
    - `limit` integer, required: Items per page
    - `total` integer, required: Total number of items
    - `has_next` boolean, required: Whether there are more pages
    - `next_cursor` string, nullable: Opaque cursor for the next page; null when there are no more items. Pass it back as the `cursor` query param to fetch the following page without computing page numbers.
    - `total_available` integer, nullable: Search endpoints only: how many records really match, when known. Can be larger than `total`, which is capped at the 10,000 results that can be paged. For company search this is a distinct-company estimate. Null when unknown; absent outside search.
    - `total_is_lower_bound` boolean, nullable: Search endpoints only: true when more records match than `total` shows (the result set is larger than the 10,000 results that can be paged). Absent outside search.
    - `notes` string[], nullable: Search endpoints only: plain-language notes about the result, e.g. that more records match than can be paged, or that a reversed `between` range was put in order.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/graph8/apis/graph8-developer-api.md) · [All operations](https://skmtc.dev/graph8/apis/graph8-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/graph8/apis/graph8-developer-api/revisions/89fc11143b70?raw)
