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

# Metrics

Metrics endpoints

## GET /status\_pages/{subdomain}/metrics

> Get the metrics

```json
{"openapi":"3.0.1","info":{"title":"StatusPal API Reference","version":"2.0.0"},"tags":[{"name":"Metrics","description":"Metrics endpoints"}],"servers":[{"url":"https://statuspal.io/api/v2"},{"url":"https://statuspal.eu/api/v2"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header"}},"parameters":{"StatusPageSubdomain":{"name":"subdomain","in":"path","description":"The subdomain of your status page.\n\nYou can find this under your status page settings, the Subdomain field is found under the \"Domain name\" section. Alternatively find it in the URL of your admin dashboard (e.g. statuspal.io/admin/`subdomain`).\n","required":true,"schema":{"type":"string"}}},"schemas":{"Metric":{"description":"Represents a metric object.","type":"object","required":["title","type","unit"],"properties":{"id":{"type":"integer","readOnly":true,"description":"The ID of the metric."},"title":{"type":"string","description":"The title or name of the metric, used to describe what the metric is measuring."},"unit":{"type":"string","description":"The unit of measurement for the metric. For example, this could be \"ms\" for milliseconds or \"requests/sec\"."},"type":{"$ref":"#/components/schemas/MetricType"},"enabled":{"type":"boolean","description":"Indicates whether the metric is currently enabled. When `true` system will actually pull data for this metric; when `false`, it does not."},"visible":{"type":"boolean","description":"Determines whether the metric is visible on the status page. If `true`, the metric's data is displayed; if `false`, it is hidden."},"remote_id":{"type":"string","description":"The identifier of the metric on the remote site. This is used to map the metric in the system to its counterpart on an external service or integration."},"remote_name":{"type":"string","description":"The name of the metric on the remote site. This is used to display the metric name as it appears on the external service."},"status":{"type":"string","readOnly":true,"description":"The current status of the metric, often represented as an HTTP status code or a descriptive string. This field indicates the latest state or response of the metric."},"latest_entry_time":{"type":"integer","readOnly":true,"description":"The Unix timestamp of the most recent entry recorded for this metric. This indicates the last time data was updated for the metric."},"threshold":{"type":"integer","description":"The threshold value for the metric. This is used to set limits or bounds, such as a threshold for triggering alerts or visual indicators in graphs."},"featured_number":{"$ref":"#/components/schemas/FeaturedNumber"},"order":{"type":"integer","readOnly":true,"description":"The order in which the metric appears on the status page or within a list. This helps determine the sorting and display sequence."},"integration_id":{"type":"string","description":"The identifier of the integration associated with this metric. This ties the metric to a specific integration."}}},"MetricType":{"type":"string","description":"The type of the metric. It can be one of the following:\n * `up` (Uptime): Represents the amount of time a service or system is operational and available.\n * `rt` (ResponseTime): Represents the time taken to respond to a request or query.\n","enum":["up","rt"]},"FeaturedNumber":{"type":"string","description":"Specifies the type of number to be featured prominently in the metric's display. Options might include \"average\", \"maximum\", or \"current/last\".\n","enum":["avg","max","last"]},"UnauthorizedError":{"type":"object","properties":{"error":{"type":"integer","description":"Unauthorized"}}},"ForbiddenError":{"type":"object","properties":{"error":{"type":"string","description":"Forbidden"}}},"NotFoundError":{"type":"object","properties":{"error":{"type":"string","description":"Resource not found!"}}},"ServerError":{"type":"object","properties":{"error":{"type":"string","description":"Internal server error :("}}}},"responses":{"UnauthorizedError":{"description":"Authorization information is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"ForbiddenError":{"description":"You lack the necessary permissions to access this resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"NotFoundError":{"description":"A resource with the provided ID was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"ServerError":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"paths":{"/status_pages/{subdomain}/metrics":{"get":{"tags":["Metrics"],"summary":"Get the metrics","operationId":"getStatusPageMetrics","parameters":[{"$ref":"#/components/parameters/StatusPageSubdomain"},{"name":"before","in":"query","description":"Used as a cursor for pagination.","schema":{"type":"string"}},{"name":"after","in":"query","description":"Used as a cursor for pagination.","schema":{"type":"string"}},{"name":"limit","in":"query","description":"Set the number of metrics to return in the response.\nThis defaults to 20 items, and can be a maximum of 100.\n","schema":{"type":"integer"}}],"responses":{"200":{"description":"A status page's metrics","content":{"application/json":{"schema":{"type":"object","properties":{"metrics":{"type":"array","items":{"$ref":"#/components/schemas/Metric"}},"links":{"type":"object","properties":{"next":{"type":"string","description":"Link for the next page."},"prev":{"type":"string","description":"Link for the previous page."}}},"meta":{"type":"object","properties":{"total_count":{"type":"integer","description":"Shows the total amount of metrics."}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"404":{"$ref":"#/components/responses/NotFoundError"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```

