---
title: "Modify Existing Page"
method: POST
path: "/api/websites/{website_id}/pages/{page_id}/modify"
tags: ["AI Page Generator - Protected"]
---

# Modify Existing Page

`POST /api/websites/{website_id}/pages/{page_id}/modify`

Modify an existing page using AI based on user instructions.

This endpoint allows conversational AI modifications:
1. Fetches the existing page blocks
2. Uses AI to modify the page based on user instructions
3. Maintains consistency with the website theme
4. Updates the page in database and re-uploads to S3

You can call this endpoint multiple times for iterative refinement.

Example instructions:
- "Add a testimonials section after the services section"
- "Change the hero banner background to gradient style"
- "Remove the pricing section and add a contact form instead"
- "Make the text more professional and formal"

## Path parameters

- `website_id` integer, required
- `page_id` integer, required

## Headers

- `x-api-token` string, nullable

## Request body

- ModifyPageRequest
  - `instructions` string, required

## Response `200`

Successful Response

- ModifyPageResponse
  - `success` boolean, required
  - `page_id` integer, required
  - `slug` string, required
  - `blocks_updated` integer, required
  - `message` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/multigest/apis/multigest-protected-api.md) · [All operations](https://skmtc.dev/multigest/apis/multigest-protected-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/multigest/multigest-protected-api/revisions/4b44eb76b3ee/schema)
