How to create and publish a WordPress site

View as Markdown

Create 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, and hosting.deployment:execute scopes
  • (API only) a UUID saved as IDEMPOTENCY_KEY (for example from uuidgen)
  • (API only) jq for 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.

  1. Create the site:

    gddy hosting app create --app-type MHWP --name my-site
  2. Poll every 2–5 seconds until status is COMPLETED or FAILED:

    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.

  1. Publish the site:

    gddy hosting app publish --app-id $APP_ID
  2. Poll every 2–5 seconds until status is COMPLETED or FAILED:

    gddy hosting operation get --operation-id $OPERATION_ID

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:

StatusIssue codeCauseWhat to do
400VALIDATION_FAILEDThe 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 UUIDRead 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 403Check the scope for the call. A missing scope can return 401 or 403, so handle both. Create a new PAT if needed
401OAUTH_REQUIRED, INVALID_TOKENNo bearer token, or the token is invalidSend Authorization: Bearer $GODADDY_PAT with a current PAT
403INSUFFICIENT_SCOPE, ACCESS_DENIEDThe 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 emptyAdd the scope: create a new PAT with it, or sign in to gddy again and approve it. Or use an account with API access
403WORDPRESS_NOT_ENABLEDWordPress sites aren't turned on for the accountContact GoDaddy support. Don't retry
403SUBSCRIPTION_INACTIVEThe Airo App Builder subscription isn't activeReactivate the subscription, then retry
409CREATE_IN_PROGRESSAnother create on the account is still runningWait a few seconds and retry
409IDEMPOTENCY_IN_PROGRESSThe first request with the same Idempotency-Key is still runningWait, then retry with the same key to get its operation
409MULTIPLE_SYSTEMS_AMBIGUOUSThe account has more than one system, so the target is ambiguousContact GoDaddy support
409PUBLISH_STATE_CHANGE_IN_PROGRESSAn unpublish of the site is running, or another publish-state request on the subscription is being acceptedIf an unpublish is running, poll its operation, then retry the PUT. Otherwise retry after a few seconds
422SUBSCRIPTION_REQUIREDThe account has no Airo App Builder subscriptionBuy an Airo App Builder plan, then retry
422APP_LIMIT_EXCEEDEDThe subscription has no free app slotDelete a site you no longer need, then retry
422SYSTEM_INCONSISTENTThe account isn't ready to add an appContact GoDaddy support
422IDEMPOTENCY_KEY_MISMATCHYou reused an Idempotency-Key with a different nameSend a new UUID for a different request
422PUBLISH_LIMIT_EXCEEDEDThe plan allows no more published sites. The free plan allows noneUnpublish another site or upgrade the plan
422APP_DELETINGThe site is being deletedStop sending writes for this site
429(empty body)The rate limit for POST /v1/hosting/apps or PUT .../publish-state is reachedWait the number of seconds in Retry-After if it's present, otherwise in RateLimit-Reset, then retry. Go to Troubleshoot Hosting for the limits
503UPSTREAM_UNAVAILABLEAnother write holds the site's lock, or the plan limit couldn't be readRetry after Retry-After seconds, or with backoff when the header is absent
Operation FAILEDCAPACITY_UNAVAILABLE, APP_CREATION_FAILEDThe create didn't finish, and no site existsRetry the create later with a new Idempotency-Key
Operation FAILEDPUBLISH_LIMIT_EXCEEDED, PUBLISH_STATE_CHANGE_FAILEDThe publish didn't finish, and the site stays unpublishedFree 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

Scopeshosting.application:create, hosting.application:read, hosting.deployment:execute
Rate limitPOST /apps?appType=MHWP and PUT /apps/{appId}/publish-state: 10 req/min and 100 req/hour per customer. Other WordPress site routes, including operation polling: 600 req/min per customer. A 429 can have an empty body and RateLimit-Limit, RateLimit-Remaining, and RateLimit-Reset headers. Wait the number of seconds in Retry-After if present, otherwise in RateLimit-Reset, before retrying.
IdempotentYes
DestructiveNo
On failureSend the same Idempotency-Key UUID when you retry POST /apps, so a retry after a timeout returns the original operation instead of creating a second site. A FAILED create operation created no site: retry with a new key. PUT publish-state is idempotent by nature and safe to retry. Poll GET /app-operations/{operationId} every 2–5 seconds until COMPLETED or FAILED. On 503 with Retry-After, wait that many seconds and retry.

Last updated on

How is this guide?

On this page