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/v2alpha/{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 webpage details the process of generating a signed URL for downloading deployed function source code, which is valid for 30 minutes.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request to generate the download URL is a POST request to \u003ccode\u003ehttps://cloudfunctions.googleapis.com/v2alpha/{name}:generateDownloadUrl\u003c/code\u003e, where \u003ccode\u003e{name}\u003c/code\u003e specifies the function's identifier.\u003c/p\u003e\n"],["\u003cp\u003eThe request requires a \u003ccode\u003ename\u003c/code\u003e parameter in the path, formatted as \u003ccode\u003eprojects/{project}/locations/{location}/functions/{function}\u003c/code\u003e, and the request body must be empty.\u003c/p\u003e\n"],["\u003cp\u003eThe successful response contains a JSON object with a \u003ccode\u003edownloadUrl\u003c/code\u003e field, which holds the generated Google Cloud Storage signed URL for the function's source code.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization to access this functionality requires the \u003ccode\u003ecloudfunctions.functions.sourceCodeGet\u003c/code\u003e IAM permission and the \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e OAuth scope.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.functions.generateDownloadUrl\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.GenerateDownloadUrlResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nReturns 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: \u003chttps://cloud.google.com/storage/docs/access-control/signed-urls\u003e\n\n### HTTP request\n\n`POST https://cloudfunctions.googleapis.com/v2alpha/{name}:generateDownloadUrl`\n\n### Path parameters\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nResponse of `functions.generateDownloadUrl` method.\n\nIf successful, the response body contains data with the following structure:\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]