# Quickstart

> Create a token, create a site, upload content, and deploy through the current API contract.

Canonical: https://staticx.site/documentation/quickstart

Fast path

## Create a site visually, then automate the next release.

 The simplest path is to create the first site in the dashboard, confirm it works, then create the smallest token that fits the next release job.

 

  Dashboard quickstart

## Use the interface first.

 

1. **Open Sites.** Click New site.
2. **Choose a source.** Upload a ZIP, import a public URL, or start with an empty workspace.
3. **Open the project.** Use Pages for rendered pages, Files for workspace contents, and Settings for domains, agent deployment, and deletion.
4. **Create a token.** Use Settings for a global token, the project Agent deploy tab for a one-site token, or the workspace page for a multi-site token.
5. **Choose deployment history.** Leave history on for rollback-ready releases, or turn it off in Settings when you want one baseline release for analytics and forms.
6. **Automate future releases.** Give the API instruction or MCP config to your agent or CI job.
 
 ZIP archives should contain the built site files directly at the archive root, including `index.html` or `index.htm` and `404.html`. In most frontend frameworks that means zipping the contents of `dist`, `build`, or `public`, not the folder itself.

 

 Custom domains use one DNS record. Open **Domain settings** or run `staticx domain --site-id SITE_ID --domain app.example.com`, create the shown CNAME, then StaticX checks DNS and activates SSL automatically.

 

 If your account has an active publishing domain, the site **Domain settings** page shows a suffix selector beside the free subdomain field. Use it to save a generated address like `launch.example.com` instead of `launch.staticx.store`. Existing sites only move when you save that site.

 

 Recommended defaults: a **Site** token with **Full access** for one-site release jobs, a **Workspace** token with **Full access** for multi-site tools, and a **Global** token with **Read only** for dashboards that only inspect state.

 

  CLI quickstart

## Log in once, then run the same workflow from your terminal.

 StaticX uses the same token-protected `/api/v1` contract for the dashboard, agents, MCP tools, and the public npm CLI. Choose the smallest token scope that matches the job.

 

 ```
npm install -g staticx

staticx login --base-url "https://staticx.site/api/v1" --token "STATICX_API_TOKEN"
staticx guide
staticx whoami

# Global token
staticx workspaces
staticx create --workspace-id WORKSPACE_ID --name "Marketing Site"

# Site token
staticx deploy --site-id SITE_ID --dir dist
staticx logs --site-id SITE_ID

# Workspace token
staticx sites --workspace-id WORKSPACE_ID
staticx create --workspace-id WORKSPACE_ID --name "Client Site"
```

 Create a **Global** token from **Settings → API tokens**, a **Site** token from **Project Settings → Agent deploy**, and a **Workspace** token from **Workspace → Agent deploy**. Each screen now includes a ready-made CLI block.

 

 Scope still matters after login: a Global token can list workspaces broadly, a Workspace token should stay inside one workspace, and a Site token should be used for one-site deploys and logs.

 

  API quickstart

## Deploy a local build with curl.

 

 ```
export STATICX_API_TOKEN="paste-token-here"
export STATICX_API_BASE_URL="https://staticx.site/api/v1"

# 1. Create a site
curl -X POST "$STATICX_API_BASE_URL/projects" \
  -H "Authorization: Bearer $STATICX_API_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"name":"Marketing Site"}'

# 2. Confirm index.html or index.htm and 404.html are at the output root
test -f dist/index.html -o -f dist/index.htm
test -f dist/404.html

# 3. Zip the build output so those files are at the ZIP root
cd dist
zip -qr ../site.zip .
cd ..

# 4. Upload the ZIP
curl -X POST "$STATICX_API_BASE_URL/projects/{project}/files" \
  -H "Authorization: Bearer $STATICX_API_TOKEN" \
  -H "Accept: application/json" \
  -F "mode=zip" \
  -F "overwrite_confirmed=1" \
  -F "archive=@site.zip"

# 5. Poll until state is completed before publishing
curl -X GET "$STATICX_API_BASE_URL/projects/{project}/imports/status" \
  -H "Authorization: Bearer $STATICX_API_TOKEN" \
  -H "Accept: application/json"

# 6. Deploy
curl -X POST "$STATICX_API_BASE_URL/projects/{project}/deployments" \
  -H "Authorization: Bearer $STATICX_API_TOKEN" \
  -H "Accept: application/json"

# Optional: keep one baseline release instead of growing rollback history
curl -X POST "$STATICX_API_BASE_URL/projects/{project}/deployments" \
  -H "Authorization: Bearer $STATICX_API_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"versioning_enabled":false}'
```

  Verify

## Read state and logs after deploy.

 

 ```
curl "$STATICX_API_BASE_URL/projects/{project}" \
  -H "Authorization: Bearer $STATICX_API_TOKEN" \
  -H "Accept: application/json"

curl "$STATICX_API_BASE_URL/projects/{project}/deployments" \
  -H "Authorization: Bearer $STATICX_API_TOKEN" \
  -H "Accept: application/json"

curl "$STATICX_API_BASE_URL/projects/{project}/logs" \
  -H "Authorization: Bearer $STATICX_API_TOKEN" \
  -H "Accept: application/json"
```

 If an upload or deployment fails, use the API error message and project logs. Do not assume a release succeeded unless the API returns a successful response. If StaticX returns `PLAN_QUOTA_EXCEEDED`, the current plan limit was reached. Free includes 1 site, 500 MB storage, 500 MB uploads, and 1,000 form entries. Upgrade or clean up before retrying.

[View on staticx.site](https://staticx.site/documentation/quickstart)