## POST /status\_pages/{subdomain}/metrics

> Adds a new metric

```json
{"openapi":"3.0.1","info":{"title":"StatusPal API Reference","version":"2.0.0"},"tags":[{"name":"Metrics","description":"Metrics endpoints"}],"servers":[{"url":"https://statuspal.io/api/v2"},{"url":"https://statuspal.eu/api/v2"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header"}},"parameters":{"StatusPageSubdomain":{"name":"subdomain","in":"path","description":"The subdomain of your status page.\n\nYou can find this under your status page settings, the Subdomain field is found under the \"Domain name\" section. Alternatively find it in the URL of your admin dashboard (e.g. statuspal.io/admin/`subdomain`).\n","required":true,"schema":{"type":"string"}}},"schemas":{"MetricObj":{"type":"object","properties":{"metric":{"$ref":"#/components/schemas/Metric"}}},"Metric":{"description":"Represents a metric object.","type":"object","required":["title","type","unit"],"properties":{"id":{"type":"integer","readOnly":true,"description":"The ID of the metric."},"title":{"type":"string","description":"The title or name of the metric, used to describe what the metric is measuring."},"unit":{"type":"string","description":"The unit of measurement for the metric. For example, this could be \"ms\" for milliseconds or \"requests/sec\"."},"type":{"$ref":"#/components/schemas/MetricType"},"enabled":{"type":"boolean","description":"Indicates whether the metric is currently enabled. When `true` system will actually pull data for this metric; when `false`, it does not."},"visible":{"type":"boolean","description":"Determines whether the metric is visible on the status page. If `true`, the metric's data is displayed; if `false`, it is hidden."},"remote_id":{"type":"string","description":"The identifier of the metric on the remote site. This is used to map the metric in the system to its counterpart on an external service or integration."},"remote_name":{"type":"string","description":"The name of the metric on the remote site. This is used to display the metric name as it appears on the external service."},"status":{"type":"string","readOnly":true,"description":"The current status of the metric, often represented as an HTTP status code or a descriptive string. This field indicates the latest state or response of the metric."},"latest_entry_time":{"type":"integer","readOnly":true,"description":"The Unix timestamp of the most recent entry recorded for this metric. This indicates the last time data was updated for the metric."},"threshold":{"type":"integer","description":"The threshold value for the metric. This is used to set limits or bounds, such as a threshold for triggering alerts or visual indicators in graphs."},"featured_number":{"$ref":"#/components/schemas/FeaturedNumber"},"order":{"type":"integer","readOnly":true,"description":"The order in which the metric appears on the status page or within a list. This helps determine the sorting and display sequence."},"integration_id":{"type":"string","description":"The identifier of the integration associated with this metric. This ties the metric to a specific integration."}}},"MetricType":{"type":"string","description":"The type of the metric. It can be one of the following:\n * `up` (Uptime): Represents the amount of time a service or system is operational and available.\n * `rt` (ResponseTime): Represents the time taken to respond to a request or query.\n","enum":["up","rt"]},"FeaturedNumber":{"type":"string","description":"Specifies the type of number to be featured prominently in the metric's display. Options might include \"average\", \"maximum\", or \"current/last\".\n","enum":["avg","max","last"]},"BadRequestError":{"type":"object","properties":{"error":{"type":"string","description":"Bad request!"}}},"UnauthorizedError":{"type":"object","properties":{"error":{"type":"integer","description":"Unauthorized"}}},"ForbiddenError":{"type":"object","properties":{"error":{"type":"string","description":"Forbidden"}}},"NotFoundError":{"type":"object","properties":{"error":{"type":"string","description":"Resource not found!"}}},"ValidationError":{"type":"object","properties":{"errors":{"type":"object","description":"A dictionary where each key contains the name of a field with a validation error and the value an array with the validation errors"}}},"ServerError":{"type":"object","properties":{"error":{"type":"string","description":"Internal server error :("}}}},"responses":{"BadRequestError":{"description":"Bad request error. Probably JSON syntax is wrong, check with jsonlint.com.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"UnauthorizedError":{"description":"Authorization information is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"ForbiddenError":{"description":"You lack the necessary permissions to access this resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"NotFoundError":{"description":"A resource with the provided ID was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"ValidationError":{"description":"There was a validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"ServerError":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"paths":{"/status_pages/{subdomain}/metrics":{"post":{"tags":["Metrics"],"summary":"Adds a new metric","operationId":"addMetric","parameters":[{"$ref":"#/components/parameters/StatusPageSubdomain"}],"requestBody":{"description":"The metric","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricObj"}}},"required":true},"responses":{"201":{"description":"The metric created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricObj"}}}},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"404":{"$ref":"#/components/responses/NotFoundError"},"422":{"$ref":"#/components/responses/ValidationError"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```

