# Method: projects.locations.functions.generateDownloadUrl

- [HTTP request](https://docs.cloud.google.com/functions/docs/reference/rest/v2beta/projects.locations.functions/generateDownloadUrl#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/functions/docs/reference/rest/v2beta/projects.locations.functions/generateDownloadUrl#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/functions/docs/reference/rest/v2beta/projects.locations.functions/generateDownloadUrl#body.request_body)
- [Response body](https://docs.cloud.google.com/functions/docs/reference/rest/v2beta/projects.locations.functions/generateDownloadUrl#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/functions/docs/reference/rest/v2beta/projects.locations.functions/generateDownloadUrl#body.GenerateDownloadUrlResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/functions/docs/reference/rest/v2beta/projects.locations.functions/generateDownloadUrl#body.aspect)
- [Try it!](https://docs.cloud.google.com/functions/docs/reference/rest/v2beta/projects.locations.functions/generateDownloadUrl#try-it)

Returns a signed URL for downloading deployed function source code. The URL is only valid for a limited period and should be used within 30 minutes of generation. For more information about the signed URL usage see: <https://cloud.google.com/storage/docs/access-control/signed-urls>

### HTTP request

`POST https://cloudfunctions.googleapis.com/v2beta/{name}:generateDownloadUrl`

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The name of function for which source code Google Cloud Storage signed URL should be generated. It takes the form `projects/{project}/locations/{location}/functions/{function}`. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `name`: - `cloudfunctions.functions.sourceCodeGet` |

### Request body

The request body must be empty.

### Response body

Response of `functions.generateDownloadUrl` method.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "downloadUrl": string } ``` |

| Fields ||
|---|---|
| `downloadUrl` | `string` The generated Google Cloud Storage signed URL that should be used for function source code download. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).