---
title: "Update a restriction query"
method: PATCH
path: "/api/v2/logs/config/restriction_queries/{restriction_query_id}"
tags: ["Logs Restriction Queries"]
---

# Update a restriction query

`PATCH /api/v2/logs/config/restriction_queries/{restriction_query_id}`

Edit a restriction query.

## Path parameters

- `restriction_query_id` string, required

## Request body

- RestrictionQueryUpdatePayload — Update a restriction query.
  - `data` RestrictionQueryUpdateData — Data related to the update of a restriction query.
    - `attributes` RestrictionQueryUpdateAttributes — Attributes of the edited restriction query.
      - `restriction_query` string, required — The restriction query.
    - `type` 'logs_restriction_queries' — Restriction query resource type.

## Response `200`

OK

- RestrictionQueryWithoutRelationshipsResponse — Response containing information about a single restriction query.
  - `data` RestrictionQueryWithoutRelationships — Restriction query object returned by the API.
    - `attributes` RestrictionQueryAttributes — Attributes of the restriction query.
      - `created_at` string, date-time — Creation time of the restriction query.
      - `last_modifier_email` string — Email of the user who last modified this restriction query.
      - `last_modifier_name` string — Name of the user who last modified this restriction query.
      - `modified_at` string, date-time — Time of last restriction query modification.
      - `restriction_query` string — The query that defines the restriction. Only the content matching the query can be returned.
      - `role_count` integer — Number of roles associated with this restriction query.
      - `user_count` integer — Number of users associated with this restriction query.
    - `id` string — ID of the restriction query.
    - `type` string — Restriction queries type.

## Other responses

- `400` — Bad Request
- `403` — Authentication error
- `404` — Not found
- `429` — Too many requests

---

[API](https://skmtc.dev/datadog/apis/api-v2.md) · [All operations](https://skmtc.dev/datadog/apis/api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/datadog/api-v2/revisions/da68bf029e4c/schema)
