Overview
The Page Template endpoints provide access to pre-designed templates that users can use as starting points for creating new web stories. Templates are stored as a custom post type. Base Path:/wp-json/web-stories/v1/web-story-page-template
List Templates
Retrieves a collection of available page templates.GET /web-stories/v1/web-story-page-template
Query Parameters
Scope:
view, edit, or embedCurrent page number
Maximum number of items (max 100)
Search templates by title
Sort by:
date, title, modifiedSort order:
asc or descInclude embedded resources
Wrap response in envelope for preloading
Response
Get Template
Retrieves a single page template by ID.GET /web-stories/v1/web-story-page-template/:id
Path Parameters
Unique identifier for the template
Response Fields
Unique identifier for the template
Creation date in ISO 8601 format
URL-friendly slug
Template status (typically
publish)Template title
Template HTML content
JSON structure of the template
Template creator user ID
Featured media attachment ID (template preview image)
Create Template
Creates a new page template. Requires elevated permissions.POST /web-stories/v1/web-story-page-template
Request Body
Template title
Template HTML content
JSON template structure with pages and elements
Template status:
publish, draft, pendingPreview image attachment ID
Response
Returns the created template object with HTTP 201 status.Update Template
Updates an existing page template.PUT /web-stories/v1/web-story-page-template/:id
Path Parameters
Unique identifier for the template
Request Body
Accepts the same parameters as Create Template. All fields are optional.Like stories,
content and story_data should be updated together.Response
Returns the updated template object with HTTP 200 status.Delete Template
Deletes a page template.DELETE /web-stories/v1/web-story-page-template/:id
Path Parameters
Unique identifier for the template
Query Parameters
Whether to bypass trash and force deletion
Response
Using Templates to Create Stories
Templates can be used as a starting point when creating new stories:Permissions
Page template endpoints require specific permissions:List/Get Templates: Requires
edit_web-stories capabilityUsers must have permission to edit web stories to access templatesCreate Templates: Requires
edit_web-stories capabilityOnly users who can edit web stories can create templatesUpdate Templates: Requires
edit_web-story or edit_others_web-stories capabilityDelete Templates: Requires
delete_web-story or delete_others_web-stories capabilityTemplate Schema
Templates follow the same data structure as stories but are meant to be reusable starting points. Key differences:- Templates don’t include user-specific content
- Template
story_datacontains placeholder content - Templates are published and shared across all users
- Templates typically have preview images as featured media
Common Errors
Status 403: You are not allowed to edit page templatesRequired capability:
edit_web-storiesStatus 404: Template with the specified ID does not exist
Schema Differences from Stories
The Page Template endpoint extendsStories_Base_Controller but has some schema modifications:
- Removes
permalink_templateproperty (not needed for templates) - Removes
generated_slugproperty (not needed for templates) - Maintains
story_datastructure identical to stories