# Update

***

## Set a job datasource

> Set a job datasource

```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"}}}},"jobsDataSourceParams":{"type":"object","properties":{"dataSource":{"$ref":"#/components/schemas/data_sourceDataSource"},"dataDestination":{"$ref":"#/components/schemas/data_sourceDataSource"}}}}},"paths":{"/jobs/{jobId}/datasource":{"patch":{"summary":"Set a job datasource","description":"Set a job datasource","operationId":"Customer_SetJobDataSource","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"}}}}},"parameters":[{"schema":{"type":"string"},"name":"jobId","description":"The id associated with your job.","in":"path","required":true}],"tags":["Jobs"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/jobsDataSourceParams"}},"application/x-protobuf":{"schema":{"$ref":"#/components/schemas/jobsDataSourceParams"}}},"required":true}}}}}
```

***

## Set job parameters

> Set or update job specific parameters

```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"}}}}}},"paths":{"/jobs/{jobId}/params":{"patch":{"summary":"Set job parameters","description":"Set or update job specific parameters","operationId":"Customer_SetJobParams","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"}}}}},"parameters":[{"schema":{"type":"string"},"name":"jobId","description":"The id associated with your job.","in":"path","required":true}],"tags":["Jobs"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/jobAppParams"}},"application/x-protobuf":{"schema":{"$ref":"#/components/schemas/jobAppParams"}}},"required":true}}}}}
```

***

## Set a job name

> Set a job name

```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"}}}}}},"paths":{"/jobs/{jobId}/jobname":{"patch":{"summary":"Set a job name","description":"Set a job name","operationId":"Customer_SetJobName","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"}}}}},"parameters":[{"schema":{"type":"string"},"name":"jobId","description":"The id associated with your job.","in":"path","required":true}],"tags":["Jobs"],"requestBody":{"content":{"application/json":{"schema":{"type":"string"}},"application/x-protobuf":{"schema":{"type":"string"}}},"description":"A descriptive name for your job.","required":true}}}}}
```

***

## Set job configs

> Set or update execution parameters/configurations

```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"}}}}}},"paths":{"/jobs/{jobId}/configs":{"patch":{"summary":"Set job configs","description":"Set or update execution parameters/configurations","operationId":"Customer_SetJobPreferences","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"}}}}},"parameters":[{"schema":{"type":"string"},"name":"jobId","description":"The id associated with your job.","in":"path","required":true}],"tags":["Jobs"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/jobJobConfig"}},"application/x-protobuf":{"schema":{"$ref":"#/components/schemas/jobJobConfig"}}},"required":true}}}}}
```
