Method: projects.locations.functions.generateDownloadUrl

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:

HTTP request


Path parameters



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 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


The generated Google Cloud Storage signed URL that should be used for function source code download.

Authorization scopes

Requires the following OAuth scope:


For more information, see the Authentication Overview.