Elastic Stack (ELK Stack) Ml API
The ml API from Elastic Stack (ELK Stack) — 7 operation(s) for ml.
The ml API from Elastic Stack (ELK Stack) — 7 operation(s) for ml.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/elk-stack-ml-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Elk Stack Ml API
version: ''
x-refined-note:
- x-doc-license differs across the merged source definitions and was not carried
- x-feedbackLink differs across the merged source definitions and was not carried
description: 'Operations tagged ml across 2 of this provider''s published API definitions: elk-stack-elasticsearch-openapi.json, elk-stack-kibana-openapi.yaml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://{kibana_url}
variables:
kibana_url:
default: localhost:5601
tags:
- name: ml
paths:
/_ml/memory/_stats:
get:
tags:
- ml
summary: Get machine learning memory usage info
description: 'Get information about how machine learning jobs and trained models are using memory,
on each node, both within the JVM heap, and natively, outside of the JVM.
## Required authorization
* Cluster privileges: `monitor_ml`
'
operationId: ml-get-memory-stats
parameters:
- $ref: '#/components/parameters/ml.get_memory_stats-master_timeout'
- $ref: '#/components/parameters/ml.get_memory_stats-timeout'
responses:
'200':
$ref: '#/components/responses/ml.get_memory_stats-200'
x-state: Generally available; Added in 8.2.0
x-metaTags:
- content: Elasticsearch, Machine Learning
name: product_name
/_ml/memory/{node_id}/_stats:
get:
tags:
- ml
summary: Get machine learning memory usage info
description: 'Get information about how machine learning jobs and trained models are using memory,
on each node, both within the JVM heap, and natively, outside of the JVM.
## Required authorization
* Cluster privileges: `monitor_ml`
'
operationId: ml-get-memory-stats-1
parameters:
- $ref: '#/components/parameters/ml.get_memory_stats-node_id'
- $ref: '#/components/parameters/ml.get_memory_stats-master_timeout'
- $ref: '#/components/parameters/ml.get_memory_stats-timeout'
responses:
'200':
$ref: '#/components/responses/ml.get_memory_stats-200'
x-state: Generally available; Added in 8.2.0
x-metaTags:
- content: Elasticsearch, Machine Learning
name: product_name
/_ml/info:
get:
tags:
- ml
summary: Get machine learning information
description: 'Get defaults and limits used by machine learning.
This endpoint is designed to be used by a user interface that needs to fully
understand machine learning configurations where some options are not
specified, meaning that the defaults should be used. This endpoint may be
used to find out what those defaults are. It also provides information about
the maximum size of machine learning jobs that could run in the current
cluster configuration.
## Required authorization
* Cluster privileges: `monitor_ml`
'
operationId: ml-info
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
defaults:
allOf:
- $ref: '#/components/schemas/ml.info.Defaults'
limits:
allOf:
- $ref: '#/components/schemas/ml.info.Limits'
upgrade_mode:
type: boolean
native_code:
allOf:
- $ref: '#/components/schemas/ml.info.NativeCode'
required:
- defaults
- limits
- upgrade_mode
- native_code
x-state: Generally available; Added in 6.3.0
x-metaTags:
- content: Elasticsearch, Machine Learning
name: product_name
/_ml/set_upgrade_mode:
post:
tags:
- ml
summary: Set upgrade_mode for ML indices
description: 'Sets a cluster wide upgrade_mode setting that prepares machine learning
indices for an upgrade.
When upgrading your cluster, in some circumstances you must restart your
nodes and reindex your machine learning indices. In those circumstances,
there must be no machine learning jobs running. You can close the machine
learning jobs, do the upgrade, then open all the jobs again. Alternatively,
you can use this API to temporarily halt tasks associated with the jobs and
datafeeds and prevent new jobs from opening. You can also use this API
during upgrades that do not require you to reindex your machine learning
indices, though stopping jobs is not a requirement in that case.
You can see the current value for the upgrade_mode setting by using the get
machine learning info API.
## Required authorization
* Cluster privileges: `manage_ml`
'
operationId: ml-set-upgrade-mode
parameters:
- in: query
name: enabled
description: 'When `true`, it enables `upgrade_mode` which temporarily halts all job
and datafeed tasks and prohibits new job and datafeed tasks from
starting.'
deprecated: false
schema:
default: false
type: boolean
style: form
- in: query
name: timeout
description: The time to wait for the request to be completed.
deprecated: false
schema:
default: 30s
allOf:
- $ref: '#/components/schemas/_types.Duration'
style: form
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/_types.AcknowledgedResponseBase'
x-state: Generally available; Added in 6.7.0
x-metaTags:
- content: Elasticsearch, Machine Learning
name: product_name
/api/ml/saved_objects/sync:
get:
description: '**Spaces method and path for this operation:**
<div><span class="operation-verb get">get</span> <span class="operation-path">/s/{space_id}/api/ml/saved_objects/sync</span></div>
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Synchronizes Kibana saved objects for machine learning jobs and trained models in the default space. You must have `all` privileges for the **Machine Learning** feature in the **Analytics** section of the Kibana feature privileges. This API runs automatically when you start Kibana and periodically thereafter.
'
operationId: mlSync
parameters:
- $ref: '#/components/parameters/Machine_learning_APIs_simulateParam'
responses:
'200':
content:
application/json:
examples:
syncExample:
$ref: '#/components/examples/Machine_learning_APIs_mlSyncExample'
schema:
$ref: '#/components/schemas/Machine_learning_APIs_mlSync200Response'
description: Indicates a successful call
'401':
content:
application/json:
examples:
syncExample:
$ref: '#/components/examples/Machine_learning_APIs_mlSync401Example'
schema:
$ref: '#/components/schemas/Machine_learning_APIs_mlSync4xxResponse'
description: Authorization information is missing or invalid.
summary: Sync saved objects in the default space
tags:
- ml
x-metaTags:
- content: Kibana
name: product_name
security:
- apiKeyAuth: []
- basicAuth: []
servers:
- url: https://{kibana_url}
variables:
kibana_url:
default: localhost:5601
/api/ml/saved_objects/update_jobs_spaces:
post:
description: '**Spaces method and path for this operation:**
<div><span class="operation-verb post">post</span> <span class="operation-path">/s/{space_id}/api/ml/saved_objects/update_jobs_spaces</span></div>
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Update a list of jobs to add and/or remove them from given spaces.'
operationId: mlUpdateJobsSpaces
requestBody:
content:
application/json:
examples:
updateADJobSpacesRequest:
value:
jobIds:
- test-job
jobType: anomaly-detector
spacesToAdd:
- default
spacesToRemove:
- '*'
updateDFAJobSpacesRequest:
value:
jobIds:
- test-job
jobType: data-frame-analytics
spacesToAdd:
- default
spacesToRemove:
- '*'
responses:
'200':
content:
application/json:
examples:
successADResponse:
value:
test-job:
success: true
type: anomaly-detector
successDFAResponse:
value:
test-job:
success: true
type: data-frame-analytics
description: Indicates a successful call
summary: Update jobs spaces
tags:
- ml
x-metaTags:
- content: Kibana
name: product_name
security:
- apiKeyAuth: []
- basicAuth: []
servers:
- url: https://{kibana_url}
variables:
kibana_url:
default: localhost:5601
/api/ml/saved_objects/update_trained_models_spaces:
post:
description: '**Spaces method and path for this operation:**
<div><span class="operation-verb post">post</span> <span class="operation-path">/s/{space_id}/api/ml/saved_objects/update_trained_models_spaces</span></div>
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Update a list of trained models to add and/or remove them from given spaces.'
operationId: mlUpdateTrainedModelsSpaces
requestBody:
content:
application/json:
examples:
updateTrainedModelsSpacesRequest:
value:
modelIds:
- test-model
spacesToAdd:
- default
spacesToRemove:
- '*'
responses:
'200':
content:
application/json:
examples:
successTMResponse:
value:
test-model:
success: true
type: trained-model"
description: Indicates a successful call
summary: Update trained models spaces
tags:
- ml
x-metaTags:
- content: Kibana
name: product_name
security:
- apiKeyAuth: []
- basicAuth: []
servers:
- url: https://{kibana_url}
variables:
kibana_url:
default: localhost:5601
components:
schemas:
_types.query_dsl.SpanContainingQuery:
allOf:
- $ref: '#/components/schemas/_types.query_dsl.QueryBase'
- type: object
properties:
big:
description: 'Can be any span query.
Matching spans from `big` that contain matches from `little` are returned.'
allOf:
- $ref: '#/components/schemas/_types.query_dsl.SpanQuery'
little:
description: 'Can be any span query.
Matching spans from `big` that contain matches from `little` are returned.'
allOf:
- $ref: '#/components/schemas/_types.query_dsl.SpanQuery'
required:
- big
- little
_types.query_dsl.TypeQuery:
allOf:
- $ref: '#/components/schemas/_types.query_dsl.QueryBase'
- type: object
properties:
value:
type: string
required:
- value
_types.analysis.MinHashTokenFilter:
allOf:
- $ref: '#/components/schemas/_types.analysis.TokenFilterBase'
- type: object
properties:
type:
type: string
enum:
- min_hash
bucket_count:
description: Number of buckets to which hashes are assigned. Defaults to `512`.
type: number
hash_count:
description: Number of ways to hash each token in the stream. Defaults to `1`.
type: number
hash_set_size:
description: 'Number of hashes to keep from each bucket. Defaults to `1`.
Hashes are retained by ascending size, starting with the bucket’s smallest hash first.'
type: number
with_rotation:
description: If `true`, the filter fills empty buckets with the value of the first non-empty bucket to its circular right if the `hash_set_size` is `1`. If the `bucket_count` argument is greater than 1, this parameter defaults to `true`. Otherwise, this parameter defaults to `false`.
type: boolean
required:
- type
_types.aggregations.TopHitsAggregation:
allOf:
- $ref: '#/components/schemas/_types.aggregations.MetricAggregationBase'
- type: object
properties:
docvalue_fields:
description: Fields for which to return doc values.
type: array
items:
$ref: '#/components/schemas/_types.query_dsl.FieldAndFormat'
explain:
description: If `true`, returns detailed information about score computation as part of a hit.
default: false
type: boolean
fields:
description: 'Array of wildcard (*) patterns. The request returns values for field names
matching these patterns in the hits.fields property of the response.'
type: array
items:
$ref: '#/components/schemas/_types.query_dsl.FieldAndFormat'
from:
description: Starting document offset.
default: 0.0
type: number
highlight:
description: Specifies the highlighter to use for retrieving highlighted snippets from one or more fields in the search results.
allOf:
- $ref: '#/components/schemas/_global.search._types.Highlight'
script_fields:
description: Returns the result of one or more script evaluations for each hit.
type: object
additionalProperties:
$ref: '#/components/schemas/_types.ScriptField'
size:
description: The maximum number of top matching hits to return per bucket.
default: 3.0
type: number
sort:
description: 'Sort order of the top matching hits.
By default, the hits are sorted by the score of the main query.'
allOf:
- $ref: '#/components/schemas/_types.Sort'
_source:
description: Selects the fields of the source that are returned.
allOf:
- $ref: '#/components/schemas/_global.search._types.SourceConfig'
stored_fields:
description: Returns values for the specified stored fields (fields that use the `store` mapping option).
allOf:
- $ref: '#/components/schemas/_types.Fields'
track_scores:
description: If `true`, calculates and returns document scores, even if the scores are not used for sorting.
default: false
type: boolean
version:
description: If `true`, returns document version as part of a hit.
default: false
type: boolean
seq_no_primary_term:
description: If `true`, returns sequence number and primary term of the last modification of each hit.
type: boolean
_types.query_dsl.CombinedFieldsZeroTerms:
type: string
enum:
- none
- all
_types.aggregations.BucketSelectorAggregation:
allOf:
- $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase'
- type: object
properties:
script:
description: The script to run for this aggregation.
allOf:
- $ref: '#/components/schemas/_types.Script'
_types.analysis.HunspellTokenFilter:
allOf:
- $ref: '#/components/schemas/_types.analysis.TokenFilterBase'
- type: object
properties:
type:
type: string
enum:
- hunspell
dedup:
description: If `true`, duplicate tokens are removed from the filter’s output. Defaults to `true`.
type: boolean
dictionary:
description: 'One or more `.dic` files (e.g, `en_US.dic`, my_custom.dic) to use for the Hunspell dictionary.
By default, the `hunspell` filter uses all `.dic` files in the `<$ES_PATH_CONF>/hunspell/<locale>` directory specified using the `lang`, `language`, or `locale` parameter.'
type: string
locale:
description: Locale directory used to specify the `.aff` and `.dic` files for a Hunspell dictionary.
type: string
longest_only:
description: If `true`, only the longest stemmed version of each token is included in the output. If `false`, all stemmed versions of the token are included. Defaults to `false`.
type: boolean
required:
- type
- locale
_types.aggregations.TermsPartition:
type: object
properties:
num_partitions:
description: The number of partitions.
type: number
partition:
description: The partition number for this request.
type: number
required:
- num_partitions
- partition
_types.query_dsl.GeoBoundingBoxQuery:
allOf:
- $ref: '#/components/schemas/_types.query_dsl.QueryBase'
- type: object
properties:
type:
deprecated: true
allOf:
- $ref: '#/components/schemas/_types.query_dsl.GeoExecution'
validation_method:
description: 'Set to `IGNORE_MALFORMED` to accept geo points with invalid latitude or longitude.
Set to `COERCE` to also try to infer correct latitude or longitude.'
default: '''strict'''
allOf:
- $ref: '#/components/schemas/_types.query_dsl.GeoValidationMethod'
ignore_unmapped:
description: 'Set to `true` to ignore an unmapped field and not match any documents for this query.
Set to `false` to throw an exception if the field is not mapped.'
default: false
type: boolean
_types.SortResults:
type: array
items:
$ref: '#/components/schemas/_types.FieldValue'
_types.aggregations.BucketCorrelationFunctionCountCorrelationIndicator:
type: object
properties:
doc_count:
description: 'The total number of documents that initially created the expectations. It’s required to be greater
than or equal to the sum of all values in the buckets_path as this is the originating superset of data
to which the term values are correlated.'
type: number
expectations:
description: 'An array of numbers with which to correlate the configured `bucket_path` values.
The length of this value must always equal the number of buckets returned by the `bucket_path`.'
type: array
items:
type: number
fractions:
description: 'An array of fractions to use when averaging and calculating variance. This should be used if
the pre-calculated data and the buckets_path have known gaps. The length of fractions, if provided,
must equal expectations.'
type: array
items:
type: number
required:
- doc_count
- expectations
_types.aggregations.ChildrenAggregation:
allOf:
- $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase'
- type: object
properties:
type:
description: The child type that should be selected.
allOf:
- $ref: '#/components/schemas/_types.RelationName'
_types.EpochTimeUnitMillis:
allOf:
- $ref: '#/components/schemas/_types.UnitMillis'
_types.aggregations.MatrixAggregation:
allOf:
- $ref: '#/components/schemas/_types.aggregations.Aggregation'
- type: object
properties:
fields:
description: An array of fields for computing the statistics.
allOf:
- $ref: '#/components/schemas/_types.Fields'
missing:
description: 'The value to apply to documents that do not have a value.
By default, documents without a value are ignored.'
type: object
additionalProperties:
type: number
_types.query_dsl.DisMaxQuery:
allOf:
- $ref: '#/components/schemas/_types.query_dsl.QueryBase'
- type: object
properties:
queries:
description: 'One or more query clauses.
Returned documents must match one or more of these queries.
If a document matches multiple queries, Elasticsearch uses the highest relevance score.'
type: array
items:
$ref: '#/components/schemas/_types.query_dsl.QueryContainer'
tie_breaker:
description: Floating point number between 0 and 1.0 used to increase the relevance scores of documents matching multiple query clauses.
default: 0.0
type: number
required:
- queries
_types.aggregations.SamplerAggregationExecutionHint:
type: string
enum:
- map
- global_ordinals
- bytes_hash
_types.aggregations.MovingPercentilesAggregation:
allOf:
- $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase'
- type: object
properties:
window:
description: The size of window to "slide" across the histogram.
type: number
shift:
description: 'By default, the window consists of the last n values excluding the current bucket.
Increasing `shift` by 1, moves the starting window position by 1 to the right.'
default: 0.0
type: number
keyed:
type: boolean
_types.aggregations.HoltWintersModelSettings:
type: object
properties:
alpha:
type: number
beta:
type: number
gamma:
type: number
pad:
type: boolean
period:
type: number
type:
allOf:
- $ref: '#/components/schemas/_types.aggregations.HoltWintersType'
_types.aggregations.HistogramAggregation:
allOf:
- $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase'
- type: object
properties:
extended_bounds:
description: Enables extending the bounds of the histogram beyond the data itself.
allOf:
- $ref: '#/components/schemas/_types.aggregations.ExtendedBoundsdouble'
hard_bounds:
description: 'Limits the range of buckets in the histogram.
It is particularly useful in the case of open data ranges that can result in a very large number of buckets.'
allOf:
- $ref: '#/components/schemas/_types.aggregations.ExtendedBoundsdouble'
field:
description: The name of the field to aggregate on.
allOf:
- $ref: '#/components/schemas/_types.Field'
interval:
description: 'The interval for the buckets.
Must be a positive decimal.'
type: number
min_doc_count:
description: 'Only returns buckets that have `min_doc_count` number of documents.
By default, the response will fill gaps in the histogram with empty buckets.'
type: number
missing:
description: 'The value to apply to documents that do not have a value.
By default, documents without a value are ignored.'
type: number
offset:
description: 'By default, the bucket keys start with 0 and then continue in even spaced steps of `interval`.
The bucket boundaries can be shifted by using the `offset` option.'
type: number
order:
description: 'The sort order of the returned buckets.
By default, the returned buckets are sorted by their key ascending.'
allOf:
- $ref: '#/components/schemas/_types.aggregations.AggregateOrder'
script:
allOf:
- $ref: '#/components/schemas/_types.Script'
format:
type: string
keyed:
description: If `true`, returns buckets as a hash instead of an array, keyed by the bucket keys.
default: false
type: boolean
_types.GeoTilePrecision:
type: number
_types.analysis.CompoundWordTokenFilterBase:
allOf:
- $ref: '#/components/schemas/_types.analysis.TokenFilterBase'
- type: object
properties:
max_subword_size:
description: Maximum subword character length. Longer subword tokens are excluded from the output. Defaults to `15`.
type: number
min_subword_size:
description: Minimum subword character length. Shorter subword tokens are excluded from the output. Defaults to `2`.
type: number
min_word_size:
description: Minimum word character length. Shorter word tokens are excluded from the output. Defaults to `5`.
type: number
only_longest_match:
description: If `true`, only include the longest matching subword. Defaults to `false`.
type: boolean
word_list:
description: 'A list of subwords to look for in the token stream. If found, the subword is included in the token output.
Either this parameter or `word_list_path` must be specified.'
type: array
items:
type: string
word_list_path:
description: 'Path to a file that contains a list of subwords to find in the token stream. If found, the subword is included in the token output.
This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break.
Either this parameter or `word_list` must be specified.'
type: string
_types.aggregations.DateRangeAggregation:
allOf:
- $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase'
- type: object
properties:
field:
description: The date field whose values are use to build ranges.
allOf:
- $ref: '#/components/schemas/_types.Field'
format:
description: The date format used to format `from` and `to` in the response.
type: string
missing:
description: 'The value to apply to documents that do not have a value.
By default, documents without a value are ignored.'
allOf:
- $ref: '#/components/schemas/_types.aggregations.Missing'
ranges:
description: Array of date ranges.
type: array
items:
$ref: '#/components/schemas/_types.aggregations.DateRangeExpression'
time_zone:
description: Time zone used to convert dates from another time zone to UTC.
allOf:
- $ref: '#/components/schemas/_types.TimeZone'
keyed:
description: Set to `true` to associate a unique string key with each bucket and returns the ranges as a hash rather than an array.
type: boolean
_types.aggregations.StringStatsAggregation:
allOf:
- $ref: '#/components/schemas/_types.aggregations.MetricAggregationBase'
- type: object
properties:
show_distribution:
description: Shows the probability distribution for all characters.
default: false
type: boolean
_types.aggregations.TTestType:
type: string
enum:
- paired
- homoscedastic
- heteroscedastic
_types.TextSimilarityReranker:
allOf:
- $ref: '#/components/schemas/_types.RetrieverBase'
- type: object
properties:
retriever:
description: The nested retriever which will produce the first-level results, that will later be used for reranking.
allOf:
- $ref: '#/components/schemas/_types.RetrieverContainer'
rank_window_size:
description: This value determines how many documents we will consider from the nested retriever.
type: number
inference_id:
description: Unique identifier of the inference endpoint created using the inference API.
type: string
inference_text:
description: The text snippet used as the basis for similarity comparison.
type: string
field:
description: The document field to be used for text similarity comparisons. This field should contain the text that will be evaluated against the inference_text.
type: string
chunk_rescorer:
description: Whether to rescore on only the best matching chunks.
x-state: Generally available; Added in 9.2.0
allOf:
- $ref: '#/components/schemas/_types.ChunkRescorer'
required:
- retriever
- inference_text
- field
_types.aggregations.ParentAggregation:
allOf:
- $ref: '#/components/schemas/_types.aggregations.BucketAggregationBase'
- type: object
properties:
type:
description: The child type that should be selected.
allOf:
- $ref: '#/components/schemas/_types.RelationName'
_types.aggregations.MaxBucketAggregation:
allOf:
- $ref: '#/components/schemas/_types.aggregations.PipelineAggregationBase'
- type: object
_global.search._types.FieldCollapse:
type: object
properties:
field:
description: The field to collapse the result set on
allOf:
- $ref: '#/components/schemas/_types.Field'
inner_hits:
description: The number of inner hits and their sort order
oneOf:
- $ref: '#/components/schemas/_global.search._types.InnerHits'
- type: array
items:
$ref: '#/components/schemas/_global.search._types.InnerHits'
max_concurrent_group_searches:
description: The number of concurrent requests allowed to retrieve the inner_hits per group
type: number
collapse:
allOf:
- $ref: '#/components/schemas/_global.search._types.FieldCollapse'
required:
- field
_types.DateTime:
description: 'A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a
number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string
representation.'
oneOf:
- type: string
- $ref: '#/components/schemas/_types.EpochTimeUnitMillis'
_types.query_dsl.RangeQueryBase:
allOf:
- $ref: '#/components/schemas/_types.query_dsl.QueryBase'
- type: object
properties:
relation:
description: Indicates how the range query matches values for `range` fields.
default: intersects
allOf:
- $ref: '#/components/schemas/_types.query_dsl.RangeRelation'
gt:
description
# --- truncated at 32 KB (430 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/elk-stack/refs/heads/main/openapi/elk-stack-ml-api-openapi.yml