---
title: "Upload source code and immediately start a preset-based deployment."
method: POST
path: "/projects/{project_id}/environments/{environment_id}/deploy/source"
tags: ["Deployments"]
---

# Upload source code and immediately start a preset-based deployment.

`POST /projects/{project_id}/environments/{environment_id}/deploy/source`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/projects/{project_id}/environments/{environment_id}/deploy/source`
- Auth: HTTP bearer

## Path parameters

- `project_id` integer, required
- `environment_id` integer, required

## Request body `multipart/form-data`

- SourceArchiveUpload
  - `file` string, binary, required

## Response `202`

Source deployment started

- RemoteDeploymentResponse
  - `created_at` string, date-time, required
  - `environment_id` integer, required
  - `id` integer, required
  - `project_id` integer, required
  - `slug` string, required
  - `source_type` string, required
  - `state` string, required

## Other responses

- `400`: Invalid source archive
- `404`: Project or environment not found
- `409`: Deployment method unavailable in stateless mode

## Changes

- **2026-10-05** `4b228ebed583`: 1 info
  - added the non-success response with the status `409`
- **2026-10-05** `63a80791dc58`: 1 info
  - removed the non-success response with the status `409`
- **2026-09-22** `1dd3766c34ed`: 1 info
  - added the non-success response with the status `409`
- **2026-08-06** `fe64cc48eb6f`: 1 info
  - endpoint added
- **2026-08-06** `949964f26dd7`: 1 breaking
  - api path removed without deprecation

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/projects/:project_id/environments/:environment_id/deploy/source/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
