Support

How to attach an app to a hosting plan

View as Markdown

Attach your app to a web hosting subscription to enable publishing.

Overview

Subscription attachment is required before going live for Node.js apps.

Before you can publish a Node.js app to production, you must attach it to a web hosting subscription. This operation is synchronous and returns immediately on success.

Subscriptions are purchased separately in your GoDaddy account. After attachment, the app is bound to that subscription's infrastructure and billing. This article describes how to attach a hosting plan to your web app.

Go to Deploy your Node.js app for the full deployment walkthrough (which includes this procedure).

Prerequisites

The following prerequisites are required before you can attach a hosting plan to your app:

  • a Personal Access Token with the hosting.subscription:write scope
  • a hosting app already created

    Go to Deploy your Node.js app for instructions to create a hosting app.

  • a web hosting subscription ID from your GoDaddy account

Attach an app to a subscription

PUT /apps/{appId}/subscription attaches a created app to a hosting plan. The subscription must belong to your account and have available capacity. Success returns 200 OK with the subscription attachment details. After you complete this procedure, you can publish your app.

  • Attach the app:

    curl -s -X PUT "$BASE_URL/v1/hosting/apps/$APP_ID/subscription" \
      -H "Authorization: Bearer $GODADDY_PAT" \
      -H "Content-Type: application/json" \
      -d '{ "subscriptionId": "'$SUBSCRIPTION_ID'" }'

Common errors

The following table lists common errors when attaching:

StatusCauseAction
400Invalid app ID or subscription IDVerify both IDs are correct and belong to your account
401Expired or revoked PAT, or missing scopeGo to Hosting core concepts for the scopes you need
404App or subscription not foundConfirm the app exists and the subscription ID is on your account
409No capacity available on the subscriptionThe subscription has no available capacity. Verify the subscription supports additional apps or contact GoDaddy support

Agent & Automation Notes

Scopeshosting.subscription:write
Rate limit60 req/min per credential
IdempotentYes
DestructiveNo
On failureAttachment is synchronous. Verify the subscription ID exists on your account and the app is already created.

Last updated on

How is this guide?

On this page