{
    "openapi": "3.1.2",
    "info": {
        "title": "WatchTower15 Ingest API",
        "version": "1.0.0+sha.70713b6f3cef",
        "description": "The WatchTower15 ingest API takes data in: custom metric points and log lines, sent with a source's token. It is separate from the REST API: a different host, a different credential and the same answer envelope on every call.\n\n**Credentials.** A metric source's token (`wt15ms_…`) and a log source's token (`wt15ls_…`) each travel as `Authorization: Bearer <token>`. A token belongs to one source and works on its own operations only. Every failure to authenticate is the same `403`.\n\n**Bodies.** A body is read raw and may be any of four forms: a JSON envelope (`{\"points\": […]}` or `{\"lines\": […]}`), a JSON array, a single JSON object, or\nnewline-delimited JSON (`application/x-ndjson`, one object per line). Any form may be gzip-compressed; gzip is detected from the bytes, so `Content-Type` is not trusted.\n\n**Answers.** Every answer, a failure too, is the same envelope: `status`, `status_code`, `data`, `request_id` and `timestamp` (epoch milliseconds), with `message` and `errors` where they apply. Metric answers count each reason a point was rejected, zero included, so a refused point is never silent.\n\n**Idempotency.** Both `POST` operations take an optional `Idempotency-Key` header. Metrics: required for points older than 30 days, remembered for 30 days. Logs: remembered for 24 hours, and a different batch under the same key is refused.\n\n**Limits.** Each operation lists its limits, the defaults of the platform. The console sends from `app.watchtower15.com`; the networks to allow for egress are listed in the client documentation.\n\n**Marks for generators.** Beside the standard fields, schemas and operations carry `x-wt15-open-enum` (an enum a client must keep open), `x-wt15-instant` (an integer\nholding epoch milliseconds), `x-wt15-scopes` (always empty here: the token is the only credential) and `x-wt15-idempotent` (the operation honours `Idempotency-Key`).",
        "termsOfService": "https://watchtower15.com/terms",
        "contact": {
            "name": "WatchTower15",
            "url": "https://docs.watchtower15.com/api/",
            "email": "contact@watchtower15.com"
        },
        "license": {
            "name": "MIT",
            "identifier": "MIT"
        }
    },
    "servers": [
        {
            "url": "https://api.watchtower15.com",
            "description": "Production"
        }
    ],
    "tags": [
        {
            "name": "MetricsIngest",
            "description": "Send custom metric points with a metric source's token, and read back the points and limits that token's source holds."
        },
        {
            "name": "LogsIngest",
            "description": "Send log lines with a log source's token."
        }
    ],
    "paths": {
        "/api/log-sources/ingest": {
            "post": {
                "operationId": "logSources.ingest",
                "description": "Sends a batch of log lines with a log source's token. The body is a JSON envelope `{\"lines\": […]}`, a JSON array, one line or newline-delimited JSON, any of them gzipped. Each line carries a `message` and optionally `logged_at`, `log_level`, `stream_name` and `raw_line`. An `Idempotency-Key` makes a retry of the same batch safe for 24 hours.\n\n**Limits** (by default):\n- 1,000 lines in one request.\n- A body of 5,242,880 bytes as sent and 20,971,520 bytes after decompression.\n- A message of at most 65,536 bytes.\n- A `logged_at` more than 300 seconds ahead is clamped to now.\n- 600 requests a minute for each source.",
                "summary": "Send log lines",
                "tags": [
                    "LogsIngest"
                ],
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "description": "Any text of 1 to 255 visible ASCII characters. A repeat of the same batch with the same key within 24 hours is answered as the first was, with the first batch's `batch_id` and `lines`, and stored once. A different batch under a key used in the last 24 hours is refused with `422`.",
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        }
                    }
                ],
                "requestBody": {
                    "description": "The batch, in any of these forms, optionally gzip-compressed. The form is detected from the content, not from `Content-Type`.",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "description": "Exactly one of: an envelope, an array of lines, or a single line.",
                                "oneOf": [
                                    {
                                        "$ref": "#/components/schemas/LogLinesEnvelope"
                                    },
                                    {
                                        "type": "array",
                                        "description": "An array of lines.",
                                        "items": {
                                            "$ref": "#/components/schemas/LogLine"
                                        },
                                        "maxItems": 1000
                                    },
                                    {
                                        "$ref": "#/components/schemas/LogLine"
                                    }
                                ]
                            }
                        },
                        "application/x-ndjson": {
                            "schema": {
                                "type": "string",
                                "description": "Newline-delimited JSON: one line object per line."
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "What was stored and how many lines the batch held.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/IngestEnvelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "description": "What was stored and how many lines the batch held.",
                                                    "$ref": "#/components/schemas/LogSourcesIngestResource"
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "The body is empty, or is not one of the accepted forms, or cannot be decompressed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/IngestFailure"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The token is missing, malformed, unknown, switched off or belongs to another kind of source. Every failure to authenticate is this one answer.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/IngestFailure"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "The body is larger than the limit, or holds more lines than a request may.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/IngestFailure"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "The `Idempotency-Key` was used in the last 24 hours for a different batch; `data.code` is `idempotency_key_reused` and `errors` names the header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/IngestFailure"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "description": "The refusal's code.",
                                                    "properties": {
                                                        "code": {
                                                            "type": "string",
                                                            "description": "`idempotency_key_reused`."
                                                        }
                                                    },
                                                    "required": [
                                                        "code"
                                                    ]
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "A rate limit is reached, or the organisation's log volume is stopped; `Retry-After` says how many seconds to wait, and for a stop `data` holds `code` `log_volume_limit_reached` and `resumes_at`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/IngestFailure"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "description": "`{code, resumes_at}` when the organisation's log volume is stopped; null for a rate limit.",
                                                    "anyOf": [
                                                        {
                                                            "type": "object",
                                                            "description": "The stop's details, present when the organisation's log volume is stopped.",
                                                            "properties": {
                                                                "code": {
                                                                    "type": "string",
                                                                    "description": "`log_volume_limit_reached`."
                                                                },
                                                                "resumes_at": {
                                                                    "type": "integer",
                                                                    "description": "Epoch milliseconds. When the organisation's log volume resumes.",
                                                                    "x-wt15-instant": true
                                                                }
                                                            },
                                                            "required": [
                                                                "code",
                                                                "resumes_at"
                                                            ]
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        },
                        "headers": {
                            "Retry-After": {
                                "description": "Seconds to wait before sending again.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "X-RateLimit-Limit": {
                                "description": "The requests allowed in the current window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "X-RateLimit-Remaining": {
                                "description": "The requests left in the current window.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The batch could not be stored; send it again shortly.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/IngestFailure"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "logsToken": []
                    }
                ],
                "x-wt15-scopes": [],
                "x-wt15-idempotent": true
            }
        },
        "/api/metric-sources/ingest": {
            "post": {
                "operationId": "metricSources.ingest",
                "description": "Sends a batch of custom metric points with a metric source's token. The body is a JSON envelope `{\"points\": […]}`, a JSON array, one point or newline-delimited JSON, any of them gzipped. Each point names its metric by key (`metric`) or by uuid (`metric_uuid`) and carries a numeric `value` and an optional `recorded_at`. The answer counts what was queued and, per reason, what was refused; a batch can be partly accepted.\n\n**Limits** (by default):\n- 1,000 points in one request.\n- A body of 1,048,576 bytes as sent and 10,485,760 bytes after decompression.\n- A `recorded_at` at most 300 seconds ahead of the server's clock, and at most 1,095 days back.",
                "summary": "Send metric points",
                "tags": [
                    "MetricsIngest"
                ],
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "description": "Any text of 1 to 255 visible ASCII characters. Required for points older than 30 days. A repeat of the same batch with the same key within 30 days is answered as the first was and counted once; a different batch under a used key is refused.",
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        }
                    }
                ],
                "requestBody": {
                    "description": "The batch, in any of these forms, optionally gzip-compressed. The form is detected from the content, not from `Content-Type`.",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "description": "Exactly one of: an envelope, an array of points, or a single point.",
                                "oneOf": [
                                    {
                                        "$ref": "#/components/schemas/MetricPointsEnvelope"
                                    },
                                    {
                                        "type": "array",
                                        "description": "An array of points.",
                                        "items": {
                                            "$ref": "#/components/schemas/MetricPoint"
                                        },
                                        "maxItems": 1000
                                    },
                                    {
                                        "$ref": "#/components/schemas/MetricPoint"
                                    }
                                ]
                            }
                        },
                        "application/x-ndjson": {
                            "schema": {
                                "type": "string",
                                "description": "Newline-delimited JSON: one point object per line."
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "What was queued and how many points each reason refused.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/IngestEnvelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "description": "What was queued and how many points each reason refused.",
                                                    "$ref": "#/components/schemas/MetricSourcesIngestResource"
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "The body is empty, or is not one of the accepted forms, or cannot be decompressed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/IngestFailure"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The token is missing, malformed, unknown, switched off or belongs to another kind of source. Every failure to authenticate is this one answer.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/IngestFailure"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "The body is larger than the limit, or holds more points than a request may.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/IngestFailure"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "A rate limit is reached; `Retry-After` says how many seconds to wait.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/IngestFailure"
                                }
                            }
                        },
                        "headers": {
                            "Retry-After": {
                                "description": "Seconds to wait before sending again.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "X-RateLimit-Limit": {
                                "description": "The requests allowed in the current window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "X-RateLimit-Remaining": {
                                "description": "The requests left in the current window.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The custom metrics store refused the write or did not answer; send the batch again shortly.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/IngestFailure"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "metricsToken": []
                    }
                ],
                "x-wt15-scopes": [],
                "x-wt15-idempotent": true
            },
            "get": {
                "operationId": "metricSources.metricsList",
                "description": "Returns the metrics of the token's own metric source, deleted ones included, sorted by key, each with its type and status, and the organisation's metric allowance and use. Read only: it does not count as a push.",
                "summary": "List a source's metrics",
                "tags": [
                    "MetricsIngest"
                ],
                "responses": {
                    "200": {
                        "description": "The source's metrics and the organisation's metric allowance.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/IngestEnvelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "description": "The source's metrics and the organisation's metric allowance.",
                                                    "$ref": "#/components/schemas/MetricSourcesMetricsListResource"
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The token is missing, malformed, unknown, switched off or belongs to another kind of source. Every failure to authenticate is this one answer.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/IngestFailure"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "A rate limit is reached; `Retry-After` says how many seconds to wait.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/IngestFailure"
                                }
                            }
                        },
                        "headers": {
                            "Retry-After": {
                                "description": "Seconds to wait before sending again.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "X-RateLimit-Limit": {
                                "description": "The requests allowed in the current window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "X-RateLimit-Remaining": {
                                "description": "The requests left in the current window.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "metricsToken": []
                    }
                ],
                "x-wt15-scopes": []
            }
        }
    },
    "components": {
        "securitySchemes": {
            "metricsToken": {
                "type": "http",
                "description": "A metric source's token, sent as `Authorization: Bearer wt15ms_…`. Create one in the console, on the metric source.",
                "scheme": "bearer",
                "bearerFormat": "wt15ms"
            },
            "logsToken": {
                "type": "http",
                "description": "A log source's token, sent as `Authorization: Bearer wt15ls_…`. Create one in the console, on the log source.",
                "scheme": "bearer",
                "bearerFormat": "wt15ls"
            }
        },
        "schemas": {
            "IngestEnvelope": {
                "type": "object",
                "properties": {
                    "status": {
                        "type": "string",
                        "description": "`success` for an answer, `failure` for a refusal.",
                        "enum": [
                            "success",
                            "failure",
                            "warning"
                        ],
                        "x-wt15-open-enum": true
                    },
                    "status_code": {
                        "type": "integer",
                        "description": "The HTTP status of the answer."
                    },
                    "data": {
                        "description": "The answer, whose shape each operation states; null in a refusal."
                    },
                    "request_id": {
                        "type": "string",
                        "description": "The request's id; quote it when asking for support."
                    },
                    "timestamp": {
                        "type": "integer",
                        "description": "Epoch milliseconds. When the answer was made.",
                        "x-wt15-instant": true
                    },
                    "message": {
                        "type": "string",
                        "description": "A sentence naming the problem or the outcome; present when there is one."
                    }
                },
                "required": [
                    "status",
                    "status_code",
                    "data",
                    "request_id",
                    "timestamp"
                ],
                "title": "IngestEnvelope"
            },
            "IngestFailure": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/IngestEnvelope"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "errors": {
                                "type": "object",
                                "description": "On a `422`: the fields at fault, each with its messages.",
                                "additionalProperties": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                ],
                "title": "IngestFailure"
            },
            "LogLine": {
                "type": "object",
                "description": "One log line.",
                "properties": {
                    "message": {
                        "type": "string",
                        "description": "The log line. A line without one is skipped."
                    },
                    "logged_at": {
                        "description": "When the line was logged: RFC 3339, or a Unix epoch in seconds or milliseconds as a number or a string. A time without a timezone is read as UTC. A missing or unreadable time is the time the line was received.",
                        "type": [
                            "string",
                            "number"
                        ]
                    },
                    "log_level": {
                        "type": "string",
                        "description": "The line's level. Anything else is dropped rather than stored.",
                        "enum": [
                            "debug",
                            "info",
                            "notice",
                            "warning",
                            "error",
                            "critical",
                            "alert",
                            "emergency"
                        ],
                        "x-wt15-open-enum": true
                    },
                    "stream_name": {
                        "type": "string",
                        "description": "The stream the line belongs to; defaults to the source's slug. Keep it low-cardinality: a stable label, never an id or a timestamp."
                    },
                    "log_source": {
                        "type": "string",
                        "description": "An alias for `stream_name`, so an agent-shaped payload works unchanged."
                    },
                    "raw_line": {
                        "type": "string",
                        "description": "The original unparsed line, if there is one."
                    }
                },
                "required": [
                    "message"
                ],
                "title": "LogLine"
            },
            "LogLinesEnvelope": {
                "type": "object",
                "description": "A batch as an envelope: `{\"lines\": […]}`.",
                "properties": {
                    "lines": {
                        "type": "array",
                        "description": "The lines of the batch.",
                        "items": {
                            "$ref": "#/components/schemas/LogLine"
                        },
                        "maxItems": 1000
                    }
                },
                "required": [
                    "lines"
                ],
                "title": "LogLinesEnvelope"
            },
            "LogSourcesIngestResource": {
                "type": "object",
                "properties": {
                    "accepted": {
                        "type": "boolean",
                        "description": "Whether the batch was stored. Stored means durable, not yet searchable."
                    },
                    "batch_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "The id of the stored batch; null when nothing was stored."
                    },
                    "lines": {
                        "type": "integer",
                        "description": "The number of lines in the batch."
                    }
                },
                "required": [
                    "accepted",
                    "batch_id",
                    "lines"
                ],
                "title": "LogSourcesIngestResource"
            },
            "MetricPoint": {
                "description": "One metric point.",
                "allOf": [
                    {
                        "type": "object",
                        "description": "One metric point.",
                        "properties": {
                            "metric": {
                                "type": "string",
                                "description": "The metric key, as it appears in WatchTower15: `A-Z a-z 0-9 . _ -`, up to 100 characters. Taken exactly as sent. Send this or `metric_uuid`, not both.",
                                "maxLength": 100
                            },
                            "metric_uuid": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The metric's uuid, instead of its key. Never creates a metric, and must belong to the source whose token is used."
                            },
                            "value": {
                                "type": "number",
                                "description": "A number. For a level, the measurement (negative and fractional are fine). For a count, how many occurrences the point represents; a count cannot be negative."
                            },
                            "metric_type": {
                                "type": "string",
                                "description": "The type to create a new metric as. Honoured only on the push that creates the metric; any other value refuses the point.",
                                "enum": [
                                    "count",
                                    "level"
                                ],
                                "x-wt15-open-enum": true
                            },
                            "recorded_at": {
                                "description": "When the value was measured: RFC 3339, or a Unix epoch in seconds or milliseconds as a number or a string. A time without a timezone is read as UTC. Defaults to now.",
                                "type": [
                                    "string",
                                    "number"
                                ]
                            }
                        },
                        "required": [
                            "value"
                        ]
                    },
                    {
                        "description": "A point names its metric by `metric` or by `metric_uuid`.",
                        "anyOf": [
                            {
                                "type": "object",
                                "required": [
                                    "metric"
                                ]
                            },
                            {
                                "type": "object",
                                "required": [
                                    "metric_uuid"
                                ]
                            }
                        ]
                    }
                ],
                "title": "MetricPoint"
            },
            "MetricPointsEnvelope": {
                "type": "object",
                "description": "A batch as an envelope: `{\"points\": […]}`.",
                "properties": {
                    "points": {
                        "type": "array",
                        "description": "The points of the batch.",
                        "items": {
                            "$ref": "#/components/schemas/MetricPoint"
                        },
                        "maxItems": 1000
                    }
                },
                "required": [
                    "points"
                ],
                "title": "MetricPointsEnvelope"
            },
            "MetricSourcesIngestResource": {
                "type": "object",
                "properties": {
                    "accepted": {
                        "type": "boolean",
                        "description": "Whether any point of the batch was queued. Queued means durably accepted, not yet on a chart: a value is typically chartable within about half a minute."
                    },
                    "batch_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "The id of the queued batch; null when no point was queued."
                    },
                    "points": {
                        "type": "integer",
                        "description": "The number of points in the batch as read, before any was rejected."
                    },
                    "rejected": {
                        "type": "object",
                        "description": "How many points each reason refused. Every reason is always present, zero when it did not happen; a batch can be partly accepted.",
                        "properties": {
                            "over_metric_cap": {
                                "type": "integer",
                                "description": "Points for a new metric key refused because the organisation is at its metric limit."
                            },
                            "metric_create_busy": {
                                "type": "integer",
                                "description": "Points for a new metric key whose metric was not created this time, because the organisation was busy or the metric source was being saved. Send them again; points for existing metrics are not affected."
                            },
                            "bad_metric_key": {
                                "type": "integer",
                                "description": "Points whose metric key has characters that are not accepted."
                            },
                            "unknown_metric_uuid": {
                                "type": "integer",
                                "description": "Points whose `metric_uuid` does not exist in the organisation, is switched off, or belongs to a different source than the token."
                            },
                            "ambiguous_identifier": {
                                "type": "integer",
                                "description": "Points that sent both `metric` and `metric_uuid`. Send one."
                            },
                            "future_timestamp": {
                                "type": "integer",
                                "description": "Points whose `recorded_at` is further ahead of the server's clock than the allowed skew. They are refused, never moved."
                            },
                            "too_old": {
                                "type": "integer",
                                "description": "Points older than the data is kept for this metric, three years."
                            },
                            "non_numeric": {
                                "type": "integer",
                                "description": "Points whose `value` is not a number, or whose `recorded_at` could not be read."
                            },
                            "negative_on_count_metric": {
                                "type": "integer",
                                "description": "Negative points for a metric of type `count`, which cannot go backwards."
                            },
                            "over_point_rate": {
                                "type": "integer",
                                "description": "Points dropped because the metric used up its allowance for recent points."
                            },
                            "over_backfill_budget": {
                                "type": "integer",
                                "description": "Points dropped because the metric used up its separate allowance for backfilled points."
                            },
                            "missing_idempotency_key": {
                                "type": "integer",
                                "description": "Backfilled points sent with no `Idempotency-Key` header, which they require."
                            },
                            "metric_key_deleted": {
                                "type": "integer",
                                "description": "Points whose key belongs to a deleted metric of this source."
                            },
                            "metric_awaiting_approval": {
                                "type": "integer",
                                "description": "Points for a metric that exists but has not been approved yet; they are not stored."
                            },
                            "bad_metric_type": {
                                "type": "integer",
                                "description": "Points whose `metric_type` is not `count` or `level`; they are not stored and no metric was created."
                            }
                        },
                        "required": [
                            "over_metric_cap",
                            "metric_create_busy",
                            "bad_metric_key",
                            "unknown_metric_uuid",
                            "ambiguous_identifier",
                            "future_timestamp",
                            "too_old",
                            "non_numeric",
                            "negative_on_count_metric",
                            "over_point_rate",
                            "over_backfill_budget",
                            "missing_idempotency_key",
                            "metric_key_deleted",
                            "metric_awaiting_approval",
                            "bad_metric_type"
                        ]
                    }
                },
                "required": [
                    "accepted",
                    "batch_id",
                    "points",
                    "rejected"
                ],
                "title": "MetricSourcesIngestResource"
            },
            "MetricSourcesMetricsListResource": {
                "type": "object",
                "properties": {
                    "metrics": {
                        "type": "array",
                        "description": "The token's own source's metrics, deleted ones included, sorted by key. No paging.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "uuid": {
                                    "type": "string",
                                    "description": "The metric's uuid, which a point may send as `metric_uuid`."
                                },
                                "key": {
                                    "type": "string",
                                    "description": "The metric's key, which a point sends as `metric`."
                                },
                                "type": {
                                    "type": "string",
                                    "description": "`count` or `level`."
                                },
                                "status": {
                                    "type": "string",
                                    "description": "`active`, `pending` (not approved yet), `deactivated` or `deleted`."
                                }
                            },
                            "required": [
                                "uuid",
                                "key",
                                "type",
                                "status"
                            ]
                        }
                    },
                    "limits": {
                        "type": "object",
                        "description": "The organisation's metric allowance.",
                        "properties": {
                            "max_metrics": {
                                "type": "integer",
                                "description": "The most metrics the organisation may have across all its sources."
                            },
                            "used": {
                                "type": "integer",
                                "description": "The metrics it has now across all its sources."
                            }
                        },
                        "required": [
                            "max_metrics",
                            "used"
                        ]
                    }
                },
                "required": [
                    "metrics",
                    "limits"
                ],
                "title": "MetricSourcesMetricsListResource"
            }
        }
    }
}
