### Authenticate with WP Engine API using cURL Source: https://wpengineapi.com/quick-start Example of how to make a GET request to fetch installs using cURL with Basic Authentication. It demonstrates sending API credentials in the Authorization header. ```bash curl -X GET "https://api.wpengineapi.com/v1/installs?limit=5" \ -u "$WPE_API_USER_ID:$WPE_API_PASSWORD" ``` -------------------------------- ### Example Requests in Multiple Languages Source: https://wpengineapi.com/quick-start Provides code examples in Go, JavaScript, PHP, and Python to fetch your installs using the API credentials stored in environment variables. ```APIDOC ## Example API Requests ### Description These examples demonstrate how to make a GET request to fetch your WordPress installations using the WP Engine API in various programming languages. ### Go Example ```go package main import ( "fmt" "io" "net/http" "os" ) func main() { user := os.Getenv("WPE_API_USER_ID") pass := os.Getenv("WPE_API_PASSWORD") url := "https://api.wpengineapi.com/v1/installs?limit=5" req, _ := http.NewRequest("GET", url, nil) req.SetBasicAuth(user, pass) resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### JavaScript (Node.js) Example ```javascript 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 res = await fetch("https://api.wpengineapi.com/v1/installs?limit=5", { headers: { Authorization: auth }, }); console.log(await res.json()); ``` ### PHP Example ```php ``` ### Python Example ```python import os, requests url = "https://api.wpengineapi.com/v1/installs?limit=5" resp = requests.get(url, auth=( os.environ['WPE_API_USER_ID'], os.environ['WPE_API_PASSWORD'] )) print(resp.json()) ``` ``` -------------------------------- ### Fetch Installs using WP Engine API in Multiple Languages Source: https://wpengineapi.com/quick-start Provides code examples for fetching WP Engine installs using environment variables for authentication. Supports Go, JavaScript, PHP, and Python. ```go package main import ( "fmt" "io" "net/http" "os" ) func main() { user := os.Getenv("WPE_API_USER_ID") pass := os.Getenv("WPE_API_PASSWORD") url := "https://api.wpengineapi.com/v1/installs?limit=5" req, _ := http.NewRequest("GET", url, nil) req.SetBasicAuth(user, pass) resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ```javascript 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 res = await fetch("https://api.wpengineapi.com/v1/installs?limit=5", { headers: { Authorization: auth }, }); console.log(await res.json()); ``` ```php console.log(i.name)); } catch (e) { console.error(e); } ``` ```python import os, requests user = os.getenv("WPE_API_USER_ID") password = os.getenv("WPE_API_PASSWORD") url = "https://api.wpengineapi.com/v1/installs?limit=3" resp = requests.get(url, auth=(user, password), timeout=10) for install in resp.json().get("results", []): print(install["name"]) ``` -------------------------------- ### GET /v1/installs Source: https://wpengineapi.com/tutorial Retrieves a list of all WordPress installs associated with your account. Supports pagination. ```APIDOC ## GET /v1/installs ### Description The `/installs` endpoint returns all WordPress installs accessible to your account. It supports querying with parameters like `limit` and `offset` for pagination. ### Method GET ### Endpoint `/v1/installs` ### Query Parameters - **limit** (integer) - Optional - The maximum number of installs to return per page. - **offset** (integer) - Optional - The number of installs to skip before returning results. Used for pagination. ### Request Example #### cURL ```bash curl -u "$WPE_API_USER_ID:$WPE_API_PASSWORD" \ "https://api.wpengineapi.com/v1/installs?limit=3" ``` #### Go ```go package main import ( "fmt" "io" "net/http" "os" ) func main() { user := os.Getenv("WPE_API_USER_ID") pass := os.Getenv("WPE_API_PASSWORD") url := "https://api.wpengineapi.com/v1/installs?limit=3" req, _ := http.NewRequest("GET", url, nil) req.SetBasicAuth(user, pass) resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) } ``` #### JavaScript ```javascript 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/installs?limit=3", { headers: { Authorization: auth } }); if (!res.ok) throw new Error(`Request failed: ${res.status}`); const data = await res.json(); data.results?.forEach(i => console.log(i.name)); } catch (e) { console.error(e); } ``` #### Python ```python import os, requests user = os.getenv("WPE_API_USER_ID") password = os.getenv("WPE_API_PASSWORD") url = "https://api.wpengineapi.com/v1/installs?limit=3" resp = requests.get(url, auth=(user, password), timeout=10) for install in resp.json().get("results", []): print(install["name"]) ``` ### Response #### Success Response (200) - **count** (integer) - The total number of installs available. - **results** (array of objects) - A list of install objects. - **id** (integer) - The unique identifier for the install. - **name** (string) - The name of the install. - **account_id** (integer) - The ID of the account the install belongs to. - **created_at** (string) - The timestamp when the install was created (ISO 8601 format). - **next** (string) - The URL for the next page of results, if available. #### Response Example ```json { "count": 232, "results": [ { "id": 12345, "name": "marketing-site", "account_id": 67890, "created_at": "2024-01-01T12:00:00Z" }, { "id": 12346, "name": "blog-site", "account_id": 67890, "created_at": "2024-01-02T15:00:00Z" } ], "next": "https://api.wpengineapi.com/v1/installs?limit=3&offset=3" } ``` ``` -------------------------------- ### GET /installs Source: https://wpengineapi.com/reference/operations/listinstalls Retrieves a list of your WordPress installations. You can filter the results using query parameters. ```APIDOC ## GET /installs ### Description Retrieves a list of WordPress installations associated with your account. Supports pagination and filtering. ### Method GET ### Endpoint /installs ### Parameters #### Query Parameters - **limit** (integer) - Optional - The number of records to return per page. Defaults to 100. - **offset** (integer) - Optional - The starting record index for pagination. Defaults to 0. - **account_id** (string) - Optional - The UUID of the account to filter installations by. ### Request Example ``` GET /installs?limit=50&offset=100 ``` ### Response #### Success Response (200) - **previous** (string) - URL to the previous page of results. - **next** (string) - URL to the next page of results. - **count** (integer) - The total number of installations found. - **results** (array) - An array of WordPress installation objects. - **id** (string) - Required - The unique identifier for the installation. - **name** (string) - Required - The name of the installation. - **account** (object) - Required - Details about the associated account. - **id** (string) - The account ID. - **php_version** (string) - Required - The PHP version used by the installation. - **status** (string) - The current status of the installation (e.g., 'active', 'pending'). - **site** (object) - Details about the website associated with the installation. - **id** (string) - The site ID. - **cname** (string) - The CNAME of the install. - **stable_ips** (array) - A list of stable IP addresses for the install. - **environment** (string) - The environment type (e.g., 'production', 'staging', 'development'). - **primary_domain** (string) - The primary domain of the install. - **is_multisite** (boolean) - Indicates if the installation is a multisite setup. - **created_at** (string) - The date and time the install was created (ISO 8601 format). - **wp_version** (string) - The WordPress version installed (only for individual install requests). - **defer_wordpress_upgrades_until** (string) - Date until which WordPress major upgrades are deferred (ISO 8601 format). #### Error Responses - **400 Bad Request**: Indicates a malformed request. - **401 Unauthorized**: Indicates missing or invalid authentication credentials. - **429 Too Many Requests**: Indicates the rate limit has been exceeded. - **503 Service Unavailable**: Indicates the service is temporarily unavailable. ``` -------------------------------- ### Request New WordPress Backup (Error Example - 404) Source: https://wpengineapi.com/reference/operations/createbackup An example of a JSON response when the requested resource (e.g., a specific installation) is not found (404). ```json { "message": "Not Found", "documentation_url": "(Optional) A URL where documentation regarding this specific error can be found" } ``` -------------------------------- ### GET /installs/{install_id} Source: https://wpengineapi.com/reference/operations/getinstall Retrieves details for a specific WordPress install identified by its ID. This endpoint is useful for fetching comprehensive information about a single installation, including its configuration, domain, and status. ```APIDOC ## GET /installs/{install_id} ### Description Returns a single Install by its ID. ### Method GET ### Endpoint /installs/{install_id} ### Parameters #### Path Parameters - **install_id** (string) - Required - ID of the install, expected to be a UUID. #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **id** (string) - Required - The unique identifier for the install (UUID). - **name** (string) - Required - The name of the install. - **account** (object) - Required - Information about the account the install belongs to. - **id** (string) - The account ID (UUID). - **php_version** (string) - Required - The PHP version used by the install. - **status** (string) - The status of the install (e.g., 'active', 'pending'). - **site** (object) - Information about the website associated with the install. - **id** (string) - The site ID (UUID). - **cname** (string) - The CNAME of the install. - **stable_ips** (Array) - A list of stable IPs bound to the install. - **environment** (string) - The environment type (e.g., 'production', 'staging', 'development'). - **primary_domain** (string) - The primary domain for the install. - **is_multisite** (boolean) - Indicates if the install is a multisite installation. - **created_at** (string) - The date and time the install was created in UTC (ISO 8601 format). - **wp_version** (string) - The WordPress version installed. - **defer_wordpress_upgrades_until** (string) - If set, automatic WordPress core major updates will be deferred until this date (ISO 8601 format). #### Response Example ```json { "id": "294deacc-d8b8-4005-82c4-0727ba8ddde0", "name": "torquemag", "account": { "id": "eeda3227-9a39-46ae-9e14-20958bb4e6c9" }, "php_version": "7.0", "status": "active", "site": { "id": "28c78b6d-c2da-4f09-85f5-1ad588089b2d", "cname": "mywebsite.wpengine.com" }, "stable_ips": [ "1.2.3.2", "1.1.1.2" ], "environment": "production", "primary_domain": "mywebsite.wpengine.com", "is_multisite": false, "created_at": "2025-06-12T09:56:42.386Z", "wp_version": "6.8.1", "defer_wordpress_upgrades_until": "2025-12-31T23:59:59.999Z" } ``` ### Error Handling - **401**: Authentication Error. Response includes `message` and optional `documentation_url`. - **404**: Not Found. Response includes `message` and optional `documentation_url`. - **429**: Too Many Requests. - **503**: Service Unavailable. ``` -------------------------------- ### Setting Environment Variables for Credentials Source: https://wpengineapi.com/quick-start Stores your sensitive API User ID and API Password in environment variables for secure access without hardcoding. ```APIDOC ## Environment Variables ### Description It is recommended to store your API credentials in environment variables for security purposes. ### Usage Set the following environment variables in your system: ```bash export WPE_API_USER_ID="YOUR_API_USER_ID" export WPE_API_PASSWORD="YOUR_API_PASSWORD" ``` These variables can then be referenced in your code or scripts. ``` -------------------------------- ### Request New WordPress Backup (JSON Example) Source: https://wpengineapi.com/reference/operations/createbackup An example of the JSON payload required to initiate a backup request for a WordPress installation. It includes a description for the backup and a list of email addresses to notify upon completion. ```json { "description": "Taking a backup of torquemag before I start developing new features for it", "notification_emails": [ "myself@torquemag.com", "other_person_interested_in_backup@torquemag.com" ] } ``` -------------------------------- ### Set WP Engine API Credentials as Environment Variables Source: https://wpengineapi.com/quick-start Demonstrates how to securely store WP Engine API User ID and Password in environment variables. This is the recommended approach to avoid hardcoding sensitive credentials. ```bash export WPE_API_USER_ID="YOUR_API_USER_ID" export WPE_API_PASSWORD="YOUR_API_PASSWORD" ``` -------------------------------- ### GET /installs/{install_id}/backups/{backup_id} Source: https://wpengineapi.com/reference/operations/showbackup Retrieves the status of a backup of a WordPress installation. Possible statuses include requested, initiated, completed, and aborted. ```APIDOC ## GET /installs/{install_id}/backups/{backup_id} ### Description Retrieves the status of a backup of a WordPress installation. Possible statuses include `requested`, `initiated`, `completed`, `aborted`. ### Method GET ### Endpoint /installs/{install_id}/backups/{backup_id} ### Parameters #### Path Parameters - **install_id** (string) - Required - ID of install (uuid format) - **backup_id** (string) - Required - ID of backup (uuid format) ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **id** (string) - The ID of the backup. - **status** (string) - State of the backup. Allowed values: `requested`, `initiated`, `completed`, `aborted`. #### Response Example ```json { "id": "28c78b6d-c2da-4f09-85f5-1ad588089b2d", "status": "completed" } ``` #### Error Responses - **400 Bad Request**: Indicates an issue with the request parameters. - **message** (string) - A message regarding the error. - **documentation_url** (string, Optional) - URL for documentation. - **errors** (Array, Optional) - Array of error objects. - **resource** (string) - Resource name. - **field** (string, Optional) - Specific field with error. - **type** (string, Optional) - Type of error. - **code** (string, Optional) - Machine code for the error. - **message** (string, Optional) - Human-readable error message. - **401 Authentication Error**: Indicates an issue with authentication credentials. - **message** (string) - A message regarding the error. - **documentation_url** (string, Optional) - URL for documentation. - **404 Not Found**: Indicates the requested resource was not found. - **message** (string) - A message regarding the error. - **documentation_url** (string, Optional) - URL for documentation. - **429 Too Many Requests**: Indicates the client has sent too many requests. - **503 Service Unavailable**: Indicates the service is temporarily unavailable. ``` -------------------------------- ### Add Domains and Redirects Request Body Example (JSON) Source: https://wpengineapi.com/reference/operations/createbulkdomains This example demonstrates the JSON structure for the request body when adding multiple domains and setting up redirects to an existing install. It includes both simple domain additions and domains that redirect to another specified domain. ```json { "domains": [ { "name": "example.com" }, { "name": "www.example.com", "redirect_to": "example.com" } ] } ``` -------------------------------- ### Not Found Error Response Example Source: https://wpengineapi.com/reference/operations/importthirdpartysslcertificate Example of a 'Not Found' error response, typically returned when the specified resource (e.g., install ID) does not exist. It includes a message and an optional documentation URL. ```json { "message": "Not Found", "documentation_url": null } ``` -------------------------------- ### GET /installs/{install_id}/offload_settings/files Source: https://wpengineapi.com/reference/operations/getoffloadsettings Retrieves the offload settings configuration for a specific website install, including details about file offloading to cloud storage. ```APIDOC ## GET /installs/{install_id}/offload_settings/files ### Description Returns the offload settings configuration for a specific install, including details on file offloading to cloud storage like S3. ### Method GET ### Endpoint `/installs/{install_id}/offload_settings/files` ### Parameters #### Path Parameters - **install_id** (string) - Required - ID of the install (uuid format) ### Request Example (No request body for this GET request) ### Response #### Success Response (200) - **largefs_settings** (object) - LargeFS offload settings configuration. - **cloud** (string) - Allowed values: `s3` - **bucket** (string) - The name of the S3 bucket. - **bucket_region** (string) - The region of the S3 bucket. - **path_settings** (Array) - An array of path configurations. - **path** (string) - The path to configure offload settings for. - **excluded_paths** (Array) - A list of paths to exclude from offloading. - **redirect_type** (string) - Allowed values: `break`, `permanent` #### Response Example (200 OK) ```json { "largefs_settings": { "cloud": "s3", "bucket": "my-s3-bucket", "bucket_region": "us-east-1", "path_settings": [ { "path": "/wp-content/uploads", "excluded_paths": [ "/wp-content/uploads/special-folder" ], "redirect_type": "permanent" } ] } } ``` #### Error Responses - **401** (object) - Authentication Error. - **message** (string) - Required - A message regarding the error that occurred on the server. - **documentation_url** (string) - Optional - A URL for documentation regarding this error. - **403** (object) - Not authorized. - **message** (string) - Required - A message regarding the error that occurred on the server. - **documentation_url** (string) - Optional - A URL for documentation regarding this error. - **404** (object) - Not found. - **message** (string) - Required - A message regarding the error that occurred on the server. - **documentation_url** (string) - Optional - A URL for documentation regarding this error. - **429** - Too many requests. - **503** - Service unavailable. #### Response Example (401 Unauthorized) ```json { "message": "Bad Credentials", "documentation_url": "https://docs.wpengine.com/api/errors/authentication" } ``` #### Response Example (403 Forbidden) ```json { "message": "You don't have permission to perform that action", "documentation_url": "https://docs.wpengine.com/api/errors/authorization" } ``` #### Response Example (404 Not Found) ```json { "message": "Not Found", "documentation_url": "https://docs.wpengine.com/api/errors/not-found" } ``` ``` -------------------------------- ### Add Domain Response Example (JSON) Source: https://wpengineapi.com/reference/operations/createdomain Example JSON response after successfully adding a domain to a WP Engine install. It includes details like the domain name, ID, network configuration, SSL status, and potential redirect information. ```json { "name": "torquemag.io", "duplicate": true, "primary": true, "id": "e41fa98f-ea80-4654-b229-a9b765d0863a", "network_type": "AN", "network_details": { "dns_config_info": { "cname": "wp.wpenginepowered.com", "a_records": [ "127.0.0.1" ] }, "network_info": { "status": "ACTIVE" } }, "ssl": { "status": "active" }, "redirects_to": [ { "id": "e41fa98f-ea80-4006-b229-a9b765d0863a", "name": "redirect.com" } ], "secure_all_urls": true } ``` -------------------------------- ### Get Specific Domain for Install (Example) Source: https://wpengineapi.com/reference/operations/getdomain This example demonstrates how to retrieve details for a specific domain within a WP Engine install using a GET request. It requires the install ID and domain ID as path parameters. The response includes domain name, network configuration, SSL status, and redirect information. ```http GET /installs/{install_id}/domains/{domain_id} ``` -------------------------------- ### Get SSL Certificate Information (cURL) Source: https://wpengineapi.com/reference/operations/getdomaincertificate This example demonstrates how to retrieve SSL certificate information for a domain using cURL. It requires the install ID and domain ID as path parameters. The output is a JSON object containing detailed certificate information. ```bash curl -X GET \ "https://api.wpengine.com/installs/{install_id}/domains/{domain_id}/ssl_certificate" \ -H "Authorization: Basic YOUR_API_KEY" ``` -------------------------------- ### Automate Workflows: Paginated Installs Source: https://wpengineapi.com/tutorial This section demonstrates how to automate workflows by iterating through all pages of installation data using the `next` link provided in the API response. This is useful for tasks like syncing data or triggering actions across all your sites. ```APIDOC ## GET /v1/installs (Paginated) ### Description This endpoint retrieves a list of installations and supports pagination. The response includes a `next` field which contains the URL for the subsequent page of results. This allows for iterating through all available installation data. ### Method GET ### Endpoint /v1/installs ### Query Parameters - **limit** (integer) - Optional - The number of results to return per page. Set to 100 for efficient pagination. ### Request Example (cURL) ```bash # Requires: WPE_API_USER_ID / WPE_API_PASSWORD env vars # Iterate through all pages using the 'next' link. Requires jq. NEXT="https://api.wpengineapi.com/v1/installs?limit=100" AUTH="${WPE_API_USER_ID}:${WPE_API_PASSWORD}" while [ -n "$NEXT" ] && [ "$NEXT" != "null" ]; do RESP=$(curl -u "$AUTH" "$NEXT") echo "$RESP" | jq -r '.results[]?.name' NEXT=$(echo "$RESP" | jq -r '.next') done ``` ### Request Example (Go) ```go package main import ( "encoding/json" "fmt" "io" "net/http" "os" ) type install struct { Name string `json:"name"` } type page struct { Results []install `json:"results"` Next *string `json:"next"` } func main() { user := os.Getenv("WPE_API_USER_ID") pass := os.Getenv("WPE_API_PASSWORD") next := "https://api.wpengineapi.com/v1/installs?limit=100" client := http.DefaultClient for next != "" && next != "null" { req, _ := http.NewRequest("GET", next, nil) req.SetBasicAuth(user, pass) resp, err := client.Do(req) if err != nil { panic(err) } body, _ := io.ReadAll(resp.Body) _ = resp.Body.Close() var p page if err := json.Unmarshal(body, &p); err != nil { panic(err) } for _, inst := range p.Results { fmt.Println(inst.Name) } if p.Next == nil { break } next = *p.Next } } ``` ### Response #### Success Response (200) - **results** (array) - A list of installation objects, each containing at least a `name` field. - **next** (string) - A URL for the next page of results, or null if this is the last page. #### Response Example (partial) ```json { "results": [ { "name": "example-install-1", "id": "123e4567-e89b-12d3-a456-426614174000" }, { "name": "example-install-2", "id": "123e4567-e89b-12d3-a456-426614174001" } ], "next": "https://api.wpengineapi.com/v1/installs?limit=100&cursor=some_cursor" } ``` ``` -------------------------------- ### GET /installs/{install_id}/domains/{domain_id} Source: https://wpengineapi.com/reference/operations/getdomain Retrieves specific domain details for a given install ID and domain ID. Requires basic authentication. ```APIDOC ## GET /installs/{install_id}/domains/{domain_id} ### Description Retrieves specific domain details for a given install ID and domain ID. ### Method GET ### Endpoint /installs/{install_id}/domains/{domain_id} ### Parameters #### Path Parameters - **install_id** (string) - Required - ID of the install (format: uuid) - **domain_id** (string) - Required - ID of the domain (format: uuid) #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **name** (string) - The domain name. - **duplicate** (boolean) - Indicates if the domain is a duplicate. - **primary** (boolean) - Indicates if the domain is the primary domain. - **id** (string) - The unique identifier for the domain (format: uuid). - **network_type** (string) - The WP Engine network type configured for the domain (possible values: 'AN', 'GES', 'LEGACY'). - **network_details** (object) - Details about the network configuration for the domain. - **dns_config_info** (object) - DNS configuration information for the domain. - **cname** (string) - The CNAME value for DNS configuration. - **a_records** (Array) - IP addresses for DNS A record configuration. - **network_info** (object) - Network information details. - **status** (string) - The status of the network configuration. - **ssl** (object) - SSL configuration status. - **status** (string) - The status of SSL. - **redirects_to** (Array) - A list of redirects configured for the domain. - **id** (string) - The redirect ID (format: uuid). - **name** (string) - The name of the redirect. - **secure_all_urls** (boolean) - Indicates if all URLs are secured. #### Response Example ```json { "name": "torquemag.io", "duplicate": true, "primary": true, "id": "e41fa98f-ea80-4654-b229-a9b765d0863a", "network_type": "AN", "network_details": { "dns_config_info": { "cname": "wp.wpenginepowered.com", "a_records": [ "127.0.0.1" ] }, "network_info": { "status": "ACTIVE" } }, "ssl": { "status": "active" }, "redirects_to": [ { "id": "e41fa98f-ea80-4006-b229-a9b765d0863a", "name": "redirect.com" } ], "secure_all_urls": true } ``` #### Error Responses - **401** - Authentication Error - **message** (string) - A message regarding the error that occurred on the server. - **documentation_url** (string, optional) - A URL for documentation. Example: ```json { "message": "Bad Credentials" } ``` - **403** - Not Authorized - **message** (string) - A message regarding the error that occurred on the server. - **documentation_url** (string, optional) - A URL for documentation. Example: ```json { "message": "You don't have permission to perform that action" } ``` - **404** - Not Found - **message** (string) - A message regarding the error that occurred on the server. - **documentation_url** (string, optional) - A URL for documentation. Example: ```json { "message": "Not Found" } ``` - **429** - Too Many Requests - **503** - Service Unavailable ``` -------------------------------- ### Fetch a Single Resource Source: https://wpengineapi.com/tutorial This endpoint allows you to retrieve a single install resource by its unique ID. A 404 response will be returned if the specified ID does not exist in your account. ```APIDOC ## GET /v1/installs/{install_id} ### Description Retrieves a specific install by its ID. ### Method GET ### Endpoint /v1/installs/{install_id} #### Path Parameters - **install_id** (string) - Required - The unique identifier of the install. ### Request Example ```bash # Replace 12345 with a real install ID curl -u "$WPE_API_USER_ID:$WPE_API_PASSWORD" \ "https://api.wpengineapi.com/v1/installs/12345" ``` ### Response #### Success Response (200) - **id** (number) - The unique identifier of the install. - **name** (string) - The name of the install. - **account_id** (number) - The ID of the account the install belongs to. - **created_at** (string) - The timestamp when the install was created (ISO 8601 format). - **domains** (array) - A list of domains associated with the install. - **hostname** (string) - The domain name. - **primary** (boolean) - Indicates if this is the primary domain. #### Response Example ```json { "id": 12345, "name": "marketing-site", "account_id": 67890, "created_at": "2024-01-01T12:00:00Z", "domains": [ { "hostname": "marketing.example.com", "primary": true } ] } ``` ``` -------------------------------- ### POST /installs - Create a new WordPress installation Source: https://wpengineapi.com/reference/operations/createinstall Creates a new WordPress installation. Requires authentication via basicAuth and includes details about the installation in the request body. ```APIDOC ## POST /installs ### Description Creates a new WordPress installation with specified details. ### Method POST ### Endpoint /installs ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **name** (string) - Required - The name of the install. - **account_id** (string) - Required - The ID of the account that the install will belong to (UUID format). - **site_id** (string) - Required for accounts with sites enabled - The ID of the site that the install will belong to (UUID format). - **environment** (string) - Required for accounts with sites enabled - The site environment that the install will fill. Allowed values: production, staging, development. ### Request Example ```json { "name": "torquemag", "account_id": "eeda3227-9a39-46ae-9e14-20958bb4e6c9", "site_id": "28c78b6d-c2da-4f09-85f5-1ad588089b2d", "environment": "staging" } ``` ### Response #### Success Response (201) - **id** (string) - The unique identifier for the install (UUID format). - **name** (string) - The name of the install. - **account** (object) - Information about the account. - **id** (string) - The account ID (UUID format). - **php_version** (string) - The PHP version used to run WordPress (read-only). - **status** (string) - The status of the install. Allowed values: active, pending. - **site** (object) - Information about the site. - **id** (string) - The site ID (UUID format). - **cname** (string) - The CNAME of the install. - **stable_ips** (Array) - A list of stable IPs bound to the install. - **environment** (string) - The site environment. Allowed values: production, staging, development. - **primary_domain** (string) - The primary domain for the install. - **is_multisite** (boolean) - Indicates if the install is multisite. - **created_at** (string) - The date and time the install was created in UTC (date-time format). - **wp_version** (string) - The WordPress version installed. - **defer_wordpress_upgrades_until** (string) - If set, automatic WordPress core major updates will be deferred until this date (date-time format). #### Response Example ```json { "id": "294deacc-d8b8-4005-82c4-0727ba8ddde0", "name": "torquemag", "account": { "id": "eeda3227-9a39-46ae-9e14-20958bb4e6c9", "php_version": "7.0", "status": "active", "site": { "id": "28c78b6d-c2da-4f09-85f5-1ad588089b2d", "cname": "mywebsite.wpengine.com" }, "stable_ips": [ "1.2.3.2", "1.1.1.2" ], "environment": "staging", "primary_domain": "mywebsite.wpengine.com", "is_multisite": false, "created_at": "2025-06-12T09:56:42.386Z", "wp_version": "6.8.1", "defer_wordpress_upgrades_until": "2025-12-31T23:59:59.999Z" } } ``` #### Error Responses - **400 Bad Request**: Invalid input data. - **message** (string) - A message regarding the error. - **documentation_url** (string) - Optional URL for documentation. - **errors** (Array) - Array of specific error objects. - **resource** (string) - The resource being processed. - **field** (string) - The specific field associated with the error. - **type** (string) - The type of error (e.g., `invalid_value`). - **code** (string) - A machine code relating to the error. - **message** (string) - A human-readable message relating to the error. - **401 Authentication Error**: Invalid credentials. - **message** (string) - A message regarding the error. - **documentation_url** (string) - Optional URL for documentation. - **403 Not authorized**: Insufficient permissions. - **message** (string) - A message regarding the error. - **documentation_url** (string) - Optional URL for documentation. #### Error Response Example (400) ```json { "message": "Invalid Site: Name cannot be empty.", "documentation_url": null, "errors": [ { "resource": "Site", "field": "name", "type": "invalid_value", "code": "too_long", "message": "Name is too long (maximum is 40 characters)" } ] } ``` ``` -------------------------------- ### Purge Install Cache Request Body Example (JSON) Source: https://wpengineapi.com/reference/operations/purgecache This snippet shows an example of the JSON request body required to purge a specific type of cache for a WP Engine install. It includes the 'type' field, which must be one of the allowed values: 'object', 'page', 'cdn', or 'all'. ```json { "type": "object" } ``` -------------------------------- ### Error Response Example: Rate Limiting (JSON) Source: https://wpengineapi.com/reference/operations/purgecache This JSON example illustrates an error response when the API rate limits are exceeded for purging object caches. It provides a 'message' explaining the limitation, indicating that only one request per 60 seconds is allowed per install. ```json { "message": "Object cache purges are rate-limited to one request every 60 seconds for each install." } ``` -------------------------------- ### Successful WordPress Installation Creation Response (201) Source: https://wpengineapi.com/reference/operations/createinstall Illustrates the expected JSON response upon successful creation of a WordPress installation. It includes details such as the installation ID, name, account information, PHP version, status, site details, and creation timestamp. ```json { "id": "294deacc-d8b8-4005-82c4-0727ba8ddde0", "name": "torquemag", "account": { "id": "eeda3227-9a39-46ae-9e14-20958bb4e6c9", "php_version": "7.0" }, "status": "active", "site": { "id": "28c78b6d-c2da-4f09-85f5-1ad588089b2d", "cname": "mywebsite.wpengine.com", "stable_ips": [ "1.2.3.2", "1.1.1.2" ], "environment": "staging", "primary_domain": "mywebsite.wpengine.com", "is_multisite": false }, "created_at": "2025-06-12T09:56:42.386Z", "wp_version": "6.8.1", "defer_wordpress_upgrades_until": "2025-12-31T23:59:59.999Z" } ```