> For the complete documentation index, see [llms.txt](https://docs.mediarithmics.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mediarithmics.io/api-reference/machine-learning/ml-algorithms.md).

# ML Algorithms

Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions.

## POST /ml\_algorithms/{ml\_algorithm\_id}/models/{ml\_algorithm\_model\_id}/docker\_image

> Set docker image name

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}/models/{ml_algorithm_model_id}/docker_image":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"docker_image_name":{"type":"string"}},"required":["docker_image_name"]}}}},"operationId":"setMlAlgorithmModelDockerImageName","summary":"Set docker image name","description":"","parameters":[{"explode":false,"name":"ml_algorithm_id","schema":{"type":"integer","format":"int64"},"required":true,"in":"path","style":"simple"},{"name":"ml_algorithm_model_id","required":true,"in":"path","schema":{"type":"integer","format":"int64"},"explode":false,"style":"simple"}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/MlAlgorithmModelResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"tags":["ML Algorithms"]}}},"components":{"schemas":{"MlAlgorithmModelResource":{"type":"object","properties":{"name":{"type":"string","readOnly":false},"docker_image_name":{"type":"string","readOnly":false},"binary_uri":{"type":"string","readOnly":false},"notebook_uri":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"ml_algorithm_id":{"type":"string","readOnly":false},"html_notebook_result_uri":{"type":"string","readOnly":false},"last_updated_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"status":{"$ref":"#/components/schemas/MlAlgorithmModelStatus"}},"required":["binary_uri","docker_image_name","html_notebook_result_uri","id","last_updated_date","ml_algorithm_id","name","notebook_uri","status"]},"MlAlgorithmModelStatus":{"type":"string","enum":["PAUSED","LIVE"],"readOnly":false},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## GET /ml\_algorithms/{ml\_algorithm\_id}/variables

