TentoCMS
Classes

Class: PagesWriteResource

Pages write resource for creating, updating, and managing pages Requires a secret API key (tento_sk_*)

Pages write resource for creating, updating, and managing pages Requires a secret API key (tento_sk_*)

Methods

create()

create(input, idempotencyKey?): Promise<WritePage>;

Create a new page

Requires a secret API key (tento_sk_*); pass an optional idempotency key to make retries safe.

Parameters

ParameterTypeDescription
inputCreatePageInputThe page to create (pageTypeSlug, name, slug, fields, …)
idempotencyKey?stringOptional key so a retried request is not applied twice

Returns

Promise<WritePage>

The created page (draft until published)

Example

const writer = new TentoClient({ apiKey: 'tento_sk_...' })
const page = await writer.pagesWrite!.create({
  pageTypeSlug: 'landing-page',
  name: 'Summer Sale',
  slug: 'summer-sale',
  fields: { title: 'Summer Sale' },
})
await writer.pagesWrite!.publish(page.slug)

delete()

delete(slug, options?): Promise<void>;

Soft-delete a page

Parameters

ParameterType
slugstring
options?{ force?: boolean; }
options.force?boolean

Returns

Promise<void>


publish()

publish(slug): Promise<WritePage>;

Publish a page

Parameters

ParameterType
slugstring

Returns

Promise<WritePage>


unpublish()

unpublish(slug): Promise<WritePage>;

Unpublish a page (revert to draft)

Parameters

ParameterType
slugstring

Returns

Promise<WritePage>


update()

update(
   slug, 
   input, 
idempotencyKey?): Promise<WritePage>;

Update an existing page

Parameters

ParameterType
slugstring
inputUpdatePageInput
idempotencyKey?string

Returns

Promise<WritePage>


validate()

validate(input): Promise<DryRunResult>;

Validate page content without creating (dry-run)

Parameters

ParameterType
inputCreatePageInput

Returns

Promise<DryRunResult>

Copyright © 2026