Skip to content
WP EngineDocumentation

Deregister a site

DELETE
/v1/sites/{client_id}
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('DELETE', 'https://api.ai.wpengine.com/v1/sites/example', [
'headers' => [
'Authorization' => 'Bearer <token>',
],
]);
echo $response->getBody();

Deregisters the calling site, revoking its registration along with any site activations and connected WordPress user accounts. Called by the WordPress plugin when a site disconnects. The caller must authenticate with the site’s own oauth-ext access token, and — unlike GET and PATCH on this path — the path identifier must be the client_id that token was issued for, not the site’s site_id. Requests for any other site are answered with 404 rather than 403 so a site cannot probe for the existence of registrations it does not own. Deregistration is idempotent from the caller’s point of view: once the registration is revoked, subsequent calls return 404.

client_id
required
string

The site’s stable site_id, or its client_id (the original credential identifier), which remains supported for backward compatibility.

The site was deregistered.

Media typeapplication/json
object
status
required

Confirms the registration was revoked.

string
Allowed values: deregistered
Example
{
"status": "deregistered"
}

Missing or invalid bearer token

Media typeapplication/json
object
error
required
object
message
required
string
type
required
string
code
required
integer
request_id
required

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.

string
Example
{
"error": {
"type": "invalid_request_error",
"request_id": "80f1e2c3a4b5c6d7e8f9a0b1c2d3e4f5"
}
}
WWW-Authenticate
string
Example
Bearer realm="ai-services"

No active registration matches the path identifier, or it does not belong to the authenticated site.

The server encountered an unexpected error while handling the request. Safe to retry once; if it persists, the cause is server-side and the request payload was not the problem.

Media typeapplication/json
object
error
required
object
message
required
string
type
required
string
code
required
integer
request_id
required

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.

string
Example
{
"error": {
"type": "invalid_request_error",
"request_id": "80f1e2c3a4b5c6d7e8f9a0b1c2d3e4f5"
}
}