---
title: "Upload source code"
method: POST
path: "/v2/projects/{project_id}/sources"
tags: ["Deployments"]
---

# Upload source code

`POST /v2/projects/{project_id}/sources`

## Request

- Base URL: `https://api.liara.ir`
- URL: `https://api.liara.ir/v2/projects/{project_id}/sources`
- Auth: HTTP bearer

Uploads your source code as a single `.tar.gz` or `.zip` archive, to deploy with `POST /v2/projects/{project_id}/releases`. The request must include a `Content-Length` header. The maximum size depends on your bundle plan. Team permission: `deploy`, `operate` or `manage`.

## Path parameters

- `project_id` string, required

## Query parameters

- `teamID` string: 24-character hexadecimal ID.

## Request body `multipart/form-data`

- object
  - `file` string, binary, required: The archive (`application/gzip` or `application/zip`).

## Response `200`

The source was uploaded.

- object
  - `sourceID` string: Pass it as `sourceID` when creating a release.

## Other responses

- `400`: The request isn't `multipart/form-data`, the file isn't a gzip or zip archive, more than one file was sent, `teamID` is invalid, or the app is frozen (`frozen_project`).
- `401`: The API token is missing, invalid or expired.
- `403`: With `teamID`: you aren't a member of the team (`team_not_found`), or you don't have the required permission on this app (`no_permission`).
- `404`: The app doesn't exist.
- `413`: The archive is larger than your bundle plan allows, or `Content-Length` is missing.

---

[API](https://skmtc.dev/liara-cloud/apis/paas.md) - [All operations](https://skmtc.dev/liara-cloud/apis/paas/llms.txt) - [OpenAPI document](https://skmtc.dev/liara-cloud/apis/paas/revisions/610162e8a623?raw)
