Update page
POST/wiki/pages/:pageID
Update page.
content rules
For collaboration pages whose refType is collaboration:
- The
contentfield in the request body is a string, but its value must be JSON that conforms to the Wiz collaboration document structure. Do not pass plain text directly. - The top-level document structure must contain at least
blocks,comments, andmeta, for example{"blocks": [...], "comments": {}, "meta": {}}. See Document Data Structure for detailed Block and container rules. - When updating an existing page, get the page details first, parse the returned
content, modify the existing document object, and then serialize it again. This avoids losing unchanged data such as table cells, code block containers, and comments. - Before calling this API, serialize the document object to a string and use that string as the
contentfield in the request body.
Request body example:
{
"content": "{\"blocks\":[{\"id\":\"A12345678\",\"type\":\"text\",\"text\":[{\"insert\":\"Updated content\"}]}],\"comments\":{},\"meta\":{}}"
}
If content includes resources, attachments, or cards, call related APIs first and then write returned IDs or card info into content before updating.
Recommended sequence:
- Upload resources by
POST /wiki/pages/{pageID}/resources. - Upload attachments by
POST /wiki/pages/{pageID}/attachments. - Create cards by
POST /wiki/pages/{pageID}/cardsif needed. - Call this API with final
content.
Request
Path Parameters
The page ID
Query Parameters
The team ID
User ID, this parameter can only be passed when calling as an Oauth bot. It is used to perform operations as the specified user
- application/json
Body
required
At least one of title or content must be provided; they cannot both be empty.
The page title
The page content. For collaboration pages, this must be a JSON string that conforms to the Wiz collaboration document structure, not plain text. The top-level document structure must contain at least blocks, comments, and meta. See Document Data Structure for details.
Responses
- 200
- 401
- 403
- 404
- 500
Request is successful.
- application/json
- Schema
- Example (from schema)
Schema
The result of this request.
The error code of this request.
Error message for this request.
Error meta data for this request.
{
"result": "string",
"errorCode": "string",
"errorMsg": "string",
"errorData": {}
}
Returned if the authentication credentials are incorrect or missing.
- application/json
- Schema
- Example (from schema)
Schema
The result of this request.
The error code of this request.
Error message for this request.
{
"result": "FAIL",
"errorCode": "Unauthorized",
"errorMsg": "Access token is invalid"
}
Returns if the scope check fails.
- application/json
- Schema
- Example (from schema)
Schema
The result of this request.
The error code of this request.
Error message for this request.
{
"result": "FAIL",
"errorCode": "Forbidden",
"errorMsg": "Scope is invalid"
}
Returned if the resource object was not found.
- application/json
- Schema
- Example (from schema)
Schema
The result of this request.
The error code of this request.
Error message for this request.
{
"result": "FAIL",
"errorCode": "NotFound",
"errorMsg": "Not Found"
}
Internal Server Error.
- application/json
- Schema
- Example (from schema)
Schema
The result of this request.
The error code of this request.
Error message for this request.
{
"result": "FAIL",
"errorCode": "Internal Server Error",
"errorMsg": "Internal Server Error"
}