# Get started (https://docs.developer.commerce.ote-godaddy.com/en/docs/api-users/hosting/getting-started)

***

title: Get started
description: Deploy your first Node.js app end to end — obtain an access token, create an app, upload code, publish, and verify.
agentNotes:
scopes:

* hosting.paas.apps:create
* hosting.paas.apps:read
* hosting.paas.code:write
* hosting.paas.deploy:execute
  rateLimit: 10–120 req/min per client IP depending on operation
  failureRecovery: Every write in this walkthrough is async. Poll the status endpoint for each step until it reaches a terminal state.
  related:
  concepts:
* title: Node.js Hosting concepts
  href: /docs/api-users/concepts/nodejs-hosting-concepts
  guides:
* title: Authentication
  href: /docs/api-users/hosting/authentication
  apis:
* title: Node.js Hosting API reference
  href: /docs/references/rest/nodejs-hosting

***

This walkthrough deploys a Node.js app from scratch using nothing but `curl`. Every write operation is async. You get back a job or deployment id and poll until it is ready.

Every code block uses `$BASE_URL` for the API gateway host and `$TOKEN` for your Personal Access Token (PAT). See [Authentication](https://docs.developer.commerce.ote-godaddy.com/docs/api-users/hosting/authentication) for how to create one; the base URL is provided by the GoDaddy API gateway when you request access.

## Prerequisites

* A [Personal Access Token](https://docs.developer.commerce.ote-godaddy.com/personal-access-token) with the following scopes: `hosting.paas.apps:create`, `hosting.paas.apps:read`, `hosting.paas.code:write`, `hosting.paas.deploy:execute`.
* A zipped Node.js application. The zip's root should contain your `package.json` and application entry point.
* `curl` and `jq` (or your language's HTTP client — the flow is the same shape everywhere).

## 1. Get a token

Create a Personal Access Token (PAT) at [Personal Access Tokens](https://docs.developer.commerce.ote-godaddy.com/personal-access-token) with the scopes listed in [Prerequisites](#prerequisites), then set it as an environment variable:

```bash
export TOKEN="gd_pat_your_token_here"
```

See [Authentication](https://docs.developer.commerce.ote-godaddy.com/docs/api-users/hosting/authentication) for the full PAT creation steps.

## 2. Create an app

`POST /apps` accepts a name and returns `202` with a job id. The app isn't ready to receive code until the job reaches `active`.

```bash
JOB=$(curl -s -X POST "$BASE_URL/v1/hosting/nodejs/apps" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "name": "my-first-app" }')

JOB_ID=$(echo "$JOB" | jq -r .job.id)
echo "Job accepted: $JOB_ID"
```

Poll `GET /apps/jobs/{jobId}` until `job.status` is `active`. When it flips, the response also includes the fully-formed `app` object.

```bash
until STATUS=$(curl -s "$BASE_URL/v1/hosting/nodejs/apps/jobs/$JOB_ID" \
    -H "Authorization: Bearer $TOKEN" | jq -r .job.status) && [ "$STATUS" = "active" ]; do
  echo "  ...still $STATUS"
  sleep 3
done

APP_ID=$(curl -s "$BASE_URL/v1/hosting/nodejs/apps/jobs/$JOB_ID" \
  -H "Authorization: Bearer $TOKEN" | jq -r .app.id)
echo "App ready: $APP_ID"
```

Terminal states are `active` (success) and `failed` (fatal — start over with a corrected request).

## 3. Upload your source

Package the app as a zip, then `POST /apps/{appId}/source` as `multipart/form-data`. This lands on the **preview** variant.

```bash
UPLOAD=$(curl -s -X POST "$BASE_URL/v1/hosting/nodejs/apps/$APP_ID/source" \
  -H "Authorization: Bearer $TOKEN" \
  -F "zipFile=@./my-app.zip")

UPLOAD_JOB=$(echo "$UPLOAD" | jq -r .jobId)
```

Poll the upload job at `GET /apps/{appId}/source/status?jobId=...` until it terminates.

```bash
until echo "$RESP" | jq -e '.status | test("succeeded|failed")' >/dev/null 2>&1; do
  RESP=$(curl -s "$BASE_URL/v1/hosting/nodejs/apps/$APP_ID/source/status?jobId=$UPLOAD_JOB" \
    -H "Authorization: Bearer $TOKEN")
  echo "  upload: $(echo "$RESP" | jq -r .status)"
  sleep 2
done
```

## 4. Publish

Publishing takes the current preview source and promotes it to the publish variant. `POST /apps/{appId}/deployments` returns a deployment record. Poll the deployments list and app status to observe rollout.

```bash
curl -s -X POST "$BASE_URL/v1/hosting/nodejs/apps/$APP_ID/deployments" \
  -H "Authorization: Bearer $TOKEN"
```

Watch runtime status flip to running on the publish variant:

```bash
until curl -s "$BASE_URL/v1/hosting/nodejs/apps/$APP_ID/status" \
    -H "Authorization: Bearer $TOKEN" \
  | jq -e '.variants[] | select(.variant == "publish") | .status == "running"' >/dev/null; do
  echo "  ...deploying"
  sleep 5
done

echo "Live."
```