## GET /status\_pages/{subdomain}/metrics/{metricId}

> Get metric against given metric id

```json
{"openapi":"3.0.1","info":{"title":"StatusPal API Reference","version":"2.0.0"},"tags":[{"name":"Metrics","description":"Metrics endpoints"}],"servers":[{"url":"https://statuspal.io/api/v2"},{"url":"https://statuspal.eu/api/v2"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header"}},"parameters":{"StatusPageSubdomain":{"name":"subdomain","in":"path","description":"The subdomain of your status page.\n\nYou can find this under your status page settings, the Subdomain field is found under the \"Domain name\" section. Alternatively find it in the URL of your admin dashboard (e.g. statuspal.io/admin/`subdomain`).\n","required":true,"schema":{"type":"string"}},"MetricId":{"name":"metricId","in":"path","description":"The ID of a custom metric","required":true,"schema":{"type":"integer"}}},"schemas":{"MetricObj":{"type":"object","properties":{"metric":{"$ref":"#/components/schemas/Metric"}}},"Metric":{"description":"Represents a metric object.","type":"object","required":["title","type","unit"],"properties":{"id":{"type":"integer","readOnly":true,"description":"The ID of the metric."},"title":{"type":"string","description":"The title or name of the metric, used to describe what the metric is measuring."},"unit":{"type":"string","description":"The unit of measurement for the metric. For example, this could be \"ms\" for milliseconds or \"requests/sec\"."},"type":{"$ref":"#/components/schemas/MetricType"},"enabled":{"type":"boolean","description":"Indicates whether the metric is currently enabled. When `true` system will actually pull data for this metric; when `false`, it does not."},"visible":{"type":"boolean","description":"Determines whether the metric is visible on the status page. If `true`, the metric's data is displayed; if `false`, it is hidden."},"remote_id":{"type":"string","description":"The identifier of the metric on the remote site. This is used to map the metric in the system to its counterpart on an external service or integration."},"remote_name":{"type":"string","description":"The name of the metric on the remote site. This is used to display the metric name as it appears on the external service."},"status":{"type":"string","readOnly":true,"description":"The current status of the metric, often represented as an HTTP status code or a descriptive string. This field indicates the latest state or response of the metric."},"latest_entry_time":{"type":"integer","readOnly":true,"description":"The Unix timestamp of the most recent entry recorded for this metric. This indicates the last time data was updated for the metric."},"threshold":{"type":"integer","description":"The threshold value for the metric. This is used to set limits or bounds, such as a threshold for triggering alerts or visual indicators in graphs."},"featured_number":{"$ref":"#/components/schemas/FeaturedNumber"},"order":{"type":"integer","readOnly":true,"description":"The order in which the metric appears on the status page or within a list. This helps determine the sorting and display sequence."},"integration_id":{"type":"string","description":"The identifier of the integration associated with this metric. This ties the metric to a specific integration."}}},"MetricType":{"type":"string","description":"The type of the metric. It can be one of the following:\n * `up` (Uptime): Represents the amount of time a service or system is operational and available.\n * `rt` (ResponseTime): Represents the time taken to respond to a request or query.\n","enum":["up","rt"]},"FeaturedNumber":{"type":"string","description":"Specifies the type of number to be featured prominently in the metric's display. Options might include \"average\", \"maximum\", or \"current/last\".\n","enum":["avg","max","last"]},"UnauthorizedError":{"type":"object","properties":{"error":{"type":"integer","description":"Unauthorized"}}},"ForbiddenError":{"type":"object","properties":{"error":{"type":"string","description":"Forbidden"}}},"NotFoundError":{"type":"object","properties":{"error":{"type":"string","description":"Resource not found!"}}},"ServerError":{"type":"object","properties":{"error":{"type":"string","description":"Internal server error :("}}}},"responses":{"UnauthorizedError":{"description":"Authorization information is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"ForbiddenError":{"description":"You lack the necessary permissions to access this resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"NotFoundError":{"description":"A resource with the provided ID was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"ServerError":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"paths":{"/status_pages/{subdomain}/metrics/{metricId}":{"get":{"operationId":"getMetric","summary":"Get metric against given metric id","tags":["Metrics"],"parameters":[{"$ref":"#/components/parameters/StatusPageSubdomain"},{"$ref":"#/components/parameters/MetricId"}],"responses":{"200":{"description":"The metric","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricObj"}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"404":{"$ref":"#/components/responses/NotFoundError"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```

