# Update Statistics Report

Updates a statistics report; omitted settings stay, a tag list replaces the current one. The app's chart shows the change at once; contacts are not changed. Read the current settings and numbers with get-statistics-report.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "ID of the report, from search-statistics-reports or create-statistics-report",
      "minimum": 1
    },
    "name": {
      "type": [
        "null",
        "string"
      ],
      "description": "New name of the report",
      "default": null,
      "minLength": 1,
      "maxLength": 250
    },
    "tagIds": {
      "type": "array",
      "description": "IDs of the tags the report counts; replaces the current ones; a repeated ID is stored once",
      "default": null,
      "items": {
        "type": "integer",
        "minimum": 1
      },
      "minItems": 1
    },
    "chart": {
      "type": [
        "null",
        "string"
      ],
      "description": "progress, continuous or total",
      "default": null,
      "enum": [
        "progress",
        "continuous",
        "total"
      ]
    },
    "granularity": {
      "type": [
        "null",
        "string"
      ],
      "description": "hour, day, month or year",
      "default": null,
      "enum": [
        "hour",
        "day",
        "month",
        "year"
      ]
    },
    "rangeFrom": {
      "type": [
        "null",
        "string"
      ],
      "description": "First day of the range as a calendar date YYYY-MM-DD, not after rangeTo, or 0 for no start",
      "default": null,
      "pattern": "^(\\d{4}-\\d{2}-\\d{2}|0)$"
    },
    "rangeTo": {
      "type": [
        "null",
        "string"
      ],
      "description": "Last day of the range as a calendar date YYYY-MM-DD, not before rangeFrom, or 0 for today",
      "default": null,
      "pattern": "^(\\d{4}-\\d{2}-\\d{2}|0)$"
    },
    "metaLabels": {
      "type": "array",
      "description": "Labels of the report; replaces the current ones",
      "default": null,
      "items": {
        "type": "string",
        "maxLength": 250
      }
    },
    "notes": {
      "type": [
        "null",
        "string"
      ],
      "description": "Internal note",
      "default": null,
      "maxLength": 1000
    },
    "accountId": {
      "type": [
        "null",
        "integer"
      ],
      "description": "User ID of the account; omit for the account of the access token",
      "default": null,
      "minimum": 1
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false
}
```

## Output schema:

```json
{
  "type": "object",
  "required": [
    "accountId",
    "type",
    "id",
    "settings",
    "ui"
  ],
  "properties": {
    "accountId": {
      "type": "integer"
    },
    "type": {
      "type": "string"
    },
    "id": {
      "type": "integer"
    },
    "settings": {
      "type": "object"
    },
    "ui": {
      "type": "object"
    }
  },
  "additionalProperties": false
}
```