> Search Ml Algorithm variables

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}/variables":{"get":{"operationId":"findMlAlgorithmVariables","tags":["ML Algorithms"],"parameters":[{"in":"path","name":"ml_algorithm_id","style":"simple","explode":false,"schema":{"type":"integer","format":"int64"},"required":true},{"name":"first_result","explode":true,"schema":{"type":"integer","format":"int32"},"in":"query","style":"form","description":"Offset from which the search must be performed","required":false},{"style":"form","name":"max_results","schema":{"type":"integer","format":"int32"},"explode":true,"description":"Number of maximum items that shall be return by this search","required":false,"in":"query"},{"schema":{"type":"string"},"style":"form","required":false,"name":"keywords","in":"query","explode":true,"description":"The keywords to match with ml algorithmics names"}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"first_result":{"type":"integer"},"count":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/MlAlgorithmVariableResource"}},"max_results":{"type":"integer"},"total":{"type":"integer"}},"required":["count","data","first_result","max_results","status","total"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"summary":"Search Ml Algorithm variables","description":""}}},"components":{"schemas":{"MlAlgorithmVariableResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"ml_algorithm_id":{"type":"string","readOnly":false},"key":{"type":"string","readOnly":false},"value":{"type":"string","readOnly":false}},"required":["id","key","ml_algorithm_id","value"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /ml\_algorithms/{ml\_algorithm\_id}/variables

> Create Ml Algorithm Variable

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}/variables":{"post":{"requestBody":{"description":"The ML Algorithm Variable to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MlAlgorithmVariableResource"}}},"required":true},"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/MlAlgorithmVariableResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"summary":"Create Ml Algorithm Variable","tags":["ML Algorithms"],"operationId":"createMlAlgorithmVariable","description":"","parameters":[{"explode":false,"in":"path","name":"ml_algorithm_id","style":"simple","required":true,"schema":{"type":"integer","format":"int64"}}]}}},"components":{"schemas":{"MlAlgorithmVariableResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"ml_algorithm_id":{"type":"string","readOnly":false},"key":{"type":"string","readOnly":false},"value":{"type":"string","readOnly":false}},"required":["id","key","ml_algorithm_id","value"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## GET /ml\_algorithms/{ml\_algorithm\_id}/learning\_jobs

> Returns all learning jobs for a given ML Algorithm

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}/learning_jobs":{"get":{"parameters":[{"style":"simple","schema":{"type":"integer","format":"int64"},"name":"ml_algorithm_id","in":"path","required":true,"explode":false},{"in":"query","explode":true,"style":"form","required":false,"name":"job_status","schema":{"$ref":"#/components/schemas/JobExecutionPublicStatus"}}],"tags":["ML Algorithms"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ImmutableExecutionResource"}},"total":{"type":"integer"},"first_result":{"type":"integer"},"status":{"type":"string","enum":["ok"]},"max_results":{"type":"integer"}},"required":["count","data","first_result","max_results","status","total"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"summary":"Returns all learning jobs for a given ML Algorithm","description":"","operationId":"findMlModelLearningJobs"}}},"components":{"schemas":{"JobExecutionPublicStatus":{"type":"string","enum":["PENDING","RUNNING","SUCCEEDED","FAILED","CANCELED"],"readOnly":false},"ImmutableExecutionResource":{"allOf":[{"$ref":"#/components/schemas/NewReadOnlyPublicJobExecutionResource"},{"type":"object","properties":{"completed_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"num_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"job_type":{"type":"string","readOnly":false},"erroneous_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"id":{"type":"string","readOnly":false},"user_id":{"type":"string","readOnly":false},"debug":{"type":"string","readOnly":false},"max_retry_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"start_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"retry_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"organisation_id":{"type":"string","readOnly":false},"permalink_uri":{"type":"string","readOnly":false},"external_name":{"type":"string","readOnly":false},"last_update":{"type":"integer","format":"int64","default":0,"readOnly":false},"is_retryable":{"type":"boolean","default":false,"readOnly":false},"parameters":{"type":"string","readOnly":false},"creation_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"error":{"$ref":"#/components/schemas/JobExecutionErrorResource"},"cancel_status":{"$ref":"#/components/schemas/CancelStatus"},"status":{"$ref":"#/components/schemas/JobExecutionPublicStatus"},"community_id":{"type":"string","readOnly":true},"duration":{"$ref":"#/components/schemas/Duration"},"result":{"type":"string","readOnly":false}},"required":["creation_date","id","is_retryable","job_type","permalink_uri","retry_count","status"]}]},"NewReadOnlyPublicJobExecutionResource":{"type":"object"},"JobExecutionErrorResource":{"type":"object","properties":{"message":{"type":"string","readOnly":false}},"required":["message"]},"CancelStatus":{"type":"string","enum":["REQUESTED","IN_PROGRESS","CANCELED","ABORTED"],"readOnly":false},"Duration":{"type":"number","description":"a length of time in milliseconds"},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /ml\_algorithms/{ml\_algorithm\_id}/learning\_jobs

> Starts an ML Model Learning job

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}/learning_jobs":{"post":{"parameters":[{"required":true,"explode":false,"schema":{"type":"integer","format":"int64"},"in":"path","style":"simple","name":"ml_algorithm_id"}],"description":"","requestBody":{"description":"Input parameters for learning job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MlModelLearningJobCreationResource"}}},"required":true},"tags":["ML Algorithms"],"summary":"Starts an ML Model Learning job","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/ImmutableExecutionResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"operationId":"startMlModelLearningJob"}}},"components":{"schemas":{"MlModelLearningJobCreationResource":{"type":"object","properties":{"export_id":{"readOnly":false,"default":0,"type":"integer","format":"int64"},"vars":{"type":"array","items":{"$ref":"#/components/schemas/MlAlgorithmPropertyResource"},"readOnly":false}},"required":["export_id"]},"MlAlgorithmPropertyResource":{"type":"object","properties":{"key":{"type":"string","readOnly":false},"value":{"type":"string","readOnly":false}},"required":["key","value"]},"ImmutableExecutionResource":{"allOf":[{"$ref":"#/components/schemas/NewReadOnlyPublicJobExecutionResource"},{"type":"object","properties":{"completed_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"num_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"job_type":{"type":"string","readOnly":false},"erroneous_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"id":{"type":"string","readOnly":false},"user_id":{"type":"string","readOnly":false},"debug":{"type":"string","readOnly":false},"max_retry_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"start_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"retry_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"organisation_id":{"type":"string","readOnly":false},"permalink_uri":{"type":"string","readOnly":false},"external_name":{"type":"string","readOnly":false},"last_update":{"type":"integer","format":"int64","default":0,"readOnly":false},"is_retryable":{"type":"boolean","default":false,"readOnly":false},"parameters":{"type":"string","readOnly":false},"creation_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"error":{"$ref":"#/components/schemas/JobExecutionErrorResource"},"cancel_status":{"$ref":"#/components/schemas/CancelStatus"},"status":{"$ref":"#/components/schemas/JobExecutionPublicStatus"},"community_id":{"type":"string","readOnly":true},"duration":{"$ref":"#/components/schemas/Duration"},"result":{"type":"string","readOnly":false}},"required":["creation_date","id","is_retryable","job_type","permalink_uri","retry_count","status"]}]},"NewReadOnlyPublicJobExecutionResource":{"type":"object"},"JobExecutionErrorResource":{"type":"object","properties":{"message":{"type":"string","readOnly":false}},"required":["message"]},"CancelStatus":{"type":"string","enum":["REQUESTED","IN_PROGRESS","CANCELED","ABORTED"],"readOnly":false},"JobExecutionPublicStatus":{"type":"string","enum":["PENDING","RUNNING","SUCCEEDED","FAILED","CANCELED"],"readOnly":false},"Duration":{"type":"number","description":"a length of time in milliseconds"},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## GET /ml\_algorithms/{ml\_algorithm\_id}/variables/{ml\_algorithm\_variable\_id}

> Get ML Algorithm Variable by id

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}/variables/{ml_algorithm_variable_id}":{"get":{"description":"","summary":"Get ML Algorithm Variable by id","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/MlAlgorithmVariableResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"tags":["ML Algorithms"],"operationId":"getMlAlgorithmVariable","parameters":[{"required":true,"in":"path","name":"ml_algorithm_id","style":"simple","explode":false,"schema":{"type":"integer","format":"int64"}},{"required":true,"style":"simple","name":"ml_algorithm_variable_id","explode":false,"schema":{"type":"integer","format":"int64"},"in":"path"}]}}},"components":{"schemas":{"MlAlgorithmVariableResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"ml_algorithm_id":{"type":"string","readOnly":false},"key":{"type":"string","readOnly":false},"value":{"type":"string","readOnly":false}},"required":["id","key","ml_algorithm_id","value"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## PUT /ml\_algorithms/{ml\_algorithm\_id}/variables/{ml\_algorithm\_variable\_id}

> Update ML Algorithm Variable

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}/variables/{ml_algorithm_variable_id}":{"put":{"summary":"Update ML Algorithm Variable","description":"","parameters":[{"in":"path","explode":false,"schema":{"type":"integer","format":"int64"},"name":"ml_algorithm_id","required":true,"style":"simple"},{"required":true,"style":"simple","name":"ml_algorithm_variable_id","explode":false,"schema":{"type":"integer","format":"int64"},"in":"path"}],"tags":["ML Algorithms"],"operationId":"updateMlAlgorithmVariable","requestBody":{"description":"The ML Algorithm Variable to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MlAlgorithmVariableResource"}}},"required":true},"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/MlAlgorithmVariableResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}}}}},"components":{"schemas":{"MlAlgorithmVariableResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"ml_algorithm_id":{"type":"string","readOnly":false},"key":{"type":"string","readOnly":false},"value":{"type":"string","readOnly":false}},"required":["id","key","ml_algorithm_id","value"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## DELETE /ml\_algorithms/{ml\_algorithm\_id}/variables/{ml\_algorithm\_variable\_id}

> Delete ML Algorithm Variable

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}/variables/{ml_algorithm_variable_id}":{"delete":{"responses":{"200":{"$ref":"#/components/responses/simple"},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"operationId":"deleteMlAlgorithmVariable","summary":"Delete ML Algorithm Variable","tags":["ML Algorithms"],"description":"","parameters":[{"style":"simple","explode":false,"required":true,"schema":{"type":"integer","format":"int64"},"in":"path","name":"ml_algorithm_id"},{"style":"simple","explode":false,"in":"path","name":"ml_algorithm_variable_id","required":true,"schema":{"type":"integer","format":"int64"}}]}}},"components":{"responses":{"simple":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]}},"required":["status"]}}}},"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}},"schemas":{"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}}}}
```

## POST /ml\_algorithms/{ml\_algorithm\_id}/code/notebook

> Update notebook for an ML Algorithm Code

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}/code/notebook":{"post":{"parameters":[{"schema":{"type":"integer","format":"int64"},"style":"simple","in":"path","explode":false,"required":true,"name":"ml_algorithm_id"}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/MlAlgorithmResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"summary":"Update notebook for an ML Algorithm Code","tags":["ML Algorithms"],"operationId":"uploadMlAlgorithmCodeNotebook","description":"","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"type":"array","items":{"type":"string","format":"binary"}}}}}}}}}},"components":{"schemas":{"MlAlgorithmResource":{"type":"object","properties":{"organisation_id":{"type":"string","readOnly":false},"archived":{"type":"boolean","default":false,"readOnly":false},"last_updated_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"name":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"ml_algorithm_code":{"$ref":"#/components/schemas/MlAlgorithmCodeResource"},"description":{"type":"string","readOnly":false}},"required":["archived","description","id","last_updated_date","name","organisation_id"]},"MlAlgorithmCodeResource":{"type":"object","properties":{"notebook_uri":{"type":"string","readOnly":false},"docker_image_name":{"type":"string","readOnly":false},"last_updated_date":{"type":"integer","format":"int64","default":0,"readOnly":false}},"required":["docker_image_name","last_updated_date","notebook_uri"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## GET /ml\_algorithms/{ml\_algorithm\_id}/learning\_jobs/{learning\_job\_id}

> Returns informations related to a particular ML Model learning job

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}/learning_jobs/{learning_job_id}":{"get":{"parameters":[{"required":true,"name":"ml_algorithm_id","schema":{"type":"integer","format":"int64"},"explode":false,"style":"simple","in":"path"},{"schema":{"type":"integer","format":"int64"},"explode":false,"in":"path","name":"learning_job_id","required":true,"style":"simple"}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/ImmutableExecutionResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"tags":["ML Algorithms"],"summary":"Returns informations related to a particular ML Model learning job","description":"","operationId":"getMlModelLearningJob"}}},"components":{"schemas":{"ImmutableExecutionResource":{"allOf":[{"$ref":"#/components/schemas/NewReadOnlyPublicJobExecutionResource"},{"type":"object","properties":{"completed_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"num_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"job_type":{"type":"string","readOnly":false},"erroneous_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"id":{"type":"string","readOnly":false},"user_id":{"type":"string","readOnly":false},"debug":{"type":"string","readOnly":false},"max_retry_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"start_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"retry_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"organisation_id":{"type":"string","readOnly":false},"permalink_uri":{"type":"string","readOnly":false},"external_name":{"type":"string","readOnly":false},"last_update":{"type":"integer","format":"int64","default":0,"readOnly":false},"is_retryable":{"type":"boolean","default":false,"readOnly":false},"parameters":{"type":"string","readOnly":false},"creation_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"error":{"$ref":"#/components/schemas/JobExecutionErrorResource"},"cancel_status":{"$ref":"#/components/schemas/CancelStatus"},"status":{"$ref":"#/components/schemas/JobExecutionPublicStatus"},"community_id":{"type":"string","readOnly":true},"duration":{"$ref":"#/components/schemas/Duration"},"result":{"type":"string","readOnly":false}},"required":["creation_date","id","is_retryable","job_type","permalink_uri","retry_count","status"]}]},"NewReadOnlyPublicJobExecutionResource":{"type":"object"},"JobExecutionErrorResource":{"type":"object","properties":{"message":{"type":"string","readOnly":false}},"required":["message"]},"CancelStatus":{"type":"string","enum":["REQUESTED","IN_PROGRESS","CANCELED","ABORTED"],"readOnly":false},"JobExecutionPublicStatus":{"type":"string","enum":["PENDING","RUNNING","SUCCEEDED","FAILED","CANCELED"],"readOnly":false},"Duration":{"type":"number","description":"a length of time in milliseconds"},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## GET /ml\_algorithms/{ml\_algorithm\_id}/models

> Search ML Algorithm Models

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}/models":{"get":{"operationId":"findMlAlgorithmModels","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"first_result":{"type":"integer"},"status":{"type":"string","enum":["ok"]},"max_results":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/MlAlgorithmModelResource"}},"count":{"type":"integer"}},"required":["count","data","first_result","max_results","status","total"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"parameters":[{"required":true,"schema":{"type":"integer","format":"int64"},"style":"simple","name":"ml_algorithm_id","in":"path","explode":false},{"style":"form","in":"query","schema":{"type":"integer","format":"int32"},"required":false,"explode":true,"description":"Offset from which the search must be performed","name":"first_result"},{"name":"max_results","explode":true,"schema":{"type":"integer","format":"int32"},"required":false,"description":"Number of maximum items that shall be return by this search","in":"query","style":"form"},{"explode":true,"description":"Fields used to order the result","name":"order_by","required":false,"in":"query","style":"form","schema":{"type":"array","items":{"type":"string"}}},{"description":"The keywords to match with ml algorithmics names","in":"query","schema":{"type":"string"},"style":"form","name":"keywords","explode":true,"required":false},{"description":"The status of the ml algorithm model (LIVE / PAUSED)","required":false,"explode":true,"in":"query","style":"form","name":"status","schema":{"$ref":"#/components/schemas/MlAlgorithmModelStatus"}}],"tags":["ML Algorithms"],"description":"","summary":"Search ML Algorithm Models"}}},"components":{"schemas":{"MlAlgorithmModelResource":{"type":"object","properties":{"name":{"type":"string","readOnly":false},"docker_image_name":{"type":"string","readOnly":false},"binary_uri":{"type":"string","readOnly":false},"notebook_uri":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"ml_algorithm_id":{"type":"string","readOnly":false},"html_notebook_result_uri":{"type":"string","readOnly":false},"last_updated_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"status":{"$ref":"#/components/schemas/MlAlgorithmModelStatus"}},"required":["binary_uri","docker_image_name","html_notebook_result_uri","id","last_updated_date","ml_algorithm_id","name","notebook_uri","status"]},"MlAlgorithmModelStatus":{"type":"string","enum":["PAUSED","LIVE"],"readOnly":false},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /ml\_algorithms/{ml\_algorithm\_id}/models

> Create ML Algorithm Model

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}/models":{"post":{"summary":"Create ML Algorithm Model","requestBody":{"description":"The ML Model to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MlAlgorithmModelResource"}}},"required":true},"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/MlAlgorithmModelResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"operationId":"createMlAlgorithmModel","parameters":[{"schema":{"type":"integer","format":"int64"},"name":"ml_algorithm_id","in":"path","style":"simple","explode":false,"required":true}],"tags":["ML Algorithms"],"description":""}}},"components":{"schemas":{"MlAlgorithmModelResource":{"type":"object","properties":{"name":{"type":"string","readOnly":false},"docker_image_name":{"type":"string","readOnly":false},"binary_uri":{"type":"string","readOnly":false},"notebook_uri":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"ml_algorithm_id":{"type":"string","readOnly":false},"html_notebook_result_uri":{"type":"string","readOnly":false},"last_updated_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"status":{"$ref":"#/components/schemas/MlAlgorithmModelStatus"}},"required":["binary_uri","docker_image_name","html_notebook_result_uri","id","last_updated_date","ml_algorithm_id","name","notebook_uri","status"]},"MlAlgorithmModelStatus":{"type":"string","enum":["PAUSED","LIVE"],"readOnly":false},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /ml\_algorithms/{ml\_algorithm\_id}/models/{ml\_algorithm\_model\_id}/result

> Post a result file

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}/models/{ml_algorithm_model_id}/result":{"post":{"operationId":"uploadMlAlgorithmModelResult","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"type":"array","items":{"type":"string","format":"binary"}}}}}}},"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/MlAlgorithmModelResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"tags":["ML Algorithms"],"description":"","summary":"Post a result file","parameters":[{"schema":{"type":"integer","format":"int64"},"name":"ml_algorithm_id","explode":false,"in":"path","style":"simple","required":true},{"in":"path","name":"ml_algorithm_model_id","style":"simple","required":true,"schema":{"type":"integer","format":"int64"},"explode":false}]}}},"components":{"schemas":{"MlAlgorithmModelResource":{"type":"object","properties":{"name":{"type":"string","readOnly":false},"docker_image_name":{"type":"string","readOnly":false},"binary_uri":{"type":"string","readOnly":false},"notebook_uri":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"ml_algorithm_id":{"type":"string","readOnly":false},"html_notebook_result_uri":{"type":"string","readOnly":false},"last_updated_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"status":{"$ref":"#/components/schemas/MlAlgorithmModelStatus"}},"required":["binary_uri","docker_image_name","html_notebook_result_uri","id","last_updated_date","ml_algorithm_id","name","notebook_uri","status"]},"MlAlgorithmModelStatus":{"type":"string","enum":["PAUSED","LIVE"],"readOnly":false},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /ml\_algorithms/{ml\_algorithm\_id}/code/docker\_image

> Update docker image for an ML Algorithm Code

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}/code/docker_image":{"post":{"parameters":[{"required":true,"schema":{"type":"integer","format":"int64"},"name":"ml_algorithm_id","in":"path","style":"simple","explode":false}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/MlAlgorithmResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"tags":["ML Algorithms"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"docker_image_name":{"type":"string"}},"required":["docker_image_name"]}}}},"operationId":"setMlAlgorithmCodeDockerImage","summary":"Update docker image for an ML Algorithm Code","description":""}}},"components":{"schemas":{"MlAlgorithmResource":{"type":"object","properties":{"organisation_id":{"type":"string","readOnly":false},"archived":{"type":"boolean","default":false,"readOnly":false},"last_updated_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"name":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"ml_algorithm_code":{"$ref":"#/components/schemas/MlAlgorithmCodeResource"},"description":{"type":"string","readOnly":false}},"required":["archived","description","id","last_updated_date","name","organisation_id"]},"MlAlgorithmCodeResource":{"type":"object","properties":{"notebook_uri":{"type":"string","readOnly":false},"docker_image_name":{"type":"string","readOnly":false},"last_updated_date":{"type":"integer","format":"int64","default":0,"readOnly":false}},"required":["docker_image_name","last_updated_date","notebook_uri"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## GET /ml\_algorithms

> Search ML Algorithms

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms":{"get":{"operationId":"findMlAlgorithms","parameters":[{"description":"Organisation Id of the ml algorithm","in":"query","name":"organisation_id","required":true,"style":"form","explode":true,"schema":{"type":"integer","format":"int64"}},{"schema":{"type":"integer","format":"int32"},"description":"Offset from which the search must be performed","name":"first_result","in":"query","style":"form","required":false,"explode":true},{"name":"max_results","schema":{"type":"integer","format":"int32"},"explode":true,"description":"Number of maximum items that shall be return by this search","required":false,"in":"query","style":"form"},{"in":"query","explode":true,"name":"order_by","schema":{"type":"array","items":{"type":"string"}},"style":"form","description":"Fields used to order the result","required":false},{"schema":{"type":"string"},"required":false,"name":"keywords","explode":true,"style":"form","in":"query","description":"The keywords to match with ml algorithmics names"},{"required":false,"name":"archived","schema":{"type":"boolean"},"description":"Whether to filter with archived or not","explode":true,"in":"query","style":"form"}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MlAlgorithmResource"}},"status":{"type":"string","enum":["ok"]},"count":{"type":"integer"},"max_results":{"type":"integer"},"total":{"type":"integer"},"first_result":{"type":"integer"}},"required":["count","data","first_result","max_results","status","total"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"summary":"Search ML Algorithms","tags":["ML Algorithms"],"description":""}}},"components":{"schemas":{"MlAlgorithmResource":{"type":"object","properties":{"organisation_id":{"type":"string","readOnly":false},"archived":{"type":"boolean","default":false,"readOnly":false},"last_updated_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"name":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"ml_algorithm_code":{"$ref":"#/components/schemas/MlAlgorithmCodeResource"},"description":{"type":"string","readOnly":false}},"required":["archived","description","id","last_updated_date","name","organisation_id"]},"MlAlgorithmCodeResource":{"type":"object","properties":{"notebook_uri":{"type":"string","readOnly":false},"docker_image_name":{"type":"string","readOnly":false},"last_updated_date":{"type":"integer","format":"int64","default":0,"readOnly":false}},"required":["docker_image_name","last_updated_date","notebook_uri"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /ml\_algorithms

> Create ML algorithm

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms":{"post":{"summary":"Create ML algorithm","operationId":"createMlAlgorithm","description":"","tags":["ML Algorithms"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/MlAlgorithmResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"requestBody":{"description":"The ML Algorithm to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MlAlgorithmResource"}}},"required":true}}}},"components":{"schemas":{"MlAlgorithmResource":{"type":"object","properties":{"organisation_id":{"type":"string","readOnly":false},"archived":{"type":"boolean","default":false,"readOnly":false},"last_updated_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"name":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"ml_algorithm_code":{"$ref":"#/components/schemas/MlAlgorithmCodeResource"},"description":{"type":"string","readOnly":false}},"required":["archived","description","id","last_updated_date","name","organisation_id"]},"MlAlgorithmCodeResource":{"type":"object","properties":{"notebook_uri":{"type":"string","readOnly":false},"docker_image_name":{"type":"string","readOnly":false},"last_updated_date":{"type":"integer","format":"int64","default":0,"readOnly":false}},"required":["docker_image_name","last_updated_date","notebook_uri"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /ml\_algorithms/{ml\_algorithm\_id}/models/{ml\_algorithm\_model\_id}/binary

> Post a model file

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}/models/{ml_algorithm_model_id}/binary":{"post":{"operationId":"uploadMlAlgorithmModelBinary","description":"","tags":["ML Algorithms"],"summary":"Post a model file","parameters":[{"explode":false,"in":"path","required":true,"style":"simple","name":"ml_algorithm_id","schema":{"type":"integer","format":"int64"}},{"name":"ml_algorithm_model_id","required":true,"schema":{"type":"integer","format":"int64"},"in":"path","style":"simple","explode":false}],"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"type":"array","items":{"type":"string","format":"binary"}}}}}}},"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/MlAlgorithmModelResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}}}}},"components":{"schemas":{"MlAlgorithmModelResource":{"type":"object","properties":{"name":{"type":"string","readOnly":false},"docker_image_name":{"type":"string","readOnly":false},"binary_uri":{"type":"string","readOnly":false},"notebook_uri":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"ml_algorithm_id":{"type":"string","readOnly":false},"html_notebook_result_uri":{"type":"string","readOnly":false},"last_updated_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"status":{"$ref":"#/components/schemas/MlAlgorithmModelStatus"}},"required":["binary_uri","docker_image_name","html_notebook_result_uri","id","last_updated_date","ml_algorithm_id","name","notebook_uri","status"]},"MlAlgorithmModelStatus":{"type":"string","enum":["PAUSED","LIVE"],"readOnly":false},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /ml\_algorithms/{ml\_algorithm\_id}/models/{ml\_algorithm\_model\_id}/notebook

> Post a the .ipynb file

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}/models/{ml_algorithm_model_id}/notebook":{"post":{"tags":["ML Algorithms"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/MlAlgorithmModelResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"operationId":"uploadMlAlgorithmModelNotebook","parameters":[{"name":"ml_algorithm_id","in":"path","schema":{"type":"integer","format":"int64"},"explode":false,"required":true,"style":"simple"},{"style":"simple","name":"ml_algorithm_model_id","schema":{"type":"integer","format":"int64"},"explode":false,"required":true,"in":"path"}],"description":"","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"type":"array","items":{"type":"string","format":"binary"}}}}}}},"summary":"Post a the .ipynb file"}}},"components":{"schemas":{"MlAlgorithmModelResource":{"type":"object","properties":{"name":{"type":"string","readOnly":false},"docker_image_name":{"type":"string","readOnly":false},"binary_uri":{"type":"string","readOnly":false},"notebook_uri":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"ml_algorithm_id":{"type":"string","readOnly":false},"html_notebook_result_uri":{"type":"string","readOnly":false},"last_updated_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"status":{"$ref":"#/components/schemas/MlAlgorithmModelStatus"}},"required":["binary_uri","docker_image_name","html_notebook_result_uri","id","last_updated_date","ml_algorithm_id","name","notebook_uri","status"]},"MlAlgorithmModelStatus":{"type":"string","enum":["PAUSED","LIVE"],"readOnly":false},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## GET /ml\_algorithms/{ml\_algorithm\_id}

> Get ML Algorithm by id

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}":{"get":{"description":"","parameters":[{"style":"simple","required":true,"schema":{"type":"integer","format":"int64"},"explode":false,"name":"ml_algorithm_id","in":"path"}],"summary":"Get ML Algorithm by id","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/MlAlgorithmResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"operationId":"getMlAlgorithm","tags":["ML Algorithms"]}}},"components":{"schemas":{"MlAlgorithmResource":{"type":"object","properties":{"organisation_id":{"type":"string","readOnly":false},"archived":{"type":"boolean","default":false,"readOnly":false},"last_updated_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"name":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"ml_algorithm_code":{"$ref":"#/components/schemas/MlAlgorithmCodeResource"},"description":{"type":"string","readOnly":false}},"required":["archived","description","id","last_updated_date","name","organisation_id"]},"MlAlgorithmCodeResource":{"type":"object","properties":{"notebook_uri":{"type":"string","readOnly":false},"docker_image_name":{"type":"string","readOnly":false},"last_updated_date":{"type":"integer","format":"int64","default":0,"readOnly":false}},"required":["docker_image_name","last_updated_date","notebook_uri"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## PUT /ml\_algorithms/{ml\_algorithm\_id}

> Update ML Algorithm

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}":{"put":{"summary":"Update ML Algorithm","parameters":[{"explode":false,"style":"simple","required":true,"in":"path","name":"ml_algorithm_id","schema":{"type":"integer","format":"int64"}}],"operationId":"updateMlAlgorithm","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/MlAlgorithmResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"description":"","tags":["ML Algorithms"],"requestBody":{"description":"The ML Algorithm to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MlAlgorithmResource"}}},"required":true}}}},"components":{"schemas":{"MlAlgorithmResource":{"type":"object","properties":{"organisation_id":{"type":"string","readOnly":false},"archived":{"type":"boolean","default":false,"readOnly":false},"last_updated_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"name":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"ml_algorithm_code":{"$ref":"#/components/schemas/MlAlgorithmCodeResource"},"description":{"type":"string","readOnly":false}},"required":["archived","description","id","last_updated_date","name","organisation_id"]},"MlAlgorithmCodeResource":{"type":"object","properties":{"notebook_uri":{"type":"string","readOnly":false},"docker_image_name":{"type":"string","readOnly":false},"last_updated_date":{"type":"integer","format":"int64","default":0,"readOnly":false}},"required":["docker_image_name","last_updated_date","notebook_uri"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## DELETE /ml\_algorithms/{ml\_algorithm\_id}

> Delete ML Algorithm

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}":{"delete":{"description":"","parameters":[{"schema":{"type":"integer","format":"int64"},"style":"simple","explode":false,"required":true,"name":"ml_algorithm_id","in":"path"}],"tags":["ML Algorithms"],"operationId":"deleteMlAlgorithm","summary":"Delete ML Algorithm","responses":{"200":{"$ref":"#/components/responses/simple"},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}}}}},"components":{"responses":{"simple":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]}},"required":["status"]}}}},"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}},"schemas":{"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}}}}
```

## GET /ml\_algorithms/{ml\_algorithm\_id}/models/{ml\_algorithm\_model\_id}

> Get ML Algorithm Model by id

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}/models/{ml_algorithm_model_id}":{"get":{"tags":["ML Algorithms"],"parameters":[{"schema":{"type":"integer","format":"int64"},"explode":false,"name":"ml_algorithm_id","in":"path","style":"simple","required":true},{"in":"path","required":true,"style":"simple","schema":{"type":"integer","format":"int64"},"explode":false,"name":"ml_algorithm_model_id"}],"summary":"Get ML Algorithm Model by id","operationId":"getMlAlgorithmModel","description":"","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/MlAlgorithmModelResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}}}}},"components":{"schemas":{"MlAlgorithmModelResource":{"type":"object","properties":{"name":{"type":"string","readOnly":false},"docker_image_name":{"type":"string","readOnly":false},"binary_uri":{"type":"string","readOnly":false},"notebook_uri":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"ml_algorithm_id":{"type":"string","readOnly":false},"html_notebook_result_uri":{"type":"string","readOnly":false},"last_updated_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"status":{"$ref":"#/components/schemas/MlAlgorithmModelStatus"}},"required":["binary_uri","docker_image_name","html_notebook_result_uri","id","last_updated_date","ml_algorithm_id","name","notebook_uri","status"]},"MlAlgorithmModelStatus":{"type":"string","enum":["PAUSED","LIVE"],"readOnly":false},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## PUT /ml\_algorithms/{ml\_algorithm\_id}/models/{ml\_algorithm\_model\_id}

> Update ML Algorithm Model

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}/models/{ml_algorithm_model_id}":{"put":{"parameters":[{"name":"ml_algorithm_id","schema":{"type":"integer","format":"int64"},"explode":false,"style":"simple","in":"path","required":true},{"required":true,"in":"path","schema":{"type":"integer","format":"int64"},"style":"simple","explode":false,"name":"ml_algorithm_model_id"}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/MlAlgorithmModelResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"operationId":"updateMlAlgorithmModel","description":"","summary":"Update ML Algorithm Model","tags":["ML Algorithms"],"requestBody":{"description":"The ML Algorithm model to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MlAlgorithmModelResource"}}},"required":true}}}},"components":{"schemas":{"MlAlgorithmModelResource":{"type":"object","properties":{"name":{"type":"string","readOnly":false},"docker_image_name":{"type":"string","readOnly":false},"binary_uri":{"type":"string","readOnly":false},"notebook_uri":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":true},"ml_algorithm_id":{"type":"string","readOnly":false},"html_notebook_result_uri":{"type":"string","readOnly":false},"last_updated_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"status":{"$ref":"#/components/schemas/MlAlgorithmModelStatus"}},"required":["binary_uri","docker_image_name","html_notebook_result_uri","id","last_updated_date","ml_algorithm_id","name","notebook_uri","status"]},"MlAlgorithmModelStatus":{"type":"string","enum":["PAUSED","LIVE"],"readOnly":false},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## DELETE /ml\_algorithms/{ml\_algorithm\_id}/models/{ml\_algorithm\_model\_id}

> Delete ML Algorith model

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"ML Algorithms","description":"Operations related to Machine Learning Algorithms, the plugins that calculate predictions or scores for users based on events (e.g., propensity models, churn likelihood), working in conjunction with ML Functions."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/ml_algorithms/{ml_algorithm_id}/models/{ml_algorithm_model_id}":{"delete":{"tags":["ML Algorithms"],"description":"","summary":"Delete ML Algorith model","operationId":"deleteMlAlgorithmModel","responses":{"200":{"$ref":"#/components/responses/simple"},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"parameters":[{"name":"ml_algorithm_id","style":"simple","in":"path","required":true,"schema":{"type":"integer","format":"int64"},"explode":false},{"required":true,"schema":{"type":"integer","format":"int64"},"explode":false,"style":"simple","name":"ml_algorithm_model_id","in":"path"}]}}},"components":{"responses":{"simple":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]}},"required":["status"]}}}},"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}},"schemas":{"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mediarithmics.io/api-reference/machine-learning/ml-algorithms.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