## PUT /status\_pages/{subdomain}/metrics/{metricId}

> Updates existing metric

```json
{"openapi":"3.0.1","info":{"title":"StatusPal API Reference","version":"2.0.0"},"tags":[{"name":"Metrics","description":"Metrics endpoints"}],"servers":[{"url":"https://statuspal.io/api/v2"},{"url":"https://statuspal.eu/api/v2"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header"}},"parameters":{"MetricId":{"name":"metricId","in":"path","description":"The ID of a custom metric","required":true,"schema":{"type":"integer"}},"StatusPageSubdomain":{"name":"subdomain","in":"path","description":"The subdomain of your status page.\n\nYou can find this under your status page settings, the Subdomain field is found under the \"Domain name\" section. Alternatively find it in the URL of your admin dashboard (e.g. statuspal.io/admin/`subdomain`).\n","required":true,"schema":{"type":"string"}}},"schemas":{"MetricObj":{"type":"object","properties":{"metric":{"$ref":"#/components/schemas/Metric"}}},"Metric":{"description":"Represents a metric object.","type":"object","required":["title","type","unit"],"properties":{"id":{"type":"integer","readOnly":true,"description":"The ID of the metric."},"title":{"type":"string","description":"The title or name of the metric, used to describe what the metric is measuring."},"unit":{"type":"string","description":"The unit of measurement for the metric. For example, this could be \"ms\" for milliseconds or \"requests/sec\"."},"type":{"$ref":"#/components/schemas/MetricType"},"enabled":{"type":"boolean","description":"Indicates whether the metric is currently enabled. When `true` system will actually pull data for this metric; when `false`, it does not."},"visible":{"type":"boolean","description":"Determines whether the metric is visible on the status page. If `true`, the metric's data is displayed; if `false`, it is hidden."},"remote_id":{"type":"string","description":"The identifier of the metric on the remote site. This is used to map the metric in the system to its counterpart on an external service or integration."},"remote_name":{"type":"string","description":"The name of the metric on the remote site. This is used to display the metric name as it appears on the external service."},"status":{"type":"string","readOnly":true,"description":"The current status of the metric, often represented as an HTTP status code or a descriptive string. This field indicates the latest state or response of the metric."},"latest_entry_time":{"type":"integer","readOnly":true,"description":"The Unix timestamp of the most recent entry recorded for this metric. This indicates the last time data was updated for the metric."},"threshold":{"type":"integer","description":"The threshold value for the metric. This is used to set limits or bounds, such as a threshold for triggering alerts or visual indicators in graphs."},"featured_number":{"$ref":"#/components/schemas/FeaturedNumber"},"order":{"type":"integer","readOnly":true,"description":"The order in which the metric appears on the status page or within a list. This helps determine the sorting and display sequence."},"integration_id":{"type":"string","description":"The identifier of the integration associated with this metric. This ties the metric to a specific integration."}}},"MetricType":{"type":"string","description":"The type of the metric. It can be one of the following:\n * `up` (Uptime): Represents the amount of time a service or system is operational and available.\n * `rt` (ResponseTime): Represents the time taken to respond to a request or query.\n","enum":["up","rt"]},"FeaturedNumber":{"type":"string","description":"Specifies the type of number to be featured prominently in the metric's display. Options might include \"average\", \"maximum\", or \"current/last\".\n","enum":["avg","max","last"]},"BadRequestError":{"type":"object","properties":{"error":{"type":"string","description":"Bad request!"}}},"UnauthorizedError":{"type":"object","properties":{"error":{"type":"integer","description":"Unauthorized"}}},"ForbiddenError":{"type":"object","properties":{"error":{"type":"string","description":"Forbidden"}}},"NotFoundError":{"type":"object","properties":{"error":{"type":"string","description":"Resource not found!"}}},"ValidationError":{"type":"object","properties":{"errors":{"type":"object","description":"A dictionary where each key contains the name of a field with a validation error and the value an array with the validation errors"}}},"ServerError":{"type":"object","properties":{"error":{"type":"string","description":"Internal server error :("}}}},"responses":{"BadRequestError":{"description":"Bad request error. Probably JSON syntax is wrong, check with jsonlint.com.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"UnauthorizedError":{"description":"Authorization information is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"ForbiddenError":{"description":"You lack the necessary permissions to access this resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"NotFoundError":{"description":"A resource with the provided ID was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"ValidationError":{"description":"There was a validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"ServerError":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"paths":{"/status_pages/{subdomain}/metrics/{metricId}":{"put":{"tags":["Metrics"],"summary":"Updates existing metric","operationId":"updateMetric","parameters":[{"$ref":"#/components/parameters/MetricId"},{"$ref":"#/components/parameters/StatusPageSubdomain"}],"requestBody":{"description":"The metric","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricObj"}}},"required":true},"responses":{"200":{"description":"The metric updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricObj"}}}},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"404":{"$ref":"#/components/responses/NotFoundError"},"422":{"$ref":"#/components/responses/ValidationError"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```

