> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# create_job

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_job.rs#L35-L50)
pub async fn [create\_job](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-job.md#method.create_job)( \&self, endpoint: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), request\_encoding: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), data: [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md), data\_str: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateJobResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateJobResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Create a new job to be executed asynchronouslyCreate a job which will run asynchronously. The response returns a job ID, which can be used to query the status and result of the job. The status and the result of the job upon completion can be requested by `/get/job`.

##### Arguments

<ul>
  <li>`endpoint` - Indicates which endpoint to execute, e.g. ‘/alter/table’.</li>
  <li>`request_encoding` - The encoding of the request payload for the job.</li>
  <li>`data` - Binary-encoded payload for the job to be run asynchronously. The payload must contain the relevant input parameters for the endpoint indicated in `endpoint`. Please see the documentation for the appropriate endpoint to see what values must (or can) be specified. If this parameter is used, then `request_encoding` must be binary or snappy.</li>
  <li>`data_str` - JSON-encoded payload for the job to be run asynchronously. The payload must contain the relevant input parameters for the endpoint indicated in `endpoint`. Please see the documentation for the appropriate endpoint to see what values must (or can) be specified. If this parameter is used, then `request_encoding` must be json.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_job.rs#L77-L99)
pub async fn [create\_job\_with\_opts](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-job.md#method.create_job_with_opts)( \&self, endpoint: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), request\_encoding: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), data: [ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md), data\_str: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), options: [CreateJobRequestOptions](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateJobRequestOptions.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateJobResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateJobResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Create a new job to be executed asynchronouslyCreate a job which will run asynchronously. The response returns a job ID, which can be used to query the status and result of the job. The status and the result of the job upon completion can be requested by `/get/job`.

##### Arguments

<ul>
  <li>`endpoint` - Indicates which endpoint to execute, e.g. ‘/alter/table’.</li>
  <li>`request_encoding` - The encoding of the request payload for the job.</li>
  <li>`data` - Binary-encoded payload for the job to be run asynchronously. The payload must contain the relevant input parameters for the endpoint indicated in `endpoint`. Please see the documentation for the appropriate endpoint to see what values must (or can) be specified. If this parameter is used, then `request_encoding` must be binary or snappy.</li>
  <li>`data_str` - JSON-encoded payload for the job to be run asynchronously. The payload must contain the relevant input parameters for the endpoint indicated in `endpoint`. Please see the documentation for the appropriate endpoint to see what values must (or can) be specified. If this parameter is used, then `request_encoding` must be json.</li>
  <li>`options` - The optional parameters; any left unset take the server’s defaults.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_job.rs#L102-L113)
pub async fn [create\_job\_raw](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-job.md#method.create_job_raw)( \&self, request: &[CreateJobRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateJobRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateJobResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateJobResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`CreateJobRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateJobRequest) to the `/create/job` endpoint.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_job.rs#L117-L129)
pub async fn [create\_job\_from\_url](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-job.md#method.create_job_from_url)( \&self, url: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html), request: &[CreateJobRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateJobRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateJobResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateJobResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`CreateJobRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateJobRequest) to a specific worker URL, bypassing HA head-node selection. Used for multi-head access.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.