---
title: "POST /v2/projects/{projectsId}/locations/{locationsId}:uploadSource"
method: POST
path: "/v2/projects/{projectsId}/locations/{locationsId}:uploadSource"
tags: ["projects"]
---

# POST /v2/projects/{projectsId}/locations/{locationsId}:uploadSource

`POST /v2/projects/{projectsId}/locations/{locationsId}:uploadSource`

## Request

- Base URL: `https://run.googleapis.com`
- URL: `https://run.googleapis.com/v2/projects/{projectsId}/locations/{locationsId}:uploadSource`
- Auth: one of:
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud-platform`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/run`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/run`

Uploads a source archive to a Google Cloud Storage bucket through Cloud Run. The uploaded source object should be used for Cloud Run resource deployments. User is responsible for managing the lifecycle of the uploaded object. If uploading through the Cloud Run API to Cloud Storage is not desired, you can use the IAM Deny Policy to deny the `run.locations.uploadSource` permission for all principals.

## Path parameters

- `projectsId` string, required
- `locationsId` string, required

## Query parameters

- `$.xgafv` '1' | '2'
- `access_token` string
- `alt` 'json' | 'media' | 'proto'
- `callback` string
- `fields` string
- `key` string
- `oauth_token` string
- `prettyPrint` boolean
- `quotaUser` string
- `uploadType` string
- `upload_protocol` string

## Request body

- GoogleCloudRunV2UploadSourceRequest: The request message for the UploadSource method.
  - `service` string: The name of Cloud Run Service upload source archive will be used for.

## Response `200`

Successful response

- GoogleCloudRunV2UploadSourceResponse: The response message for the UploadSource method.
  - `cloudStorageSource` GoogleCloudRunV2CloudStorageSource: Cloud Storage source.
    - `bucket` string: Required. The Cloud Storage bucket name.
    - `generation` string, int64: Optional. The Cloud Storage object generation.
    - `object` string: Required. The Cloud Storage object name.

## Changes

- **2026-12-04** `e2518ceb4284`: 4 info
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/run` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/run` was removed from the endpoint's security scheme `Oauth2c`
- **2026-11-10** `fc67acec61c0`: 4 info
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/run` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/run` was removed from the endpoint's security scheme `Oauth2c`
- …earlier changes not shown

[Operation history](https://skmtc.dev/google/apis/run/changes/v2/projects/:projectsId/locations/:locationsId:uploadSource/post.md)

---

[API](https://skmtc.dev/google/apis/run.md) - [All operations](https://skmtc.dev/google/apis/run/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/run/revisions/e2518ceb4284?raw)
