Refresh a site's current state
package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.ai.wpengine.com/v1/sites/example/heartbeat"
payload := strings.NewReader("{ \"site_info\": { \"active_plugins\": [ \"example\" ], \"php_version\": \"8.2.0\", \"wp_version\": \"6.5.0\", \"active_theme\": \"twentytwentyfour\", \"locale\": \"en_US\", \"server_software\": \"Apache/2.4.57\", \"db_version\": \"8.0.33\", \"memory_limit\": \"256M\", \"timezone\": \"America/Chicago\", \"active_plugin_count\": 12, \"ssl_valid\": true, \"is_multisite\": false, \"wp_debug\": false }, \"plugin_status\": \"active\", \"abilities\": [ { \"name\": \"example\", \"label\": \"example\", \"description\": \"example\", \"category\": \"example\", \"input_schema\": {}, \"output_schema\": {}, \"meta\": {}, \"run_url\": \"https://example.com\" } ] }")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://api.ai.wpengine.com/v1/sites/example/heartbeat';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"site_info":{"active_plugins":["example"],"php_version":"8.2.0","wp_version":"6.5.0","active_theme":"twentytwentyfour","locale":"en_US","server_software":"Apache/2.4.57","db_version":"8.0.33","memory_limit":"256M","timezone":"America/Chicago","active_plugin_count":12,"ssl_valid":true,"is_multisite":false,"wp_debug":false},"plugin_status":"active","abilities":[{"name":"example","label":"example","description":"example","category":"example","input_schema":{},"output_schema":{},"meta":{},"run_url":"https://example.com"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.ai.wpengine.com/v1/sites/example/heartbeat', [ 'body' => '{ "site_info": { "active_plugins": [ "example" ], "php_version": "8.2.0", "wp_version": "6.5.0", "active_theme": "twentytwentyfour", "locale": "en_US", "server_software": "Apache/2.4.57", "db_version": "8.0.33", "memory_limit": "256M", "timezone": "America/Chicago", "active_plugin_count": 12, "ssl_valid": true, "is_multisite": false, "wp_debug": false }, "plugin_status": "active", "abilities": [ { "name": "example", "label": "example", "description": "example", "category": "example", "input_schema": {}, "output_schema": {}, "meta": {}, "run_url": "https://example.com" } ] }', 'headers' => [ 'Authorization' => 'Bearer <token>', 'Content-Type' => 'application/json', ],]);
echo $response->getBody();curl --request POST \ --url https://api.ai.wpengine.com/v1/sites/example/heartbeat \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "site_info": { "active_plugins": [ "example" ], "php_version": "8.2.0", "wp_version": "6.5.0", "active_theme": "twentytwentyfour", "locale": "en_US", "server_software": "Apache/2.4.57", "db_version": "8.0.33", "memory_limit": "256M", "timezone": "America/Chicago", "active_plugin_count": 12, "ssl_valid": true, "is_multisite": false, "wp_debug": false }, "plugin_status": "active", "abilities": [ { "name": "example", "label": "example", "description": "example", "category": "example", "input_schema": {}, "output_schema": {}, "meta": {}, "run_url": "https://example.com" } ] }'Reports current WordPress environment and plugin status. When abilities are included, they replace the site’s cached ability catalog. A registration that exists but is not currently active (for example, temporarily suspended) receives a 403 with error code site_not_active; that state is recoverable, and clients must not clear local credentials on it — only the explicit 404 site_authorization_revoked response is the revocation signal.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The OAuth client identifier of the reporting site.
Request Bodyrequired
Section titled “Request Bodyrequired”object
WordPress environment metadata collected by the plugin at registration time. All fields are optional.
object
Names of currently active WordPress plugins.
Example
8.2.0Example
6.5.0Example
twentytwentyfourExample
en_USExample
Apache/2.4.57Example
8.0.33Example
256MExample
America/ChicagoTotal number of active plugins on the site. May exceed len(active_plugins) when the plugin list was truncated at 500 items.
Example
12Example
trueExample
falseExample
falsePower plugin lifecycle status. Omit this property when the heartbeat is sent by a shared auth consumer that does not own Power lifecycle.
Current ability descriptors. Omit this property to leave the cached catalog unchanged; send an empty array to clear it.
object
object
object
object
Responses
Section titled “Responses”Site state was refreshed.
object
Example
{ "abilities_sync_status": "never_synced", "plugin_status": "active"}Invalid request body or parameters
object
object
Correlation ID for this request, matching the X-Request-ID response header — a 32-character trace ID behind the load balancer, otherwise a UUID. Quote it in support reports.
Example
{ "error": { "type": "invalid_request_error", "request_id": "80f1e2c3a4b5c6d7e8f9a0b1c2d3e4f5" }}Missing or invalid bearer token
object
object
Correlation ID for this request, matching the X-Request-ID response header — a 32-character trace ID behind the load balancer, otherwise a UUID. Quote it in support reports.
Example
{ "error": { "type": "invalid_request_error", "request_id": "80f1e2c3a4b5c6d7e8f9a0b1c2d3e4f5" }}Headers
Section titled “Headers”Example
Bearer realm="ai-services"The token is valid, but the caller is not permitted to perform this action — either its scope/permission is insufficient or the authenticated user is not authorized for the target account (error type “permission_error”). On /v1/chat/completions specifically, a 403 with error type “content_policy_violation” instead means the request content was blocked by content moderation policy; that response never identifies which filter or category matched.
object
object
Correlation ID for this request, matching the X-Request-ID response header — a 32-character trace ID behind the load balancer, otherwise a UUID. Quote it in support reports.
Example
{ "error": { "type": "invalid_request_error", "request_id": "80f1e2c3a4b5c6d7e8f9a0b1c2d3e4f5" }}The authenticated site’s authorization has been revoked or no longer exists. The response error code is site_authorization_revoked; clients may use that explicit code to clear local credentials.
object
Example
{ "error": "site_authorization_revoked", "message": "this site's authorization has been revoked"}Request body exceeds the 64 KiB limit
object
object
Correlation ID for this request, matching the X-Request-ID response header — a 32-character trace ID behind the load balancer, otherwise a UUID. Quote it in support reports.
Example
{ "error": { "type": "invalid_request_error", "request_id": "80f1e2c3a4b5c6d7e8f9a0b1c2d3e4f5" }}