gcloud tasks create-http-task [TASK_ID] --queue=QUEUE --url=URL [--header=HEADER_FIELD: HEADER_VALUE] [--location=LOCATION] [--method=METHOD] [--schedule-time=SCHEDULE_TIME] [--body-content=BODY_CONTENT | --body-file=BODY_FILE] [[--oauth-service-account-email=OAUTH_SERVICE_ACCOUNT_EMAIL : --oauth-token-scope=OAUTH_TOKEN_SCOPE] | [--oidc-service-account-email=OIDC_SERVICE_ACCOUNT_EMAIL : --oidc-token-audience=OIDC_TOKEN_AUDIENCE]] [GCLOUD_WIDE_FLAG …]
gcloud tasks create-http-task --queue=my-queue --url=http://example.com/handler-path my-taskTASK_ID]If not specified then the system will generate a random unique task ID. Explicitly specifying a task ID enables task de-duplication. If a task's ID is identical to that of an existing task or a task that was deleted or completed recently then the call will fail.
Because there is an extra lookup cost to identify duplicate task names, tasks created with IDs have significantly increased latency. Using hashed strings for the task ID or for the prefix of the task ID is recommended.--queue=QUEUE--url=URL--header=HEADER_FIELD: HEADER_VALUE--location=LOCATION--method=METHOD--schedule-time=SCHEDULE_TIME--body-content=BODY_CONTENT--body-file=BODY_FILE--oauth-service-account-email=OAUTH_SERVICE_ACCOUNT_EMAIL--oauth-token-scope=OAUTH_TOKEN_SCOPE--oidc-service-account-email=OIDC_SERVICE_ACCOUNT_EMAIL--oidc-token-audience=OIDC_TOKEN_AUDIENCE--access-token-file,
--account, --billing-project,
--configuration,
--flags-file,
--flatten, --format, --help, --impersonate-service-account,
--log-http,
--project, --quiet, --trace-token, --user-output-enabled,
--verbosity.
Run $ gcloud help for details.
gcloud alpha tasks create-http-taskgcloud beta tasks create-http-task
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-05-27 UTC.