# Update a knowledge page

Launch stage: Beta

`PATCH /api/2.0/knowledge/{name=pages/*}`

Update an existing knowledge page. For REST, send Page fields directly as
 the JSON body and supply `update_mask` as a query parameter. The resource
 `name` identifies the page; omitted mask fields retain their stored values.

 Errors: `INVALID_PARAMETER_VALUE` (field validation), `NOT_FOUND` (the page does
 not exist), `ALREADY_EXISTS` (a rename would collide with another published
 page), `RESOURCE_EXHAUSTED`, `ABORTED`, `INTERNAL_ERROR`.

API scopes: knowledge

## Path parameters

- `name` (string, required, ID, Immutable)
  Resource name in the form `pages/{page_id}`, where `page_id` is a
   server-generated UUID. Omit on create; required to identify the page on
   update. Get and Delete also address pages by this full resource name.

## Query parameters

- `update_mask` (string, required)
  Nonempty set of Page fields to update. Supported paths are `display_name`,
   `body`, `synonyms`, `description`, `state`, and `owner_ids`, without a `page.`
   prefix. Wildcards, `domain`, and server-assigned fields are not supported.
   In REST requests, pass a comma-separated query parameter, for example
   `update_mask=display_name,body`. There is no implicit update of all fields.

## Request body

The page to update. `name` is required in the form `pages/{page_id}`.
 Only fields selected by `update_mask` are written.
- `domain` (string, optional)
  Resource name of the domain this page belongs to; format `domains/{domain_id}`.
   Required on create. Use the full resource name rather than a bare domain ID.
   The domain is fixed after creation; updating it is not supported.
- `display_name` (string, optional)
  Human-readable title, 1 to 200 characters.
   Required on create and when selected by `update_mask`.
   Published titles must be unique within the domain.
- `body` (string, optional)
  Page body as Markdown text. An update replaces the entire body when
   `body` is selected by `update_mask`.
- `synonyms` (array of string, optional)
  Alternate names or abbreviations. Accepts at most 50 entries, each 1 to
   200 characters. Values are trimmed, deduplicated, and sorted.
   An update replaces the entire list when `synonyms` is selected by
   `update_mask`; an empty list clears it.
- `description` (string, optional)
  Short description of the page. An update replaces the description when
   `description` is selected by `update_mask`.
- `state` (string, optional)
  Lifecycle state. Omitting it on create defaults to `DRAFT`. Set `PUBLISHED`
   to publish or `DRAFT` to unpublish. An update selecting `state` in
   `update_mask` must explicitly supply `DRAFT` or `PUBLISHED`.
  Possible values:
  - `DRAFT`
  - `PUBLISHED`
- `owner_ids` (array of string, optional)
  Decimal principal ID strings for the page's single owner: a user, group,
   or service principal. Use principal IDs rather than email addresses or
   service-principal application UUIDs. On create, an omitted or empty list
   defaults to the caller; at most one ID may be supplied. An update selecting
   `owner_ids` in `update_mask` must supply exactly one ID to replace the owner.

## Returns

Returns the Page object.

## Response

```json
{
  "name": "string",
  "domain": "string",
  "display_name": "string",
  "body": "string",
  "synonyms": [
    "string"
  ],
  "description": "string",
  "state": "DRAFT",
  "create_time": "string",
  "update_time": "string",
  "owner_ids": [
    "string"
  ]
}
```

