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

# Get a restriction query

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

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/logs/config/restriction_queries/{restriction_query_id}`
- Auth: API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`

Get a restriction query in the organization specified by the restriction query's `restriction_query_id`.

## Path parameters

- `restriction_query_id` string, required

## Response `200`

OK

- RestrictionQueryWithRelationshipsResponse: Response containing information about a single restriction query.
  - `data` RestrictionQueryWithRelationships: 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.
    - `relationships` UserRelationships: Relationships of the user object.
      - `roles` RelationshipToRoles: Relationship to roles.
        - `data` RelationshipToRoleData[]: An array containing type and the unique identifier of a role.
          - `id` string: The unique identifier of the role.
          - `type` 'roles': Roles type.
    - `type` 'logs_restriction_queries': Restriction query resource type.
  - `included` RestrictionQueryResponseIncludedItem[]: Array of objects related to the restriction query.
    - `attributes` RestrictionQueryRoleAttribute, required: Attributes of the role for a restriction query.
      - `name` string: The role name.
    - `id` string, required: ID of the role.
    - `type` 'roles', required: Roles type.

## Other responses

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

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/da68bf029e4c?raw)
