---
title: "Update query"
method: PATCH
path: "/api/v1/services/stats/query/{id}"
tags: ["stats_service"]
---

# Update query

`PATCH /api/v1/services/stats/query/{id}`

## Path parameters

- `id` string, required

## Query parameters

- `project_id` integer, required

## Request body

- object
  - `name` string
  - `repeat_interval` integer — cyclic execution of requests

## Response `200`

Query

- StatsQuery
  - `name` string
  - `addresses` string[]
  - `only_between` boolean
  - `sql` string
  - `gpt_message` string
  - `repeat_interval` integer — cyclic execution of requests

## Other responses

- `400` — Something went wrong on client side
- `403` — Access token is missing or invalid
- `404` — The specified resource was not found
- `500` — Something went wrong on server side

## Changes

- **2024-11-06** `dc03bb6c514d` — 3 info
  - added the new optional request property `name`
  - the request property `repeat_interval` became optional
  - added the optional property `name` to the response with the `200` status
- **2023-12-11** `e83620df7542` — 2 info
  - api tag `stats_service` added
  - api tag `db` removed
- **2023-12-04** `b179482c50fc` — 1 info
  - added the optional property `gpt_message` to the response with the `200` status
- **2023-12-01** `068f1873edc4` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/tonkeeper/apis/rest-api-to-ton-console/changes/api/v1/services/stats/query/:id/patch.md)

---

[API](https://skmtc.dev/tonkeeper/apis/rest-api-to-ton-console.md) · [All operations](https://skmtc.dev/tonkeeper/apis/rest-api-to-ton-console/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/tonkeeper/rest-api-to-ton-console/revisions/bffcc11719d3/schema)
