Schedule Site Reports with the Hosting API
Use the WP Engine Hosting API to schedule recurring Site Reports for a production environment. You can choose which report sections to include, apply an existing custom branding template, configure recipients, and verify that the generated PDF was delivered successfully.
Before you begin
Section titled “Before you begin”Before you create a Site Report schedule, make sure the environment meets the following requirements:
- The environment must be a production environment.
- A custom domain must have been connected to the environment for at least two days. This allows enough time for the data required to populate the Site Report to become available.
- Each environment can have a maximum of three active Site Report schedules.
- Site Reports can be scheduled to run weekly, every two weeks, or monthly.
If you have a Premium or Agency plan, you can apply custom branding to a Site Report, including your logo, brand color, and company name. You can also remove references to WP Engine from report content and deliver reports to any email address.
On other plans, reports use WP Engine branding and can only be delivered to email addresses associated with users on your account.
Key Terms
Section titled “Key Terms”- Reports - Refers to the actual PDF file generated when a Site Report is run at a scheduled time.
- Schedules - These are the active scheduled report runs for a given environment. Each schedule includes all of the information needed to create and email a report. Each environment can have a maximum of three schedules.
- Templates - They contain branding and report content information. These are reusable and can be used to create new schedules with the same branding and content as used in previous schedules.
- Recipients - The email addresses of the people a scheduled Site Report is sent to.
1. Create a Site Report template (optional)
Section titled “1. Create a Site Report template (optional)”If you want to apply reusable custom branding to your scheduled reports, first create a Site Report template in the WP Engine User Portal.
Log in to the WP Engine User Portal and create a one-time Site Report. Add your preferred branding and company name, then select Save as template on the Report settings page.
For more information, see the Site Report Support documentation.
After you create a template, you can reuse it for multiple Site Report schedules within the same account.
2. Get the template ID
Section titled “2. Get the template ID”If you want to apply an existing template to your scheduled report, retrieve its template ID using the List report templates endpoint.
Skip this step if you want to use the default WP Engine branding.
Example request:
# Replace 12345 with your account IDcurl -X GET \--url "https://api.wpengineapi.com/v1/site_reports/templates?account_id=12345" \-u "$WPE_API_USER_ID:$WPE_API_PASSWORD"const user = process.env.WPE_API_USER_ID;const pass = process.env.WPE_API_PASSWORD;const auth = "Basic " + Buffer.from(`${user}:${pass}`).toString("base64");const accountId = 12345; // replace with your account ID
try { const res = await fetch(`https://api.wpengineapi.com/v1/site_reports/templates?account_id=${accountId}`, { method: "GET", headers: { Authorization: auth, "Content-Type": "application/json" } }); if (!res.ok) throw new Error(`Request failed: ${res.status}`); console.log(await res.json());} catch (e) { console.error(e); }The response includes the templates available to your account.
For example:
{ "templates": [ { "template_uuid": "12345678-90ab-cdef-1234-567890abcdab", "template_name": "Quick Data Template" } ]}Copy the template_uuid value for the template you want to use. You will add this value when you create the Site Report schedule.
For the complete response schema and available fields, see the List report templates API reference.
3. Choose the report sections to include
Section titled “3. Choose the report sections to include”Use the List report sections endpoint to retrieve the sections that can be included in a Site Report.
Example request:
curl -X GET \ --url "https://api.wpengineapi.com/v1/site_reports/sections" \ -u "$WPE_API_USER_ID:$WPE_API_PASSWORD"const user = process.env.WPE_API_USER_ID;const pass = process.env.WPE_API_PASSWORD;const auth = "Basic " + Buffer.from(`${user}:${pass}`).toString("base64");
try { const res = await fetch('https://api.wpengineapi.com/v1/site_reports/sections', { method: "GET", headers: { Authorization: auth, "Content-Type": "application/json" } }); if (!res.ok) throw new Error(`Request failed: ${res.status}`); console.log(await res.json());} catch (e) { console.error(e); }The response includes the available report sections.
For example:
{ "sections": [ { "name": "cover" }, { "name": "overview" }, { "name": "plugins" } ]}Note the name value for each section you want to include in the report. You will add these values to the sections array when you create the schedule.
The sections you specify when creating the schedule override any default sections configured in the selected template.
For the complete list of section properties, see the List report sections API reference.
4. Create the report schedule
Section titled “4. Create the report schedule”Use the Create a report schedule endpoint to create the recurring Site Report schedule.
Configure the request with:
- The ID of the site you want to report on.
- A title for the schedule.
- The date when the first report should run.
- The report frequency.
- The report recipients.
- The report section
namevalues you selected in the previous step. - The
template_uuidof the template you want to apply, if applicable.
Leave template_uuid empty if you want to use the default WP Engine branding.
Example request:
# Replace 12345 with your site IDcurl -X POST "https://api.wpengineapi.com/v1/site_reports/schedules" \-u "$WPE_API_USER_ID:$WPE_API_PASSWORD" \-H "Content-Type: application/json" \-d '{"site_id": "12345","title": "Sample schedule","next_scheduled_date": "2026-07-30T00:00:00.000Z","frequency": { "unit": "DAYS", "value": 7},"recipients": [ { "name": "John Doe", "email": "example@example.com" }],"sections": [ { "name": "cover" }, { "name": "overview" }, { "name": "themes" }],"template_uuid": ""}'const user = process.env.WPE_API_USER_ID;const pass = process.env.WPE_API_PASSWORD;const auth = "Basic " + Buffer.from(`${user}:${pass}`).toString("base64");const schedule = {site_id: "12345", // Replace with your site IDtitle: "Sample schedule",next_scheduled_date: "2026-07-30T00:00:00.000Z",frequency: { unit: "DAYS", value: 7},recipients: [ { name: "John Doe", email: "example@example.com" }],sections: [ { name: "cover" }, { name: "overview" }, { name: "themes" }],template_uuid: "" // Optional: set to your template UUID to apply};
try {const res = await fetch("https://api.wpengineapi.com/v1/site_reports/schedules", { method: "POST", headers: { Authorization: auth, "Content-Type": "application/json" }, body: JSON.stringify(schedule) }); if (!res.ok) throw new Error(`Request failed: ${res.status}`); console.log(await res.json());} catch (e) { console.error(e); }A successful request returns:
{ "message": "OK!"}5. Verify the schedule and generated report
Section titled “5. Verify the schedule and generated report”After you create the schedule, verify that it was created successfully and that the report generates as expected.
- Call the List report schedules endpoint and confirm that your new schedule appears in the response.
- Confirm that the schedule configuration, recipients, frequency, and report sections match your intended settings.
- Wait for the configured
next_scheduled_dateto pass. - Call the List site reports endpoint to confirm that the scheduled report was generated successfully.
- Use the report’s
download_urlto open the generated PDF. - Verify that the PDF contains the expected sections and branding.
- Confirm that the report was delivered to the configured recipient email addresses.
Your Site Report schedule will continue generating reports according to the configured frequency.