## DELETE /status\_pages/{subdomain}/metrics/{metricId}

> Deletes metric permanently

```json
{"openapi":"3.0.1","info":{"title":"StatusPal API Reference","version":"2.0.0"},"tags":[{"name":"Metrics","description":"Metrics endpoints"}],"servers":[{"url":"https://statuspal.io/api/v2"},{"url":"https://statuspal.eu/api/v2"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header"}},"parameters":{"StatusPageSubdomain":{"name":"subdomain","in":"path","description":"The subdomain of your status page.\n\nYou can find this under your status page settings, the Subdomain field is found under the \"Domain name\" section. Alternatively find it in the URL of your admin dashboard (e.g. statuspal.io/admin/`subdomain`).\n","required":true,"schema":{"type":"string"}},"MetricId":{"name":"metricId","in":"path","description":"The ID of a custom metric","required":true,"schema":{"type":"integer"}}},"responses":{"UnauthorizedError":{"description":"Authorization information is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"ForbiddenError":{"description":"You lack the necessary permissions to access this resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"NotFoundError":{"description":"A resource with the provided ID was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"ServerError":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}},"schemas":{"UnauthorizedError":{"type":"object","properties":{"error":{"type":"integer","description":"Unauthorized"}}},"ForbiddenError":{"type":"object","properties":{"error":{"type":"string","description":"Forbidden"}}},"NotFoundError":{"type":"object","properties":{"error":{"type":"string","description":"Resource not found!"}}},"ServerError":{"type":"object","properties":{"error":{"type":"string","description":"Internal server error :("}}}}},"paths":{"/status_pages/{subdomain}/metrics/{metricId}":{"delete":{"operationId":"deleteMetric","summary":"Deletes metric permanently","tags":["Metrics"],"parameters":[{"$ref":"#/components/parameters/StatusPageSubdomain"},{"$ref":"#/components/parameters/MetricId"}],"responses":{"200":{"description":"Metric deleted successfully","content":{}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"404":{"$ref":"#/components/responses/NotFoundError"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```

