> ## Documentation Index
> Fetch the complete documentation index at: https://docs.urldna.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Query

> Update the name or filters of an existing saved query.



## OpenAPI

````yaml PUT /v1/query/{query_id}
openapi: 3.1.0
info:
  title: urlDNA API
  description: >-
    urlDNA API documentation. This API allows you to scan, analyze, and retrieve
    insights about URLs, helping to detect potential threats such as phishing,
    malware, and scams.
  version: 1.0.0
servers:
  - url: https://api.urldna.io
security: []
paths:
  /v1/query/{query_id}:
    put:
      tags:
        - My Queries
      summary: Update Query
      description: Update the name or filters of an existing saved query.
      operationId: update_query_v1_query__query_id__put
      parameters:
        - name: query_id
          in: path
          required: true
          schema:
            type: string
            title: Query Id
        - name: authorization
          in: header
          required: true
          schema:
            type: string
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EdiQueryRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Query'
        '401':
          description: 'Unauthorized: API Key is missing or invalid.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '404':
          description: 'Not Found: Object not found.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '405':
          description: >-
            Method Not Allowed: The requested HTTP method is not supported for
            this endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '422':
          description: 'Unprocessable Entity: The request body or parameters are invalid.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '429':
          description: 'Too Many Requests: Rate limit exceeded.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '500':
          description: 'Internal Server Error: An unexpected error occurred.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
components:
  schemas:
    EdiQueryRequest:
      properties:
        name:
          type: string
          title: Name
          description: Updated query name.
        query_filters:
          items:
            $ref: '#/components/schemas/QueryFilter'
          type: array
          title: Query Filters
          description: Updated array of filter conditions.
      type: object
      required:
        - name
        - query_filters
      title: EdiQueryRequest
    Query:
      properties:
        id:
          type: string
          title: Id
          description: Unique query identifier.
        name:
          type: string
          title: Name
          description: User-defined query name for easy identification.
        query_filters:
          items:
            $ref: '#/components/schemas/QueryFilter'
          type: array
          title: Query Filters
          description: Array of filter conditions combined with logical AND.
      type: object
      required:
        - id
        - name
        - query_filters
      title: Query
    APIError:
      properties:
        detail:
          type: string
          title: Detail
          example: Error description message
      type: object
      required:
        - detail
      title: APIError
    QueryFilter:
      properties:
        attribute:
          type: string
          title: Attribute
          description: >-
            Searchable attribute field (e.g., domain, ip, country_code,
            technology).
        operator:
          $ref: '#/components/schemas/QueryOperatorEnum'
          description: >-
            Comparison operator: '=' and '!=' for exact matching; 'LIKE' and
            '!LIKE' for partial/wildcard matching.
        value:
          type: string
          title: Value
          description: Value to match against the specified attribute.
        logical_operator:
          anyOf:
            - $ref: '#/components/schemas/QueryLogicalOperatorEnum'
            - type: 'null'
          description: Logical operator for combining filter conditions.
      type: object
      required:
        - attribute
        - operator
        - value
      title: QueryFilter
    QueryOperatorEnum:
      type: string
      enum:
        - '='
        - '!='
        - LIKE
        - '!LIKE'
      title: QueryOperatorEnum
    QueryLogicalOperatorEnum:
      type: string
      enum:
        - AND
        - OR
      title: QueryLogicalOperatorEnum

````