If you are creating a new function, see the Console Quickstart on Cloud Run. The content on this page only applies to existing legacy functions created with the Cloud Functions v1 API.
Stay organized with collections
Save and categorize content based on your preferences.
HTTP triggers (1st gen)
In Cloud Run functions, an HTTP trigger enables a function to run in response to
HTTP(S) requests. When you specify an HTTP trigger for a function, the function
is assigned a URL at which it can receive requests. HTTP triggers support the
GET, POST, PUT, DELETE, and OPTIONS request methods.
You use HTTP functions
to implement Cloud Run functions that can handle general HTTP(S) requests.
Deployment
You can specify an HTTP trigger when you deploy a function. See
Deploy a Cloud Run function for
general instructions on how to deploy a function, and this section for
additional information specific to configuring HTTP triggers during deployment.
The
--trigger-http
flag specifies that the function uses an HTTP trigger.
The
--allow-unauthenticated
flag specifies that the function can be called without authentication.
Omitting this flag means that calls to the function require
authentication. See
Authenticating for invocation
for more information.
The
--security-level
flag controls whether the function endpoint requires HTTPS.
The value secure-always means HTTPS is required and non-SSL HTTP requests
are not supported. The value secure-optional means both HTTP and HTTPS
are supported. The default is secure-always.
In the Authentication field, select an option depending on
whether you want to allow unauthenticated invocations of your
function. By default, authentication is required. See
Authenticating for invocation
for more information.
Select or clear the Require HTTPS checkbox to control whether
the function endpoint requires HTTPS. If deselected, both HTTP and
HTTPS are supported.
Function URL
After your function is deployed with an HTTP trigger, you can retrieve its
assigned URL.
Cloud Run functions have assigned URLs that have the following
format. These URLs have a deterministic format, meaning that you can predict
what the URL will be before you deploy the function:
[[["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-08-28 UTC."],[[["\u003cp\u003eHTTP triggers allow Cloud Run functions to execute in response to HTTP(S) requests, with support for \u003ccode\u003eGET\u003c/code\u003e, \u003ccode\u003ePOST\u003c/code\u003e, \u003ccode\u003ePUT\u003c/code\u003e, \u003ccode\u003eDELETE\u003c/code\u003e, and \u003ccode\u003eOPTIONS\u003c/code\u003e methods, and each function is assigned a unique URL for receiving requests.\u003c/p\u003e\n"],["\u003cp\u003eBy default, HTTP triggered functions require authentication, but you can configure them during deployment to allow unauthenticated access if needed.\u003c/p\u003e\n"],["\u003cp\u003eYou can deploy a function with an HTTP trigger using the \u003ccode\u003egcloud\u003c/code\u003e CLI, where you have flags to set whether authentication is needed and if the endpoint requires HTTPS, or you can do so through the Google Cloud console by selecting the HTTP option in the trigger section.\u003c/p\u003e\n"],["\u003cp\u003eAfter deployment, the function's assigned URL can be retrieved via the \u003ccode\u003egcloud\u003c/code\u003e CLI using a command, or in the console by navigating to the function's details and viewing the trigger information.\u003c/p\u003e\n"],["\u003cp\u003eCloud Run function URLs follow a predictable format, allowing users to estimate the function URL before deploying the function.\u003c/p\u003e\n"]]],[],null,["# HTTP triggers (1st gen)\n=======================\n\nIn Cloud Run functions, an HTTP trigger enables a function to run in response to\nHTTP(S) requests. When you specify an HTTP trigger for a function, the function\nis assigned a URL at which it can receive requests. HTTP triggers support the\n`GET`, `POST`, `PUT`, `DELETE`, and `OPTIONS` request methods.\n\nBy default, requests to a function with an HTTP trigger require\n[authentication](/functions/1stgendocs/securing/authenticating). You can choose to\nallow unauthenticated calls during [deployment](#deployment). See\n[Allowing unauthenticated HTTP function invocation](/functions/1stgendocs/securing/managing-access-iam#allowing_unauthenticated_http_function_invocation)\nfor more information.\n\nYou use [HTTP functions](/functions/1stgendocs/writing/write-http-functions)\nto implement Cloud Run functions that can handle general HTTP(S) requests.\n\nDeployment\n----------\n\nYou can specify an HTTP trigger when you deploy a function. See\n[Deploy a Cloud Run function](/functions/1stgendocs/deploy) for\ngeneral instructions on how to deploy a function, and this section for\nadditional information specific to configuring HTTP triggers during deployment. \n\n### gcloud\n\nIf you are\n[deploying using the gcloud CLI](/functions/1stgendocs/deploy#gcloud),\nthe flags shown here are used to configure HTTP triggers: \n\n```sh\ngcloud functions deploy YOUR_FUNCTION_NAME \\\n--no-gen2 \\\n--trigger-http \\\n[--allow-unauthenticated] \\\n[--security-level=SECURITY_LEVEL] \\\n...\n```\n\n- The [`--trigger-http`](/sdk/gcloud/reference/functions/deploy#--trigger-http) flag specifies that the function uses an HTTP trigger.\n- The [`--allow-unauthenticated`](/sdk/gcloud/reference/functions/deploy#--allow-unauthenticated) flag specifies that the function can be called without authentication. Omitting this flag means that calls to the function require authentication. See [Authenticating for invocation](/functions/1stgendocs/securing/authenticating) for more information.\n- The [`--security-level`](/sdk/gcloud/reference/functions/deploy#--security-level) flag controls whether the function endpoint requires HTTPS. The value `secure-always` means HTTPS is required and non-SSL HTTP requests are not supported. The value `secure-optional` means both HTTP and HTTPS are supported. The default is `secure-always`.\n\n### Console\n\nIf you are\n[deploying using the Google Cloud console](/functions/1stgendocs/deploy#console),\nyou can configure an HTTP trigger in the **Trigger** section:\n\n1. In the **Trigger type** field, select **HTTP**.\n2. In the **Authentication** field, select an option depending on whether you want to allow unauthenticated invocations of your function. By default, authentication is required. See [Authenticating for invocation](/functions/1stgendocs/securing/authenticating) for more information.\n3. Select or clear the **Require HTTPS** checkbox to control whether the function endpoint requires HTTPS. If deselected, both HTTP and HTTPS are supported.\n\nFunction URL\n------------\n\nAfter your function is deployed with an HTTP trigger, you can retrieve its\nassigned URL.\n\nCloud Run functions have assigned URLs that have the following\nformat. These URLs have a deterministic format, meaning that you can predict\nwhat the URL will be before you deploy the function: \n\n```sh\nhttps://REGION-PROJECT_ID.cloudfunctions.net/FUNCTION_NAME\n```\n\nYou can retrieve your function's URL(s) as follows: \n\n### gcloud\n\n\u003cbr /\u003e\n\n```sh\n gcloud functions describe YOUR_FUNCTION_NAME \n\n --format=\"value(httpsTrigger.url)\"\n \n```\n\n\u003cbr /\u003e\n\n### Console\n\n1. Go to the Cloud Run functions overview page in the Google Cloud console:\n\n [Go to Cloud Run functions](https://console.cloud.google.com/functions/list)\n2. Click the name of the function whose URL you want to retrieve.\n\n3. Click the Edit tab.\n\n4. View your function's URL in the **Trigger** section.\n\nNext steps\n----------\n\n- Learn how to [write HTTP functions](/functions/1stgendocs/writing/write-http-functions).\n- Learn how to [deploy a Cloud Run function](/functions/1stgendocs/deploy).\n- See the [HTTP function tutorial](/functions/1stgendocs/tutorials/http-1st-gen) for an example of writing, deploying, and calling an HTTP function."]]