## POST /status\_pages/{subdomain}/metrics/{metricId}/entries

> Adds a metric data point to a custom metric

```json
{"openapi":"3.0.1","info":{"title":"StatusPal API Reference","version":"2.0.0"},"tags":[{"name":"Metrics","description":"Metrics endpoints"}],"servers":[{"url":"https://statuspal.io/api/v2"},{"url":"https://statuspal.eu/api/v2"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header"}},"parameters":{"StatusPageSubdomain":{"name":"subdomain","in":"path","description":"The subdomain of your status page.\n\nYou can find this under your status page settings, the Subdomain field is found under the \"Domain name\" section. Alternatively find it in the URL of your admin dashboard (e.g. statuspal.io/admin/`subdomain`).\n","required":true,"schema":{"type":"string"}},"MetricId":{"name":"metricId","in":"path","description":"The ID of a custom metric","required":true,"schema":{"type":"integer"}}},"schemas":{"MetricEntryObj":{"type":"object","properties":{"entry":{"$ref":"#/components/schemas/MetricEntry"}}},"MetricEntry":{"required":["time","value"],"type":"object","properties":{"time":{"type":"integer","description":"Unix timestamp"},"value":{"type":"number","format":"double"}}},"BadRequestError":{"type":"object","properties":{"error":{"type":"string","description":"Bad request!"}}},"UnauthorizedError":{"type":"object","properties":{"error":{"type":"integer","description":"Unauthorized"}}},"ForbiddenError":{"type":"object","properties":{"error":{"type":"string","description":"Forbidden"}}},"NotFoundError":{"type":"object","properties":{"error":{"type":"string","description":"Resource not found!"}}},"ValidationError":{"type":"object","properties":{"errors":{"type":"object","description":"A dictionary where each key contains the name of a field with a validation error and the value an array with the validation errors"}}},"ServerError":{"type":"object","properties":{"error":{"type":"string","description":"Internal server error :("}}}},"responses":{"BadRequestError":{"description":"Bad request error. Probably JSON syntax is wrong, check with jsonlint.com.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"UnauthorizedError":{"description":"Authorization information is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"ForbiddenError":{"description":"You lack the necessary permissions to access this resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"NotFoundError":{"description":"A resource with the provided ID was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"ValidationError":{"description":"There was a validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"ServerError":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"paths":{"/status_pages/{subdomain}/metrics/{metricId}/entries":{"post":{"tags":["Metrics"],"summary":"Adds a metric data point to a custom metric","operationId":"addCustomMetricDataPoint","parameters":[{"$ref":"#/components/parameters/StatusPageSubdomain"},{"$ref":"#/components/parameters/MetricId"}],"requestBody":{"description":"The metric entry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricEntryObj"}}},"required":true},"responses":{"200":{"description":"The metric data point was created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricEntryObj"}}}},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"404":{"$ref":"#/components/responses/NotFoundError"},"422":{"$ref":"#/components/responses/ValidationError"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```
