| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 | [role="xpack"][testenv="platinum"][[update-dfanalytics]]= Update {dfanalytics-jobs} API[subs="attributes"]++++<titleabbrev>Update {dfanalytics-jobs}</titleabbrev>++++Updates an existing {dfanalytics-job}.[[ml-update-dfanalytics-request]]== {api-request-title}`POST _ml/data_frame/analytics/<data_frame_analytics_id>/_update`[[ml-update-dfanalytics-prereq]]== {api-prereq-title}Requires the following privileges:* cluster: `manage_ml` (the `machine_learning_admin` built-in role grants this   privilege)* source indices: `read`, `view_index_metadata`* destination index: `read`, `create_index`, `manage` and `index`NOTE: The {dfanalytics-job} remembers which roles the user who updated it had atthe time of the update. When you start the job, it performs the analysis usingthose same roles. If you provide<<http-clients-secondary-authorization,secondary authorization headers>>, those credentials are used instead.[[ml-update-dfanalytics-desc]]== {api-description-title}This API updates an existing {dfanalytics-job} that performs an analysis on the sourceindices and stores the outcome in a destination index.[[ml-update-dfanalytics-path-params]]== {api-path-parms-title}`<data_frame_analytics_id>`::(Required, string)include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-data-frame-analytics-define][role="child_attributes"][[ml-update-dfanalytics-request-body]]== {api-request-body-title}`allow_lazy_start`::(Optional, Boolean) Specifies whether this job can start when there is insufficient {ml} node capacity for it to be immediately assigned to a node. The default is `false`; ifa {ml} node with capacity to run the job cannot immediately be found, the APIreturns an error. However, this is also subject to the cluster-wide`xpack.ml.max_lazy_ml_nodes` setting. See <<advanced-ml-settings>>. If thisoption is set to `true`, the API does not return an error and the job waits inthe `starting` state until sufficient {ml} node capacity is available.`description`::(Optional, string)include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=description-dfa]`max_num_threads`::(Optional, integer)The maximum number of threads to be used by the analysis.The default value is `1`. Using more threads may decrease the timenecessary to complete the analysis at the cost of using more CPU.Note that the process may use additional threads for operationalfunctionality other than the analysis itself.`model_memory_limit`::(Optional, string)include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-memory-limit-dfa][[ml-update-dfanalytics-example]]== {api-examples-title}[[ml-update-dfanalytics-example-preprocess]]=== Updating model memory limit exampleThe following example shows how to update the model memory limit for the existing {dfanalytics} configuration.[source,console]--------------------------------------------------POST _ml/data_frame/analytics/model-flight-delays/_update{  "model_memory_limit": "200mb"}--------------------------------------------------// TEST[skip:setup kibana sample data]
 |