> For the complete documentation index, see [llms.txt](https://docs.bytenite.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bytenite.com/api-reference/customer-api/jobs/create.md).

# Create

***

## Create a new job

> Create a new computing job on ByteNite.

```json
{"openapi":"3.1.1","info":{"title":"ByteNite jobs API","version":"0.1"},"tags":[],"servers":[{"url":"https://api.bytenite.com/v1/customer"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","description":"Your ByteNite access token","name":"Authorization","in":"header"}},"schemas":{"jobsJobResponse":{"type":"object","properties":{"job":{"$ref":"#/components/schemas/jobJob"},"templateInfo":{"$ref":"#/components/schemas/jobJobTemplate","title":"Job template information"}}},"jobJob":{"type":"object","properties":{"id":{"type":"string","title":"Unique id for the job","readOnly":true},"templateId":{"type":"string","title":"Job template to run"},"name":{"type":"string","title":"Human readable name"},"config":{"$ref":"#/components/schemas/jobJobConfig","title":"Job specific parameters"},"priority":{"$ref":"#/components/schemas/jobByteLevel","title":"Execution priority requirements for the job"},"startAt":{"type":"string","format":"date-time","title":"When the job should be run (0 for immediate start)"},"submittedAt":{"type":"string","format":"date-time","title":"Submission date/time for the job request","readOnly":true},"startedAt":{"type":"string","format":"date-time","title":"date/time of the first chunk upload","readOnly":true},"endedAt":{"type":"string","format":"date-time","title":"date/time of completion/failure","readOnly":true},"regions":{"$ref":"#/components/schemas/commonSelectionList","title":"Region to consider (or to exclude) for device selection"},"state":{"$ref":"#/components/schemas/jobJobState","title":"Current job state"},"dataSource":{"$ref":"#/components/schemas/data_sourceDataSource","title":"Input data source"},"params":{"$ref":"#/components/schemas/jobAppParams","description":"A JSON object that should be compatible with the JSONSchema associated to the Job Template specified in template_id","title":"App specific parameters passed to devices"},"dataDestination":{"$ref":"#/components/schemas/data_sourceDataSource","title":"Output data destination"},"duration":{"type":"number","format":"double","title":"Job duration in seconds","readOnly":true},"deletedAt":{"type":"string","format":"date-time","title":"Delete date/time for the job request","readOnly":true},"createdAt":{"type":"string","format":"date-time","title":"Creation time of the job","readOnly":true},"paymentAmount":{"type":"number","format":"double","readOnly":true},"numUnitsEstimation":{"type":"string","format":"int64","readOnly":true},"numChunks":{"type":"integer","format":"int32","readOnly":true},"errorMessage":{"type":"string","readOnly":true},"description":{"type":"string","title":"description of this job"},"stateTimestamps":{"type":"object","additionalProperties":{"type":"string","format":"date-time"},"title":"Timestamps for each state"},"appId":{"type":"string"},"templateInfo":{"$ref":"#/components/schemas/jobJobTemplate"}}},"jobJobConfig":{"type":"object","properties":{"taskTimeout":{"type":"integer","format":"int64","title":"task timeout in seconds"},"jobTimeout":{"type":"integer","format":"int64","title":"job timeout in seconds"},"isTestJob":{"type":"boolean","title":"'true' if this job is a test job"}}},"jobByteLevel":{"type":"string","enum":["EXECUTION_PRIORITY_UNDEFINED","EXECUTION_PRIORITY_CHEAP","EXECUTION_PRIORITY_BALANCED","EXECUTION_PRIORITY_FAST"],"default":"EXECUTION_PRIORITY_UNDEFINED"},"commonSelectionList":{"type":"object","properties":{"blacklist":{"type":"array","items":{"type":"string"}},"whitelist":{"type":"array","items":{"type":"string"}}}},"jobJobState":{"type":"string","enum":["JOB_STATE_NEW","JOB_STATE_STARTED","JOB_STATE_UPLOADING","JOB_STATE_PARTITIONING","JOB_STATE_PARTITIONED","JOB_STATE_TASKS_COMPLETED","JOB_STATE_MERGING","JOB_STATE_MERGED","JOB_STATE_DOWNLOADING","JOB_STATE_COMPLETE","JOB_STATE_FAILED"],"default":"JOB_STATE_NEW","description":" - JOB_STATE_NEW: The job has been created, and the user may still be updating its data sources and parameters.\n - JOB_STATE_STARTED: The job has begun execution after passing validation checks, including data sources, parameters, account balance, and grace period.\n - JOB_STATE_UPLOADING: The job has been retrieved from the partitioner’s job queue and is being sent to the appropriate partitioning engine. Reaching this state confirms the presence of a suitable partitioning engine.\n - JOB_STATE_PARTITIONING: The partitioning engine processes the job and generates multiple chunks, preparing them for further execution.\n - JOB_STATE_PARTITIONED: The partitioning engine has successfully divided the job into chunks, forwarding them to the feeder for distribution. Workers begin fetching and processing these chunks.\n - JOB_STATE_TASKS_COMPLETED: All assigned tasks have been successfully processed by the task runner\n - JOB_STATE_MERGING: The assembler engine retrieves and merges the processed data.\n - JOB_STATE_MERGED: The assembler engine has successfully completed merging the processed chunks. The final result is now prepared for uploading to the specified destination.\n - JOB_STATE_DOWNLOADING: The final output is being saved to the designated data destination.\n - JOB_STATE_COMPLETE: The job lifecycle is successfully completed, and the result has been uploaded to the specified destination.\n - JOB_STATE_FAILED: The job has encountered an error and failed to produce output."},"data_sourceDataSource":{"type":"object","properties":{"dataSourceDescriptor":{"type":"string","description":"Data source selector."},"params":{"$ref":"#/components/schemas/protobufAny","description":"Data source parameters."}},"description":"The data source object specifying configurations for inputs and outputs. Please refer to the dedicated guide for detailed instructions."},"protobufAny":{"type":"object","properties":{"@type":{"type":"string"}},"additionalProperties":{}},"jobAppParams":{"type":"object","properties":{"preset":{"type":"string","description":"[Deprecated] Preset configuration. This field is no longer in use."},"partitioner":{"type":"object","description":"Sets parameters for the partitioning engine."},"assembler":{"type":"object","description":"Sets parameters for the assembling engine."},"app":{"type":"object","description":"Sets parameters for the application.."}}},"jobJobTemplate":{"type":"object","properties":{"id":{"type":"string","title":"Unique ID for this Job Template (primary key)"},"owner":{"type":"string","title":"Owner of this Job Template (primary key)"},"description":{"type":"string","title":"Description of this Job Template"},"app":{"type":"string","title":"The application associated with this Job Template"},"partitioner":{"type":"string","title":"How data is partitioned"},"assembler":{"type":"string","title":"How data is assembled/merged"}}},"rpcStatus":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/protobufAny"}}}},"jobsCreateJobRequest":{"type":"object","properties":{"name":{"type":"string","description":"Mnemonic name for the job."},"templateId":{"type":"string","description":"Identifier of the application template used for this job."},"description":{"type":"string","description":"Textual description of the job."},"dataSource":{"$ref":"#/components/schemas/data_sourceDataSource","description":"Configuration for the data source providing input data to the job."},"dataDestination":{"$ref":"#/components/schemas/data_sourceDataSource","description":"Configuration for the data destination where job output will be sent."},"params":{"$ref":"#/components/schemas/jobAppParams","description":"Job-specific configuration parameters for the distributed application."},"config":{"$ref":"#/components/schemas/jobJobConfig","description":"Job execution preferences."}},"required":["templateId"]}}},"paths":{"/jobs":{"post":{"summary":"Create a new job","description":"Create a new computing job on ByteNite.","operationId":"Customer_CreateJob","responses":{"200":{"description":"A successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/jobsJobResponse"}},"application/x-protobuf":{"schema":{"$ref":"#/components/schemas/jobsJobResponse"}}}},"400":{"description":"Returned when the users sends a malformed request.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"401":{"description":"Returned when the user is not authenticated.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"403":{"description":"Returned when the user does not have permission to access the resource.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"404":{"description":"Returned when the resource does not exist.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"500":{"description":"Returned when an error on the server occurred.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"503":{"description":"Returned when the resource is temporarily unavailable.","content":{"application/json":{"schema":{}},"application/x-protobuf":{"schema":{}}}},"default":{"description":"An unexpected error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rpcStatus"}},"application/x-protobuf":{"schema":{"$ref":"#/components/schemas/rpcStatus"}}}}},"tags":["Jobs"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/jobsCreateJobRequest"}},"application/x-protobuf":{"schema":{"$ref":"#/components/schemas/jobsCreateJobRequest"}}},"required":true}}}}}
```
