Kibana Internal API's via Python Request

Is it possible to interact with Kibana's internal API's via Python? Do I need to add something to the header of the request besides {'kbn-xsrf': 'true'}

My specific use case is to be able to assign ML jobs to a specific space in Kibana:

POST /internal/ml/saved_objects/update_jobs_spaces

{
"jobIds": ["my_job"],
"jobType": "anomaly-detector",
"spacesToAdd":["test"],
"spacesToRemove":[]
}

This works perfectly from Dev Tools, but I need to run via GitLab CICD.

Hello @6igwig

I believe via python we need to follow below documentation :

Thanks!!

Thanks Tortoise, but I don’t see any documentation related to internal API’s or setting/updating the space that a job is synced to.

1 Like

Hello @6igwig

I see below enhancement request open on git :

Thanks!!

Thanks Tortoise, I’m aware of that issue and looking forward to it in v9.3 (mid January 2026). In the mean time, my question was about using Kibana’s internal API’s via Python.

1 Like

From the discussion on the issue, I'm not sure you can.

This API is considered internal, so there is no public documentation on how it works.

My suggestion would be to ask on the Github Issue what is the workaround to use this API until it is made public so the devs may provide more insight.

Ok, thanks Leandro!