> ## 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

### create\_job

<ul>
  <li>
    create\_job(\
    &#x20;endpoint: string,\
    &#x20;request\_encoding: string | undefined,\
    &#x20;data: string,\
    &#x20;data\_str: string,\
    &#x20;options?: Record\<string, string>,\
    &#x20;callback?: [GPUdbCallback](https://docs.kinetica.com/content/api/javascript/types/GPUdbCallback.md),\
    ): Promise\<[CreateJobResponse](https://docs.kinetica.com/content/api/javascript/interfaces/CreateJobResponse.md)>

    Create 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`.

    #### Parameters

    <ul>
      <li>
        endpoint: string

        Indicates which endpoint to execute, e.g. '/alter/table'.
      </li>

      <li>
        request\_encoding: string | undefined

        The encoding of the request payload for the job.
      </li>

      <li>
        data: string

        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: string

        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>
        `Optional`options: Record\<string, string>

        Optional parameters.
      </li>

      <li>
        `Optional`callback: [GPUdbCallback](https://docs.kinetica.com/content/api/javascript/types/GPUdbCallback.md)

        Optional callback function
      </li>
    </ul>

    #### Returns Promise\<[CreateJobResponse](https://docs.kinetica.com/content/api/javascript/interfaces/CreateJobResponse.md)>

    Promise\<Types.CreateJobResponse> - Promise resolving to the response

    <ul>
      <li>Defined in [src/GPUdb.ts:6281](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L6281)</li>
    </ul>
  </li>
</ul>

### create\_job\_request

<ul>
  <li>
    create\_job\_request(\
    &#x20;request: [CreateJobRequest](https://docs.kinetica.com/content/api/javascript/interfaces/CreateJobRequest.md),\
    &#x20;callback?: [GPUdbCallback](https://docs.kinetica.com/content/api/javascript/types/GPUdbCallback.md),\
    ): Promise\<[CreateJobResponse](https://docs.kinetica.com/content/api/javascript/interfaces/CreateJobResponse.md)>

    Create 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`.

    #### Parameters

    <ul>
      <li>
        request: [CreateJobRequest](https://docs.kinetica.com/content/api/javascript/interfaces/CreateJobRequest.md)

        Request object containing the parameters for the operation
      </li>

      <li>
        `Optional`callback: [GPUdbCallback](https://docs.kinetica.com/content/api/javascript/types/GPUdbCallback.md)

        Optional callback function
      </li>
    </ul>

    #### Returns Promise\<[CreateJobResponse](https://docs.kinetica.com/content/api/javascript/interfaces/CreateJobResponse.md)>

    Promise\<Types.CreateJobResponse> - Promise resolving to the response

    <ul>
      <li>Defined in [src/GPUdb.ts:6249](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L6249)</li>
    </ul>
  </li>
</ul>


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