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/v2/{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 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-16 UTC."],[[["\u003cp\u003eThis API endpoint generates a time-limited, signed URL for downloading the source code of a deployed Google Cloud function.\u003c/p\u003e\n"],["\u003cp\u003eThe request to generate the URL is a \u003ccode\u003ePOST\u003c/code\u003e request to a specific endpoint including the function's name as a path parameter.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must be empty, and authorization requires \u003ccode\u003ecloudfunctions.functions.sourceCodeGet\u003c/code\u003e IAM permission and the OAuth scope \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe response provides a JSON object containing a \u003ccode\u003edownloadUrl\u003c/code\u003e string, which is the generated signed URL for downloading the function's source code, valid for 30 minutes.\u003c/p\u003e\n"],["\u003cp\u003eTo get the signed URL you need to use the correct function path which is \u003ccode\u003eprojects/{project}/locations/{location}/functions/{function}\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,[]]