{
  "openapi": "3.0.3",
  "info": {
    "title": "Request Counter API",
    "version": "1.0.0",
    "description": "Join requests of private channels, and joins and exact post views of public channels, collected by the Request Counter Telegram bot. Authenticate with the API key from the bot's /apikey command, sent as `Authorization: Bearer <key>`, an `X-API-Key` header or an `api_key` query parameter. In paths, `{id}` is a Telegram chat id such as -1001234567890, `all` for every channel combined, or `private` / `public` for one list. A public channel is a broadcast channel with an @username. Dates accept RFC3339 or YYYY-MM-DD in the server's timezone; a date-only `to` includes that whole day. Give each client app its own key with the bot's /newkey command; it works exactly like the main key and can be revoked on its own. Changes inside v1 are additive only: fields and endpoints are never removed or renamed. Integrations should set a `tag` on every link they create (e.g. \"tessera\", \"shop:summer-sale\"), then filter with ?tag= or read /v1/tags, so links from different apps never mix."
  },
  "servers": [{ "url": "https://req3.gitbash.cloud" }],
  "security": [
    {
      "bearer": []
    },
    {
      "apiKeyHeader": []
    },
    {
      "apiKeyQuery": []
    }
  ],
  "tags": [
    {
      "name": "Counts",
      "description": "Totals and time-range counts"
    },
    {
      "name": "Channels",
      "description": "Per-channel data"
    },
    {
      "name": "Meta"
    },
    {
      "name": "Invite links",
      "description": "Links created by the bot. Joiners through a make_admin link are promoted automatically."
    },
    {
      "name": "Activity",
      "description": "Joins, leaves, promotions and when they happen"
    }
  ],
  "paths": {
    "/v1/health": {
      "get": {
        "tags": [
          "Meta"
        ],
        "summary": "Health check (no auth)",
        "security": [],
        "responses": {
          "200": {
            "description": "Service is up",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          }
        }
      }
    },
    "/v1/whoami": {
      "get": {
        "tags": [
          "Meta"
        ],
        "summary": "Check a key and see which app it belongs to",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "app": {
                      "type": "string",
                      "description": "App key name, \"master\" for the main key, or \"dashboard\"",
                      "example": "crm"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/stats": {
      "get": {
        "tags": [
          "Counts"
        ],
        "summary": "Overall totals plus every channel's stats",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "timezone": {
                      "type": "string",
                      "example": "UTC"
                    },
                    "overall": {
                      "$ref": "#/components/schemas/Stats"
                    },
                    "channels": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ChannelWithStats"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "parameters": [
          {
            "name": "visibility",
            "in": "query",
            "description": "Only one list; everything by default, removed channels included",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "listed",
                "private",
                "public"
              ],
              "default": "all"
            }
          }
        ]
      }
    },
    "/v1/count": {
      "get": {
        "tags": [
          "Counts"
        ],
        "summary": "Number of requests in a time range",
        "description": "The simplest integration call. Leave out `channel_id` to count across all channels, and leave out `from` and `to` to count all time.",
        "parameters": [
          {
            "name": "channel_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "example": "-1001234567890",
            "description": "Telegram chat id, `all` (default), `private` or `public`"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "channel_id": {
                      "type": "integer",
                      "format": "int64",
                      "description": "0 means all channels"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "from": {
                      "type": "string",
                      "format": "date-time",
                      "nullable": true
                    },
                    "to": {
                      "type": "string",
                      "format": "date-time",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/channels": {
      "get": {
        "tags": [
          "Channels"
        ],
        "summary": "All tracked channels with their stats",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "channels": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ChannelWithStats"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "parameters": [
          {
            "name": "visibility",
            "in": "query",
            "description": "Only one list; everything by default, removed channels included",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "listed",
                "private",
                "public"
              ],
              "default": "all"
            }
          }
        ]
      }
    },
    "/v1/channels/{id}": {
      "get": {
        "tags": [
          "Channels"
        ],
        "summary": "One channel's stats, with an optional custom-range count",
        "parameters": [
          {
            "$ref": "#/components/parameters/ChannelID"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          }
        ],
        "responses": {
          "200": {
            "description": "OK. `range` is only present when `from` or `to` is given.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "channel": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/Channel"
                        }
                      ],
                      "nullable": true
                    },
                    "stats": {
                      "$ref": "#/components/schemas/Stats"
                    },
                    "range": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "integer"
                        },
                        "from": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true
                        },
                        "to": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/channels/{id}/daily": {
      "get": {
        "tags": [
          "Channels"
        ],
        "summary": "Requests per day, zero-filled, oldest first",
        "parameters": [
          {
            "$ref": "#/components/parameters/ChannelID"
          },
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 366,
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "channel_id": {
                      "type": "integer",
                      "format": "int64"
                    },
                    "timezone": {
                      "type": "string"
                    },
                    "days": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string",
                            "example": "2026-11-27"
                          },
                          "count": {
                            "type": "integer"
                          },
                          "joins": {
                            "type": "integer"
                          },
                          "leaves": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/channels/{id}/requests": {
      "get": {
        "tags": [
          "Channels"
        ],
        "summary": "Paginated list of individual requests, newest first",
        "parameters": [
          {
            "$ref": "#/components/parameters/ChannelID"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "approved",
                "declined"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Query"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "$ref": "#/components/parameters/Tag"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer",
                      "description": "Matching requests across all pages"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    },
                    "requests": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Request"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/channels/{id}/requests.csv": {
      "get": {
        "tags": [
          "Channels"
        ],
        "summary": "Export matching requests as CSV (same filters, no paging)",
        "parameters": [
          {
            "$ref": "#/components/parameters/ChannelID"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "approved",
                "declined"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Query"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Tag"
          }
        ],
        "responses": {
          "200": {
            "description": "CSV file",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/channels/{id}/links": {
      "get": {
        "tags": [
          "Channels"
        ],
        "summary": "Request counts grouped by invite link, busiest first",
        "parameters": [
          {
            "$ref": "#/components/parameters/ChannelID"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "channel_id": {
                      "type": "integer",
                      "format": "int64"
                    },
                    "links": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LinkCount"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/channels/{id}/events": {
      "get": {
        "tags": [
          "Activity"
        ],
        "summary": "Joins, leaves and promotions, newest first",
        "parameters": [
          {
            "$ref": "#/components/parameters/ChannelID"
          },
          {
            "$ref": "#/components/parameters/EventType"
          },
          {
            "$ref": "#/components/parameters/Query"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "$ref": "#/components/parameters/Tag"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Event"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/channels/{id}/events.csv": {
      "get": {
        "tags": [
          "Activity"
        ],
        "summary": "Export events as CSV (with weekday and hour columns)",
        "parameters": [
          {
            "$ref": "#/components/parameters/ChannelID"
          },
          {
            "$ref": "#/components/parameters/EventType"
          },
          {
            "$ref": "#/components/parameters/Query"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Tag"
          }
        ],
        "responses": {
          "200": {
            "description": "CSV file",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/channels/{id}/hours": {
      "get": {
        "tags": [
          "Activity"
        ],
        "summary": "When people request or join: hour-of-week breakdown",
        "parameters": [
          {
            "$ref": "#/components/parameters/ChannelID"
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "requests",
                "joins"
              ],
              "default": "requests"
            }
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Tag"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "channel_id": {
                      "type": "integer",
                      "format": "int64"
                    },
                    "hours": {
                      "$ref": "#/components/schemas/HourWeek"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/channels/{id}/invite-links": {
      "get": {
        "tags": [
          "Invite links"
        ],
        "summary": "Links created by the bot, with join and promotion counts",
        "parameters": [
          {
            "$ref": "#/components/parameters/ChannelID"
          },
          {
            "$ref": "#/components/parameters/Tag"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "channel_id": {
                      "type": "integer",
                      "format": "int64"
                    },
                    "invite_links": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BotLink"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "post": {
        "tags": [
          "Invite links"
        ],
        "summary": "Create an invite link through the bot",
        "description": "Needs the API key in a header (cookies and ?api_key= are refused). make_admin links need the main API key and the bot must hold \"Add new admins\". Anyone who joins through a make_admin link becomes an admin, so prefer member_limit: 1 or a short expiry.",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInviteLink"
              },
              "example": {
                "name": "vip-admins",
                "make_admin": true,
                "rights": "poster",
                "member_limit": 1,
                "expires_in": 86400,
                "tag": "tessera"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "invite_link": {
                      "$ref": "#/components/schemas/BotLink"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "make_admin with a per-app key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "502": {
            "description": "Telegram refused (e.g. the bot lacks the right)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/invite-links/{link_id}/revoke": {
      "post": {
        "tags": [
          "Invite links"
        ],
        "summary": "Revoke a bot-created link",
        "description": "API key in a header. make_admin links need the main key.",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "link_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "invite_link": {
                      "$ref": "#/components/schemas/BotLink"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Admin link with a per-app key"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "502": {
            "description": "Telegram refused"
          }
        }
      }
    },
    "/v1/tags": {
      "get": {
        "tags": [
          "Invite links"
        ],
        "summary": "Bot links grouped by tag: links, requests, joins and promotions per integration",
        "parameters": [
          {
            "name": "channel_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Telegram chat id, `all` (default), `private` or `public`"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "channel_id": {
                      "type": "integer",
                      "format": "int64"
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TagStats"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/channels/{id}/link": {
      "get": {
        "tags": [
          "Channels"
        ],
        "summary": "The link to share for a channel",
        "description": "link is the public t.me address, else the primary invite link (from getChat), else the newest working link the bot made; kind says which. Never creates or exports a link.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "channel_id": {
                      "type": "integer",
                      "format": "int64"
                    },
                    "title": {
                      "type": "string"
                    },
                    "link": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "public",
                        "primary",
                        "bot"
                      ]
                    },
                    "public_link": {
                      "type": "string"
                    },
                    "primary_link": {
                      "type": "string"
                    },
                    "bot_links": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BotLink"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/channels/{id}/requests/approve": {
      "post": {
        "tags": [
          "Join requests"
        ],
        "summary": "Approve pending join requests through Telegram",
        "description": "API key in a header (or LOCAL_NO_KEY from this machine). Give user_ids, or all_pending (optionally only through one tag or invite_link), oldest first, at most 200. Each user is approved in Telegram, then recorded; users Telegram refuses are reported in results. The bot needs the invite-users admin right.",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "user_ids": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "format": "int64"
                    }
                  },
                  "all_pending": {
                    "type": "boolean"
                  },
                  "tag": {
                    "type": "string",
                    "description": "With all_pending: only requests through bot links with this tag"
                  },
                  "invite_link": {
                    "type": "string",
                    "description": "With all_pending: only requests through this link"
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200,
                    "description": "With all_pending; default 100"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "approved": {
                      "type": "integer"
                    },
                    "failed": {
                      "type": "integer"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "user_id": {
                            "type": "integer",
                            "format": "int64"
                          },
                          "request_id": {
                            "type": "integer"
                          },
                          "ok": {
                            "type": "boolean"
                          },
                          "error": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "No users, both user_ids and all_pending, or more than 200"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "description": "No Telegram on this server (dev server)"
          }
        }
      }
    },
    "/v1/channels/{id}/requests/decline": {
      "post": {
        "tags": [
          "Join requests"
        ],
        "summary": "Decline pending join requests through Telegram",
        "description": "API key in a header (or LOCAL_NO_KEY from this machine). Give user_ids, or all_pending (optionally only through one tag or invite_link), oldest first, at most 200. Each user is declined in Telegram, then recorded; users Telegram refuses are reported in results. The bot needs the invite-users admin right.",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "user_ids": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "format": "int64"
                    }
                  },
                  "all_pending": {
                    "type": "boolean"
                  },
                  "tag": {
                    "type": "string",
                    "description": "With all_pending: only requests through bot links with this tag"
                  },
                  "invite_link": {
                    "type": "string",
                    "description": "With all_pending: only requests through this link"
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200,
                    "description": "With all_pending; default 100"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "declined": {
                      "type": "integer"
                    },
                    "failed": {
                      "type": "integer"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "user_id": {
                            "type": "integer",
                            "format": "int64"
                          },
                          "request_id": {
                            "type": "integer"
                          },
                          "ok": {
                            "type": "boolean"
                          },
                          "error": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "No users, both user_ids and all_pending, or more than 200"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "description": "No Telegram on this server (dev server)"
          }
        }
      }
    },
    "/v1/public/channels": {
      "get": {
        "tags": [
          "Channels"
        ],
        "summary": "Public channels with joins and post views",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "timezone": {
                      "type": "string"
                    },
                    "overall": {
                      "type": "object",
                      "properties": {
                        "stats": {
                          "$ref": "#/components/schemas/Stats"
                        },
                        "views": {
                          "$ref": "#/components/schemas/ViewSummary"
                        }
                      }
                    },
                    "channels": {
                      "type": "array",
                      "items": {
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/ChannelWithStats"
                          },
                          {
                            "type": "object",
                            "properties": {
                              "views": {
                                "$ref": "#/components/schemas/ViewSummary"
                              }
                            }
                          }
                        ]
                      }
                    },
                    "tracking": {
                      "type": "string",
                      "enum": [
                        "off",
                        "starting",
                        "on",
                        "error"
                      ],
                      "description": "State of post-view tracking; tells `no data` apart from zero"
                    },
                    "tracking_error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown API key"
          }
        }
      }
    },
    "/v1/channels/{id}/posts": {
      "get": {
        "tags": [
          "Channels"
        ],
        "summary": "Posts with their exact view counts",
        "parameters": [
          {
            "$ref": "#/components/parameters/ChannelID"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "date",
                "views"
              ],
              "default": "date"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "channel_id": {
                      "type": "integer"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Post"
                      }
                    },
                    "tracking": {
                      "type": "string",
                      "enum": [
                        "off",
                        "starting",
                        "on",
                        "error"
                      ],
                      "description": "State of post-view tracking; tells `no data` apart from zero"
                    },
                    "tracking_error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown API key"
          }
        }
      }
    },
    "/v1/channels/{id}/posts/{message_id}": {
      "get": {
        "tags": [
          "Channels"
        ],
        "summary": "One post with its view samples over time",
        "parameters": [
          {
            "$ref": "#/components/parameters/ChannelID"
          },
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "post": {
                      "$ref": "#/components/schemas/Post"
                    },
                    "tracking": {
                      "type": "string",
                      "enum": [
                        "off",
                        "starting",
                        "on",
                        "error"
                      ],
                      "description": "State of post-view tracking; tells `no data` apart from zero"
                    },
                    "tracking_error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown API key"
          },
          "404": {
            "description": "Post not found"
          }
        }
      }
    },
    "/v1/channels/{id}/views/daily": {
      "get": {
        "tags": [
          "Channels"
        ],
        "summary": "Views gained and posts published per day, zero-filled, oldest first",
        "parameters": [
          {
            "$ref": "#/components/parameters/ChannelID"
          },
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 366,
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "channel_id": {
                      "type": "integer"
                    },
                    "timezone": {
                      "type": "string"
                    },
                    "days": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string"
                          },
                          "views": {
                            "type": "integer"
                          },
                          "posts": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "tracking": {
                      "type": "string",
                      "enum": [
                        "off",
                        "starting",
                        "on",
                        "error"
                      ],
                      "description": "State of post-view tracking; tells `no data` apart from zero"
                    },
                    "tracking_error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown API key"
          }
        }
      }
    },
    "/v1/channels/{id}/remove": {
      "post": {
        "tags": [
          "Channels"
        ],
        "summary": "Remove a channel: the bot leaves it and it disappears from the lists",
        "description": "History is kept, and adding the bot again brings the channel back. Owner only: the main API key or the Android app. Removing a channel twice, or one the bot has already left, succeeds.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ChannelID"
          }
        ],
        "responses": {
          "200": {
            "description": "Removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "channel": {
                      "$ref": "#/components/schemas/Channel"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown API key"
          },
          "403": {
            "description": "Not the owner"
          },
          "404": {
            "description": "Channel not found"
          },
          "502": {
            "description": "Telegram refused or could not be reached; nothing changed"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "apiKeyQuery": {
        "type": "apiKey",
        "in": "query",
        "name": "api_key"
      }
    },
    "parameters": {
      "ChannelID": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "Telegram chat id, `all`, or a list: `private`, `public` or `listed` (both, without removed channels)",
        "schema": {
          "type": "string"
        },
        "example": "-1001234567890"
      },
      "From": {
        "name": "from",
        "in": "query",
        "description": "Inclusive start (RFC3339 or YYYY-MM-DD)",
        "schema": {
          "type": "string"
        },
        "example": "2026-11-01"
      },
      "To": {
        "name": "to",
        "in": "query",
        "description": "Exclusive end for RFC3339; a YYYY-MM-DD value includes that whole day",
        "schema": {
          "type": "string"
        },
        "example": "2026-11-30"
      },
      "Query": {
        "name": "q",
        "in": "query",
        "description": "Search: exact user id, or part of a name, @username or invite-link name",
        "schema": {
          "type": "string"
        },
        "example": "alice"
      },
      "EventType": {
        "name": "type",
        "in": "query",
        "schema": {
          "type": "string",
          "enum": [
            "joined",
            "left",
            "kicked",
            "role_changed",
            "promoted",
            "promote_failed"
          ]
        }
      },
      "Tag": {
        "name": "tag",
        "in": "query",
        "description": "Only items that came through bot links with this tag",
        "schema": {
          "type": "string"
        },
        "example": "tessera"
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "No key sent (code missing_key) or the key is not valid on this server (code unknown_key: old, revoked or from another install).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "BadRequest": {
        "description": "Invalid parameter",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "Channel not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "example": false
          },
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "enum": [
              "missing_key",
              "unknown_key"
            ],
            "description": "Only on 401"
          },
          "hint": {
            "type": "string",
            "description": "What to do about it (401 only)"
          }
        }
      },
      "Health": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "uptime_seconds": {
            "type": "integer"
          },
          "channels": {
            "type": "integer"
          },
          "total_requests": {
            "type": "integer"
          },
          "bot": {
            "type": "string",
            "description": "The bot's @username"
          }
        }
      },
      "Stats": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "description": "All requests ever received"
          },
          "pending": {
            "type": "integer",
            "description": "Not yet seen joining and not superseded"
          },
          "approved": {
            "type": "integer",
            "description": "The user joined after the request"
          },
          "declined": {
            "type": "integer",
            "description": "Inferred: the same user sent a newer request, so this one was declined or withdrawn"
          },
          "unique_users": {
            "type": "integer"
          },
          "today": {
            "type": "integer",
            "description": "Since local midnight in the server timezone"
          },
          "yesterday": {
            "type": "integer",
            "description": "The previous calendar day"
          },
          "last_7d": {
            "type": "integer",
            "description": "Rolling last 7×24 hours"
          },
          "prev_7d": {
            "type": "integer",
            "description": "The 7×24 hours before last_7d"
          },
          "last_30d": {
            "type": "integer",
            "description": "Rolling last 30×24 hours"
          },
          "prev_30d": {
            "type": "integer",
            "description": "The 30×24 hours before last_30d"
          },
          "last_request_at": {
            "type": "string",
            "format": "date-time"
          },
          "joined": {
            "type": "integer",
            "description": "Membership joins of any kind (all time)"
          },
          "left": {
            "type": "integer",
            "description": "Leaves + kicks (all time)"
          },
          "joined_today": {
            "type": "integer"
          },
          "joined_7d": {
            "type": "integer"
          },
          "joined_yesterday": {
            "type": "integer",
            "description": "Joins on the previous calendar day"
          },
          "joined_prev_7d": {
            "type": "integer",
            "description": "Joins in the 7 days before the last 7"
          },
          "left_today": {
            "type": "integer",
            "description": "Leaves and kicks today"
          },
          "left_7d": {
            "type": "integer",
            "description": "Leaves and kicks in the last 7 days"
          }
        }
      },
      "Channel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "example": -1001234567890
          },
          "title": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "example": "channel"
          },
          "active": {
            "type": "boolean",
            "description": "False once the bot is removed or loses admin rights"
          },
          "added_by": {
            "type": "integer",
            "format": "int64"
          },
          "added_at": {
            "type": "string",
            "format": "date-time"
          },
          "removed_at": {
            "type": "string",
            "format": "date-time"
          },
          "is_public": {
            "type": "boolean",
            "description": "A broadcast channel with an @username; listed under `public`"
          },
          "hidden": {
            "type": "boolean",
            "description": "Removed by the owner: in no list, history kept"
          }
        }
      },
      "ChannelWithStats": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Channel"
          },
          {
            "type": "object",
            "properties": {
              "stats": {
                "$ref": "#/components/schemas/Stats"
              }
            }
          }
        ]
      },
      "Request": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "channel_id": {
            "type": "integer",
            "format": "int64"
          },
          "user_id": {
            "type": "integer",
            "format": "int64"
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "language_code": {
            "type": "string"
          },
          "is_premium": {
            "type": "boolean"
          },
          "bio": {
            "type": "string"
          },
          "invite_link": {
            "type": "string"
          },
          "invite_name": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "declined"
            ]
          },
          "resolved_at": {
            "type": "string",
            "format": "date-time"
          },
          "channel_title": {
            "type": "string",
            "description": "Channel name when the request arrived"
          },
          "is_bot": {
            "type": "boolean"
          },
          "user_chat_id": {
            "type": "integer",
            "format": "int64"
          },
          "invite_creator_id": {
            "type": "integer",
            "format": "int64"
          },
          "invite_creates_join_request": {
            "type": "boolean"
          },
          "bot_link_id": {
            "type": "integer",
            "format": "int64"
          },
          "approved_by": {
            "type": "integer",
            "format": "int64",
            "description": "Admin who approved, when known"
          },
          "joined_at": {
            "type": "string",
            "format": "date-time"
          },
          "link_tag": {
            "type": "string",
            "description": "Tag of the bot link used, if any"
          }
        }
      },
      "LinkCount": {
        "type": "object",
        "properties": {
          "invite_link": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "pending": {
            "type": "integer"
          },
          "approved": {
            "type": "integer"
          },
          "declined": {
            "type": "integer"
          }
        }
      },
      "Event": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "channel_id": {
            "type": "integer",
            "format": "int64"
          },
          "channel_title": {
            "type": "string"
          },
          "user_id": {
            "type": "integer",
            "format": "int64"
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "language_code": {
            "type": "string"
          },
          "is_premium": {
            "type": "boolean"
          },
          "is_bot": {
            "type": "boolean"
          },
          "type": {
            "type": "string",
            "enum": [
              "joined",
              "left",
              "kicked",
              "role_changed",
              "promoted",
              "promote_failed"
            ]
          },
          "date": {
            "type": "string",
            "format": "date-time"
          },
          "old_status": {
            "type": "string"
          },
          "new_status": {
            "type": "string"
          },
          "invite_link": {
            "type": "string"
          },
          "invite_name": {
            "type": "string"
          },
          "via_join_request": {
            "type": "boolean"
          },
          "via_folder_link": {
            "type": "boolean"
          },
          "actor_id": {
            "type": "integer",
            "format": "int64",
            "description": "Who made the change (the user themselves, or an admin)"
          },
          "request_id": {
            "type": "integer",
            "format": "int64",
            "description": "The join request this join completed"
          },
          "bot_link_id": {
            "type": "integer",
            "format": "int64",
            "description": "Set when they came in through a bot-created link"
          },
          "detail": {
            "type": "string",
            "description": "Granted rights for promoted; the error for promote_failed"
          },
          "link_tag": {
            "type": "string",
            "description": "Tag of the bot link used, if any"
          },
          "via": {
            "type": "string",
            "enum": [
              "public_link",
              "invite_link",
              "join_request",
              "folder_link",
              "added",
              "unknown"
            ],
            "description": "How a join happened (type `joined` only)"
          }
        }
      },
      "HourWeek": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "requests",
              "joins"
            ]
          },
          "timezone": {
            "type": "string"
          },
          "weekdays": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "Mon",
              "Tue",
              "Wed",
              "Thu",
              "Fri",
              "Sat",
              "Sun"
            ]
          },
          "matrix": {
            "type": "array",
            "description": "7 rows (Mon→Sun) × 24 hours",
            "items": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            }
          },
          "by_hour": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "by_weekday": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "total": {
            "type": "integer"
          },
          "peak_hour": {
            "type": "integer",
            "description": "0-23, or -1 when empty"
          },
          "peak_weekday": {
            "type": "string"
          },
          "tag": {
            "type": "string"
          }
        }
      },
      "BotLink": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "channel_id": {
            "type": "integer",
            "format": "int64"
          },
          "channel_title": {
            "type": "string"
          },
          "invite_link": {
            "type": "string",
            "example": "https://t.me/+AbCdEf"
          },
          "name": {
            "type": "string"
          },
          "creates_join_request": {
            "type": "boolean"
          },
          "member_limit": {
            "type": "integer"
          },
          "expire_date": {
            "type": "string",
            "format": "date-time"
          },
          "make_admin": {
            "type": "boolean"
          },
          "rights": {
            "type": "string",
            "enum": [
              "poster",
              "manager",
              "full"
            ]
          },
          "tag": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9._:/-]{0,63}$",
            "description": "What the link is for: which integration / campaign. Lower-cased on save.",
            "example": "tessera"
          },
          "meta": {
            "type": "object",
            "maxProperties": 16,
            "additionalProperties": {
              "type": "string",
              "maxLength": 256
            },
            "description": "Free-form references for the caller (keys [A-Za-z0-9_.-]{1,40})",
            "example": {
              "chat_id": "42",
              "campaign": "summer"
            }
          },
          "created_by": {
            "type": "string",
            "description": "API key name that created it (\"master\" = main key)"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "revoked_at": {
            "type": "string",
            "format": "date-time"
          },
          "requests": {
            "type": "integer"
          },
          "joins": {
            "type": "integer"
          },
          "promoted": {
            "type": "integer"
          },
          "promote_failed": {
            "type": "integer"
          }
        }
      },
      "CreateInviteLink": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 32
          },
          "make_admin": {
            "type": "boolean",
            "default": false,
            "description": "Promote everyone who joins through this link. Main API key only."
          },
          "rights": {
            "type": "string",
            "enum": [
              "poster",
              "manager",
              "full"
            ],
            "default": "poster",
            "description": "poster: post/edit/delete/pin messages + stories. manager: poster + invite users, manage chat, video chats. full: everything except adding admins. Limited to rights the bot itself has."
          },
          "member_limit": {
            "type": "integer",
            "minimum": 0,
            "maximum": 99999,
            "description": "Max joins; 1 = single-use. Not allowed with join_request."
          },
          "expires_in": {
            "type": "integer",
            "description": "Seconds from now"
          },
          "expire_date": {
            "type": "string",
            "format": "date-time"
          },
          "join_request": {
            "type": "boolean",
            "description": "Joiners must be approved by an admin first (they are promoted after approval)"
          },
          "tag": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9._:/-]{0,63}$",
            "description": "What the link is for: which integration / campaign. Lower-cased on save.",
            "example": "tessera"
          },
          "meta": {
            "type": "object",
            "maxProperties": 16,
            "additionalProperties": {
              "type": "string",
              "maxLength": 256
            },
            "description": "Free-form references for the caller (keys [A-Za-z0-9_.-]{1,40})",
            "example": {
              "chat_id": "42",
              "campaign": "summer"
            }
          }
        }
      },
      "TagStats": {
        "type": "object",
        "properties": {
          "tag": {
            "type": "string",
            "description": "\"\" groups untagged links"
          },
          "links": {
            "type": "integer"
          },
          "active_links": {
            "type": "integer"
          },
          "admin_links": {
            "type": "integer"
          },
          "channels": {
            "type": "integer"
          },
          "requests": {
            "type": "integer"
          },
          "joins": {
            "type": "integer"
          },
          "promoted": {
            "type": "integer"
          },
          "last_link_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Post": {
        "type": "object",
        "properties": {
          "channel_id": {
            "type": "integer",
            "format": "int64"
          },
          "message_id": {
            "type": "integer"
          },
          "date": {
            "type": "string",
            "format": "date-time"
          },
          "text": {
            "type": "string"
          },
          "forwarded": {
            "type": "boolean",
            "description": "Shows the original channel's counter; left out of totals and averages"
          },
          "baseline": {
            "type": "boolean",
            "description": "Found after it already had views; only later increases count as gained"
          },
          "views": {
            "type": "integer",
            "nullable": true,
            "description": "Exact count at checked_at; null until first checked"
          },
          "checked_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "views_1h": {
            "type": "integer",
            "nullable": true
          },
          "views_24h": {
            "type": "integer",
            "nullable": true
          },
          "views_48h": {
            "type": "integer",
            "nullable": true,
            "description": "Null when it was not observed within 15 minutes of that age"
          },
          "deleted_at": {
            "type": "string",
            "format": "date-time"
          },
          "group_id": {
            "type": "string",
            "description": "Album id; an album is one post"
          },
          "samples": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "t": {
                  "type": "string",
                  "format": "date-time"
                },
                "v": {
                  "type": "integer"
                }
              }
            },
            "description": "Only on the single-post endpoint: time and count of each change"
          }
        }
      },
      "ViewSummary": {
        "type": "object",
        "nullable": true,
        "description": "Null while tracking is off",
        "properties": {
          "posts": {
            "type": "integer"
          },
          "posts_7d": {
            "type": "integer"
          },
          "views_today": {
            "type": "integer"
          },
          "views_yesterday": {
            "type": "integer"
          },
          "views_7d": {
            "type": "integer"
          },
          "views_prev_7d": {
            "type": "integer"
          },
          "avg_views_24h": {
            "type": "integer",
            "nullable": true
          },
          "avg_24h_posts": {
            "type": "integer"
          },
          "last_post_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      }
    }
  }
}
