Creates a Cloud Dataflow job from a template. Do not enter confidential information when you supply string values using the API.
To create a job, we recommend usingprojects.locations.templates.createwith aregional endpoint. Usingprojects.templates.createis not recommended, because your job will always start inus-central1.
HTTP request
POST https://dataflow.googleapis.com/v1b3/projects/{projectId}/templates
Required. The ID of the Cloud Platform project that the job belongs to.
Request body
The request body contains data with the following structure:
JSON representation
{"jobName":string,"parameters":{string:string,...},"environment":{object (RuntimeEnvironment)},"location":string,// Union fieldtemplatecan be only one of the following:"gcsPath":string// End of list of possible types for union fieldtemplate.}
Fields
jobName
string
Required. The job name to use for the created job.
[[["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-04-30 UTC."],[[["\u003cp\u003eThis API call creates a Cloud Dataflow job from a template, preferably using the \u003ccode\u003eprojects.locations.templates.create\u003c/code\u003e method with a regional endpoint.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request utilizes a \u003ccode\u003ePOST\u003c/code\u003e method directed to the URL \u003ccode\u003ehttps://dataflow.googleapis.com/v1b3/projects/{projectId}/templates\u003c/code\u003e with gRPC Transcoding syntax.\u003c/p\u003e\n"],["\u003cp\u003eThe request requires a \u003ccode\u003eprojectId\u003c/code\u003e path parameter and a JSON body that includes fields such as \u003ccode\u003ejobName\u003c/code\u003e, \u003ccode\u003eparameters\u003c/code\u003e, \u003ccode\u003eenvironment\u003c/code\u003e, and \u003ccode\u003elocation\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe template from which to create the job is specified as either a \u003ccode\u003egcsPath\u003c/code\u003e which is a Cloud Storage URL beginning with \u003ccode\u003egs://\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful execution of the API call returns a newly created \u003ccode\u003eJob\u003c/code\u003e instance, and it necessitates either the \u003ccode\u003ehttps://www.googleapis.com/auth/compute\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e OAuth scope.\u003c/p\u003e\n"]]],[],null,["# Method: projects.templates.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates a Cloud Dataflow job from a template. Do not enter confidential information when you supply string values using the API.\n\nTo create a job, we recommend using `projects.locations.templates.create` with a [regional endpoint](https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using `projects.templates.create` is not recommended, because your job will always start in `us-central1`.\n\n### HTTP request\n\n`POST https://dataflow.googleapis.com/v1b3/projects/{projectId}/templates`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Job](/dataflow/docs/reference/rest/v1b3/projects.jobs#Job).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/compute`\n- `\n https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]