How to create and publish a WordPress site
View as MarkdownCreate a WordPress site with an idempotency key, poll until it's ready, read its address, and take it live by setting its publish state.
Overview
This walkthrough creates a WordPress site (appType=MHWP) with the Hosting API v1 and takes it live. You create the site, wait for the create to finish, read the site's address, then publish the site and wait for that to finish. WordPress sites have no source upload, hosting plan attachment or deployment step.
You can follow the steps with the gddy CLI or with the Hosting REST API. The CLI is the recommended path. It signs you in through your browser and asks you to approve each scope the first time a command needs it. The API path uses a Personal Access Token and shows curl, Node, Python, and Go examples. Those examples use $BASE_URL for the API host (https://api.godaddy.com) and $GODADDY_PAT for the token.
Creating a site and publishing it are async. Each returns an AppOperation that you poll until its status is COMPLETED or FAILED. Poll every 2–5 seconds. Most creates finish in under a minute, and operations time out after 30 minutes.
A new site starts unpublished, behind a holding page. The API returns no WordPress admin credentials. Sign in to WordPress admin from Airo, where you set the site title and add content.
Prerequisites
The following prerequisites are required before you can create and publish a WordPress site:
- an active Airo App Builder subscription with a free app slot
- an account that meets the WordPress site requirements
- an Airo App Builder plan that allows published sites, for the publish step
- (CLI only) the GoDaddy CLI installed and signed in
- (API only) a Personal Access Token with the
hosting.application:create,hosting.application:read, andhosting.deployment:executescopes - (API only) a UUID saved as
IDEMPOTENCY_KEY(for example fromuuidgen) - (API only)
jqfor the curl examples
How do you want to create the site?
Create and publish the site with the CLI
The following procedure creates a WordPress site, waits until it's ready, and takes it live.
Create the site with the CLI
gddy hosting app create returns an operationId, which is $OPERATION_ID in the poll command. After the operation reaches COMPLETED, its app.id field is the site id, which is $APP_ID in every later command.
The following procedure creates the site and polls the operation until it finishes.
-
Create the site:
gddy hosting app create --app-type MHWP --name my-site -
Poll every 2–5 seconds until
statusisCOMPLETEDorFAILED:gddy hosting operation get --operation-id $OPERATION_ID
Read the site with the CLI
gddy hosting app get returns the full site record. urls.publish is the address the site goes live at. It can be null, so check it before you use it.
The following procedure reads the site's name, status, and address.
-
Read the site:
gddy hosting app get --app-id $APP_ID
Publish the site with the CLI
gddy hosting app publish takes the site live at urls.publish and returns an operationId, which is $OPERATION_ID in the poll command. A publish for a site that's already live returns an operation that's already COMPLETED.
The following procedure publishes the site and polls the operation until it finishes.
-
Publish the site:
gddy hosting app publish --app-id $APP_ID -
Poll every 2–5 seconds until
statusisCOMPLETEDorFAILED:gddy hosting operation get --operation-id $OPERATION_ID
Create and publish the site with the API
POST /v1/hosting/apps and PUT /v1/hosting/apps/{appId}/publish-state each return 202 Accepted with an AppOperation, which you poll with GET /v1/hosting/app-operations/{operationId}. Send an Idempotency-Key on the create, so a retry after a timeout returns the same operation instead of a second site.
The following procedure creates a WordPress site, waits until it's ready, and takes it live.
Create the site with the API
POST /v1/hosting/apps?appType=MHWP accepts a body with only name and returns 202 Accepted with an AppOperation of type CREATE_APP. Save its operationId as OPERATION_ID.
Keep the same IDEMPOTENCY_KEY for every retry of this request. A retry with the same key and body returns the original operation, for up to 24 hours after that operation ends.
The following procedure creates the site.
-
Create the site:
curl -s -X POST "$BASE_URL/v1/hosting/apps?appType=MHWP" \ -H "Authorization: Bearer $GODADDY_PAT" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $IDEMPOTENCY_KEY" \ -d '{ "name": "my-site" }' | jq '{operationId, type, status}'
Poll the create operation with the API
GET /v1/hosting/app-operations/{operationId} returns the operation's status: PENDING, IN_PROGRESS, COMPLETED, or FAILED. On COMPLETED, app.id is the site id. Save it as APP_ID.
The following procedure waits until the site is ready.
-
Poll the operation every 2–5 seconds until
statusisCOMPLETEDorFAILED:curl -s "$BASE_URL/v1/hosting/app-operations/$OPERATION_ID" \ -H "Authorization: Bearer $GODADDY_PAT" | jq '{status, appId: .app.id, error}'
Read the site with the API
GET /v1/hosting/apps/{appId} returns the full site record. urls.publish is the address the site goes live at. It can be null, so check it before you use it.
The following procedure reads the site's name, status, and address.
-
Read the site:
curl -s "$BASE_URL/v1/hosting/apps/$APP_ID" \ -H "Authorization: Bearer $GODADDY_PAT" | jq '{id, name, status, publishUrl: .urls.publish}'
Publish the site with the API
PUT /v1/hosting/apps/{appId}/publish-state with exactly {"published": true} takes the site live at urls.publish. It returns 202 Accepted with an AppOperation of type SET_PUBLISH_STATE. Save its operationId as OPERATION_ID.
The request takes no Idempotency-Key, because it's idempotent by nature. A request for the state the site already has returns an operation that's already COMPLETED. While a publish is still running, a repeat request returns that running operation.
The following procedure publishes the site.
-
Set the publish state to
true:curl -s -X PUT "$BASE_URL/v1/hosting/apps/$APP_ID/publish-state" \ -H "Authorization: Bearer $GODADDY_PAT" \ -H "Content-Type: application/json" \ -d '{ "published": true }' | jq '{operationId, type, status}'
Poll the publish operation with the API
GET /v1/hosting/app-operations/{operationId} returns the publish operation's status. A publish-state operation carries no app. After COMPLETED, the site is live at urls.publish.
The following procedure waits until the site is live.
-
Poll the operation every 2–5 seconds until
statusisCOMPLETEDorFAILED:curl -s "$BASE_URL/v1/hosting/app-operations/$OPERATION_ID" \ -H "Authorization: Bearer $GODADDY_PAT" | jq '{type, status, error}'
Go to How to manage WordPress sites for reading the publish state, unpublishing, renaming, and deleting the site.
Example responses
Create response
POST /v1/hosting/apps?appType=MHWP returns the new operation. The same URL is in the Location header:
{
"operationId": "MHWP-p9x8y7z6",
"type": "CREATE_APP",
"status": "PENDING",
"links": [
{ "rel": "self", "href": "/v1/hosting/app-operations/MHWP-p9x8y7z6" },
{ "rel": "poll", "href": "/v1/hosting/app-operations/MHWP-p9x8y7z6" }
]
}Create operation result
A COMPLETED create embeds app. Use app.id for every later call:
{
"operationId": "MHWP-p9x8y7z6",
"type": "CREATE_APP",
"status": "COMPLETED",
"app": {
"id": "MHWP-a1b2c3d4e5",
"status": "ACTIVE",
"createdAt": "2026-11-09T14:02:11Z",
"links": [
{ "rel": "self", "href": "/v1/hosting/apps/MHWP-a1b2c3d4e5" }
]
},
"links": [
{ "rel": "self", "href": "/v1/hosting/app-operations/MHWP-p9x8y7z6" }
]
}A FAILED create returns HTTP 200 with an error object. No site exists:
{
"operationId": "MHWP-p9x8y7z6",
"type": "CREATE_APP",
"status": "FAILED",
"error": {
"name": "AppCreationFailed",
"correlationId": "3f2b9c1e-7a4d-4c8e-9b21-5d6e0f1a2b3c",
"message": "No capacity is available to create the app. Retry later.",
"details": [{ "issue": "CAPACITY_UNAVAILABLE" }]
},
"links": [
{ "rel": "self", "href": "/v1/hosting/app-operations/MHWP-p9x8y7z6" }
]
}Site record
GET /v1/hosting/apps/{appId} returns the site record. WordPress sites have no urls.preview:
{
"id": "MHWP-a1b2c3d4e5",
"name": "my-site",
"appType": "MHWP",
"status": "ACTIVE",
"urls": {
"publish": "https://my-site.myftpupload.com"
},
"createdAt": "2026-11-09T14:02:11Z",
"updatedAt": "2026-11-09T14:02:52Z",
"links": [
{ "rel": "self", "href": "/v1/hosting/apps/MHWP-a1b2c3d4e5" }
]
}Publish response
PUT /v1/hosting/apps/{appId}/publish-state returns a SET_PUBLISH_STATE operation with no app:
{
"operationId": "MHWP-q4r5s6t7",
"type": "SET_PUBLISH_STATE",
"status": "PENDING",
"createdAt": "2026-11-09T14:05:30Z",
"links": [
{ "rel": "self", "href": "/v1/hosting/app-operations/MHWP-q4r5s6t7" },
{ "rel": "poll", "href": "/v1/hosting/app-operations/MHWP-q4r5s6t7" }
]
}Common errors
WordPress site errors use the envelope {name, correlationId, message, details}. Branch on details[].issue, not on name or message. The following table lists the errors this workflow can return:
| Status | Issue code | Cause | What to do |
|---|---|---|---|
400 | VALIDATION_FAILED | The name is empty, is longer than 200 characters, or has characters the API refuses; the body has another field; or Idempotency-Key isn't a UUID | Read details[].field, fix the value, and retry |
401 | (empty body) | The PAT is expired or revoked, or it doesn't have the scope the call needs. A PAT without the scope can get an empty 401 instead of 403 | Check the scope for the call. A missing scope can return 401 or 403, so handle both. Create a new PAT if needed |
401 | OAUTH_REQUIRED, INVALID_TOKEN | No bearer token, or the token is invalid | Send Authorization: Bearer $GODADDY_PAT with a current PAT |
403 | INSUFFICIENT_SCOPE, ACCESS_DENIED | The token doesn't have the scope the call needs, or the account can't use the API. For a missing scope the body can be empty | Add the scope: create a new PAT with it, or sign in to gddy again and approve it. Or use an account with API access |
403 | WORDPRESS_NOT_ENABLED | WordPress sites aren't turned on for the account | Contact GoDaddy support. Don't retry |
403 | SUBSCRIPTION_INACTIVE | The Airo App Builder subscription isn't active | Reactivate the subscription, then retry |
409 | CREATE_IN_PROGRESS | Another create on the account is still running | Wait a few seconds and retry |
409 | IDEMPOTENCY_IN_PROGRESS | The first request with the same Idempotency-Key is still running | Wait, then retry with the same key to get its operation |
409 | MULTIPLE_SYSTEMS_AMBIGUOUS | The account has more than one system, so the target is ambiguous | Contact GoDaddy support |
409 | PUBLISH_STATE_CHANGE_IN_PROGRESS | An unpublish of the site is running, or another publish-state request on the subscription is being accepted | If an unpublish is running, poll its operation, then retry the PUT. Otherwise retry after a few seconds |
422 | SUBSCRIPTION_REQUIRED | The account has no Airo App Builder subscription | Buy an Airo App Builder plan, then retry |
422 | APP_LIMIT_EXCEEDED | The subscription has no free app slot | Delete a site you no longer need, then retry |
422 | SYSTEM_INCONSISTENT | The account isn't ready to add an app | Contact GoDaddy support |
422 | IDEMPOTENCY_KEY_MISMATCH | You reused an Idempotency-Key with a different name | Send a new UUID for a different request |
422 | PUBLISH_LIMIT_EXCEEDED | The plan allows no more published sites. The free plan allows none | Unpublish another site or upgrade the plan |
422 | APP_DELETING | The site is being deleted | Stop sending writes for this site |
429 | (empty body) | The rate limit for POST /v1/hosting/apps or PUT .../publish-state is reached | Wait the number of seconds in Retry-After if it's present, otherwise in RateLimit-Reset, then retry. Go to Troubleshoot Hosting for the limits |
503 | UPSTREAM_UNAVAILABLE | Another write holds the site's lock, or the plan limit couldn't be read | Retry after Retry-After seconds, or with backoff when the header is absent |
Operation FAILED | CAPACITY_UNAVAILABLE, APP_CREATION_FAILED | The create didn't finish, and no site exists | Retry the create later with a new Idempotency-Key |
Operation FAILED | PUBLISH_LIMIT_EXCEEDED, PUBLISH_STATE_CHANGE_FAILED | The publish didn't finish, and the site stays unpublished | Free a published-site slot for the limit error, then retry the PUT |
Go to Troubleshoot Hosting for every error a WordPress site request can return.
Agent & Automation Notes
hosting.application:create, hosting.application:read, hosting.deployment:executeRelated
Last updated on
How is this guide?