createPage method

Future<PageSingle> createPage({
  1. bool? embedded,
  2. bool? private,
  3. required PageCreateRequest body,
})

Creates a page in the space.

Pages are created as published by default unless specified as a draft in the status field. If creating a published page, the title must be specified.

Permissions required: Permission to view the corresponding space. Permission to create a page in the space.

Implementation

Future<PageSingle> createPage(
    {bool? embedded, bool? private, required PageCreateRequest body}) async {
  return PageSingle.fromJson(await _client.send(
    'post',
    'pages',
    queryParameters: {
      if (embedded != null) 'embedded': '$embedded',
      if (private != null) 'private': '$private',
    },
    body: body.toJson(),
  ));
}