> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://mediakind.ferndocs.com/mkio/api/management/projects/update-metrics-endpoint-settings/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://mediakind.ferndocs.com/_mcp/server. # Update metrics endpoint settings PATCH https://app.mk.io/api/v1/projects/{project_name}/metricsEndpoint Content-Type: application/json See [our Grafana dashboard](https://grafana.com/grafana/dashboards/21657-mk-io-metrics-monitor/) documentation for details. Enable the metrics endpoint for this project by setting `spec.enabled` to `true`. RBAC Capability Required: `mkio.metrics.update` Reference: https://mediakind.ferndocs.com/mkio/api/management/projects/update-metrics-endpoint-settings ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Path parameters - `project_name` (string, required) ### Body (application/json) This endpoint expects a MetricsSchema. - `spec` (MetricsSpecSchema, required) — Specification. - `kind` (string, optional) — The kind of record. - `status` (MetricsStatusSchema, optional) — Status when spec.enabled is true. ## Response ### 200 OK - `spec` (MetricsSpecSchema, required) — Specification. - `kind` (string, optional) — The kind of record. - `status` (MetricsStatusSchema, optional) — Status when spec.enabled is true. ## Errors ### 400 Bad Request Error Bad Request - `error` (ErrorDetail, required) — Pertinent information about the error - `ref` (string, required) — A reference to the request that caused the error. - `status` (integer, required) — The HTTP status code ### 401 Unauthorized Error Unauthorized - `error` (ErrorDetail, required) — Pertinent information about the error - `ref` (string, required) — A reference to the request that caused the error. - `status` (integer, required) — The HTTP status code ### 403 Forbidden Error Forbidden - `error` (ErrorDetail, required) — Pertinent information about the error - `ref` (string, required) — A reference to the request that caused the error. - `status` (integer, required) — The HTTP status code ### 404 Not Found Error Not Found - `error` (ErrorDetail, required) — Pertinent information about the error - `ref` (string, required) — A reference to the request that caused the error. - `status` (integer, required) — The HTTP status code ### 429 Too Many Requests Error Too Many Requests - `error` (ErrorDetail, required) — Pertinent information about the error - `ref` (string, required) — A reference to the request that caused the error. - `status` (integer, required) — The HTTP status code ### 500 Internal Server Error Internal Server Error - `error` (ErrorDetail, required) — Pertinent information about the error - `ref` (string, required) — A reference to the request that caused the error. - `status` (integer, required) — The HTTP status code ## Types ### MetricsSpecSchema - `enabled` (boolean, required) — Is metrics enabled? ### MetricsStatusSchema - `password` (string, required) — Password for metrics. - `url` (string, required) — URL for metrics. - `username` (string, required) — Username for metrics. ### ErrorDetail - `code` (string, required) — The error code. - `detail` (string, required) — The error message. - `extraDetail` (map from string to any, optional) — Extra information regarding this error. ## Examples ### Enable metricsEndpoint **Request** ```json { "spec": { "enabled": true } } ``` **Response** ```json { "spec": { "enabled": true }, "kind": "string", "status": { "password": "string", "url": "string", "username": "string" } } ``` **SDK Code** ```python Enable metricsEndpoint import requests url = "https://app.mk.io/api/v1/projects/project_name/metricsEndpoint" payload = { "spec": { "enabled": True } } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.patch(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Enable metricsEndpoint const url = 'https://app.mk.io/api/v1/projects/project_name/metricsEndpoint'; const options = { method: 'PATCH', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"spec":{"enabled":true}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Enable metricsEndpoint package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://app.mk.io/api/v1/projects/project_name/metricsEndpoint" payload := strings.NewReader("{\n \"spec\": {\n \"enabled\": true\n }\n}") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Enable metricsEndpoint require 'uri' require 'net/http' url = URI("https://app.mk.io/api/v1/projects/project_name/metricsEndpoint") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Patch.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"spec\": {\n \"enabled\": true\n }\n}" response = http.request(request) puts response.read_body ``` ```java Enable metricsEndpoint import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://app.mk.io/api/v1/projects/project_name/metricsEndpoint") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"spec\": {\n \"enabled\": true\n }\n}") .asString(); ``` ```php Enable metricsEndpoint request('PATCH', 'https://app.mk.io/api/v1/projects/project_name/metricsEndpoint', [ 'body' => '{ "spec": { "enabled": true } }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Enable metricsEndpoint using RestSharp; var client = new RestClient("https://app.mk.io/api/v1/projects/project_name/metricsEndpoint"); var request = new RestRequest(Method.PATCH); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"spec\": {\n \"enabled\": true\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Enable metricsEndpoint import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["spec": ["enabled": true]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://app.mk.io/api/v1/projects/project_name/metricsEndpoint")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PATCH" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Disable metricsEndpoint **Request** ```json { "spec": { "enabled": false } } ``` **Response** ```json { "spec": { "enabled": true }, "kind": "string", "status": { "password": "string", "url": "string", "username": "string" } } ``` **SDK Code** ```python Disable metricsEndpoint import requests url = "https://app.mk.io/api/v1/projects/project_name/metricsEndpoint" payload = { "spec": { "enabled": False } } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.patch(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Disable metricsEndpoint const url = 'https://app.mk.io/api/v1/projects/project_name/metricsEndpoint'; const options = { method: 'PATCH', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"spec":{"enabled":false}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Disable metricsEndpoint package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://app.mk.io/api/v1/projects/project_name/metricsEndpoint" payload := strings.NewReader("{\n \"spec\": {\n \"enabled\": false\n }\n}") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Disable metricsEndpoint require 'uri' require 'net/http' url = URI("https://app.mk.io/api/v1/projects/project_name/metricsEndpoint") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Patch.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"spec\": {\n \"enabled\": false\n }\n}" response = http.request(request) puts response.read_body ``` ```java Disable metricsEndpoint import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://app.mk.io/api/v1/projects/project_name/metricsEndpoint") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"spec\": {\n \"enabled\": false\n }\n}") .asString(); ``` ```php Disable metricsEndpoint request('PATCH', 'https://app.mk.io/api/v1/projects/project_name/metricsEndpoint', [ 'body' => '{ "spec": { "enabled": false } }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Disable metricsEndpoint using RestSharp; var client = new RestClient("https://app.mk.io/api/v1/projects/project_name/metricsEndpoint"); var request = new RestRequest(Method.PATCH); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"spec\": {\n \"enabled\": false\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Disable metricsEndpoint import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["spec": ["enabled": false]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://app.mk.io/api/v1/projects/project_name/metricsEndpoint")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PATCH" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```