Revalidate domain.
package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://js.wpengineapi.com/v1/accounts/example/apps/example/environments/example/domainMappings/example:revalidate"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <credentials>") 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://js.wpengineapi.com/v1/accounts/example/apps/example/environments/example/domainMappings/example:revalidate';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://js.wpengineapi.com/v1/accounts/example/apps/example/environments/example/domainMappings/example:revalidate \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{}'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Name of your WP Engine Headless Platform account
Name of your Headless Platform application
ID of your environment
Domain name of the domain associated with the environment by this DomainMapping Must be a valid domain name as defined in RFC-1123
Request Body
Section titled “Request Body”Request to revalidate domain.
object
Examplegenerated
{}Responses
Section titled “Responses”A successful response.
This resource represents a long-running operation that is the result of a network API call
object
Information if the operation is done or still in progress
Long running operation metadata
object
A URL/resource name that uniquely identifies the type of the serialized protocol buffer message
Build name in the format of: accounts/{account}/apps/{app}/environments/{environment}/builds/{build}
Environment ID
Operation name in the format of: accounts/{account}/apps/{app}/environments/{environment}/operations/{operation}
Examplegenerated
{ "done": true, "metadata": { "@type": "example", "build": "example", "envID": "example" }, "name": "example"}