---
title: "Sonar Query"
method: PUT
path: "/api/3/sonar_queries/{id}"
tags: ["Asset Discovery"]
---

# Sonar Query

`PUT /api/3/sonar_queries/{id}`

Updates a sonar query.

## Path parameters

- `id` integer, required — The identifier of the Sonar query.

## Request body

- SonarQuery — The criteria for a Sonar query.
  - `criteria` SonarCriteria — The criteria for a Sonar query.
    - `filters` SonarCriterion[] — The filters in the Sonar query.
      - `days` integer — If the field is `scan-date-within-the-last`, the number of days to search against.
      - `domain` string — If the field is `domain-contains`, the domain to search against.
      - `lower` string — If the field is `ip-address-range`, the lower limit of the search.
      - `type` 'domain-contains' | 'scan-date-within-the-last' | 'ip-address-range' — The type of query to perform.
      - `upper` string — If the field is `ip-address-range`, the upper limit of the search.
  - `id` object — The identifier of the Sonar query.
  - `links` Link[], required — Hypermedia links to corresponding or related resources.
    - `deprecation` string
    - `href` string — A hypertext reference, which is either a URI (see <a target="_blank" rel="noopener noreferrer" href="https://tools.ietf.org/html/rfc3986">RFC 3986</a>) or URI template (see <a target="_blank" rel="noopener noreferrer" href="https://tools.ietf.org/html/rfc6570">RFC 6570</a>).
    - `hreflang` string
    - `media` string
    - `rel` string — The link relation type. This value is one from the <a target="_blank" rel="noopener noreferrer" href="https://tools.ietf.org/html/rfc5988#section-6.2">Link Relation Type Registry</a> or is the type of resource being linked to.
    - `title` string
    - `type` string
  - `name` string — The name of the Sonar query.

## Response `200`

OK

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found
- `500` — Internal Server Error
- `503` — Service Unavailable

---

[API](https://skmtc.net/rapid7/apis/rapid7-vm-api.md) · [All operations](https://skmtc.net/rapid7/apis/rapid7-vm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/rapid7/rapid7-vm-api/versions/3a8197c22d71/schema)
