---
title: "Upload a ZIP (max 100 MB) to the project repository and deploy it"
method: POST
path: "/projects/{projectId}/upload"
tags: ["Projects"]
---

# Upload a ZIP (max 100 MB) to the project repository and deploy it

`POST /projects/{projectId}/upload`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/projects/{projectId}/upload`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Path parameters

- `projectId` string, uuid, required

## Query parameters

- `message` string
- `deploy` 'true' | 'false'

## Response `201`

Committed (and deploying)

- object
  - `deployment` object, nullable, required
    - `id` string, uuid, required
    - `projectId` string, uuid, required
    - `state` 'queued' | 'building' | 'deploying' | 'ready' | 'error' | 'canceled', required
    - `target` 'production' | 'preview', required
    - `isCurrent` boolean, required: this deployment serves production traffic now
    - `trigger` 'create' | 'redeploy' | 'git_push' | 'api' | 'cli' | 'upload' | 'rollback' | 'config_change' | 'builder' | 'promote' | 'deploy_hook', required
    - `commit` object, nullable, required
      - `sha` string, required
      - `message` string, nullable, required
      - `author` string, nullable, required
      - `branch` string, nullable, required
    - `url` string, nullable, required
    - `creator` object, nullable, required
      - `id` string, uuid, required
      - `name` string, required
    - `createdAt` string, required: ISO-8601 timestamp
    - `startedAt` string, nullable, required: ISO-8601 timestamp
    - `readyAt` string, nullable, required: ISO-8601 timestamp
    - `durationMs` integer, nullable, required
    - `errorMessage` string, nullable, required
    - `retryOf` string, uuid, nullable: set on a deployment the platform started by itself because the hosting engine ran the build of this deployment twice and removed its own build container: the deployment it starts again (same request: target, branch, trigger and options)
    - `retriedAs` string, uuid, nullable: set on a deployment that ended in error because the hosting engine ran its build twice (nothing in the code failed) and that the platform started again automatically: the new deployment. Its outcome is the outcome of this request, so a client waiting for this deployment follows that one. Never set on a retry (a request is started again at most once)
  - `commitSha` string, required
  - `files` integer, required
  - `bytes` integer, required
  - `ignored` integer, required: ignored files: dependencies, VCS data and build caches
  - `strippedEnvFiles` string[], required: .env files removed from the upload; set values as environment variables instead

## Other responses

- `400`: Invalid request (code invalid_request)
- `401`: Missing or invalid session/token (code unauthorized)
- `403`: Authenticated but not permitted (code forbidden)
- `404`: Not found or not visible to the caller (code not_found)
- `409`: Conflicting state (code conflict)
- `413`: Archive too large
- `429`: Too many requests (code rate_limited); see Retry-After
- `501`: Uploads are not configured
- `503`: Hosting engine unavailable (code provider_unavailable)

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
