{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":531,"path":"api-reference/rest-apis/push-metrics-MID-server.md","title":"Push Metrics API","bundle":null,"doc_type":null,"release":"australia","body":"\n# Push Metrics API\n\nThe Push Metrics API provides endpoints that enable you to push raw Metric Intelligence data from an external source to the MID Server.\n\nThis API is based on client-side tools that push the raw data from the external source to the MID Server. The Metric Intelligence extension is required to be configured with the **Enable REST Listener** option enabled. For more information on setting up the MID Server, see [Get started with Metric Intelligence](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/it-operations-management/get-started-metrics.md).\n\nFor information on authentication requirements, see [Configure the MID Web Server extension](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/it-operations-management/configure-mid-web-server-extension.md).\n\n**Parent Topic:**[REST API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/api-rest.md)\n\n## Push Metrics - POST /mid/sa/metrics\n\nPushes raw Metric Intelligence data from an external source to the MID Server.\n\n### URL format\n\nDefault URL: `/api/mid/sa/metrics`\n\n### Supported request parameters\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nci2metric\\_id\n\n</td><td>\n\nList of key-value pairs to use to identify the configuration item \\(CI\\). It is formerly known as **ci\\_identifier**. The script continues to accept **ci\\_identifier**.Data type: Object\n\n</td></tr><tr><td>\n\nmetric\\_type\n\n</td><td>\n\nName of the metric.Data type: String\n\n</td></tr><tr><td>\n\nnode\n\n</td><td>\n\nIP address, FQDN, name of the CI, or host. In the example below, the name of the Linux server where the disks are installed.Data type: String\n\n</td></tr><tr><td>\n\nresource\\_path\n\n</td><td>\n\nThe path of the resource for which metric data is being collected. In the example below, `C:\\` is the resource for which metric data is collected.Data type: String\n\n</td></tr><tr><td>\n\nsource\n\n</td><td>\n\nData source monitoring the metric type.Data type: String\n\n</td></tr><tr><td>\n\ntimestamp\n\n</td><td>\n\nEpoch time stamp of the metric. Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\nunit\n\n</td><td>\n\nUnit type that is associated with the source metric type.Table: Monitoring System Metric Types \\[sa\\_source\\_metric\\_type\\]\n\nData type: String\n\n</td></tr><tr><td>\n\nvalue\n\n</td><td>\n\nValue of the metric.Data type: Number\n\n</td></tr></tbody>\n</table>### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nContent-Type\n\n</td><td id=\"content_type-entry-RESTAPI\">\n\nData format of the request body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|401|Unauthorized. The user credentials are incorrect or have not been passed.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n|Name|Description|\n|----|-----------|\n|None||\n\n### cURL request\n\nThe request body must be surrounded by square brackets, as shown in this example.\n\n```\ncurl -X POST \"https://<mid-server-host>/api/mid/sa/metrics\"\n-H \"Content-Type: application/json\"\n-U \"username\":\"password\"\n-d \"[{\n    \"metric_type\": \"Disk C: % Free Space\",\n    \"resource_path\": \"C:\\\\\",\n    \"node\": \"lnux100\",\n    \"value\": 50,\n    \"timestamp\": 1473183012000,\n    \"ci2metric_id\": {\n        \"node\": \"lnux100\"\n    },\n    \"source\": \"Splunk\"\n}]\"\n```\n\n"}}