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

# Search and filter policies

> Deprecated as of: 2026-06-04. Scheduled for removal: 2026-09-04. Replacement: POST /policy/query. Please migrate to the DrafttQL query endpoint for advanced filtering, field selection, and cursor-based pagination.



## OpenAPI

````yaml https://api.draftt.io/swagger post /policy/search
openapi: 3.1.0
info:
  title: Draftt API
  version: 0.2.1
servers:
  - url: https://api.draftt.io/v1
security:
  - BearerAuth: []
paths:
  /policy/search:
    post:
      tags:
        - Policy
      summary: Search and filter policies
      description: >-
        Deprecated as of: 2026-06-04. Scheduled for removal: 2026-09-04.
        Replacement: POST /policy/query. Please migrate to the DrafttQL query
        endpoint for advanced filtering, field selection, and cursor-based
        pagination.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                filter:
                  type: object
                  properties:
                    name:
                      type: string
                    description:
                      type: string
                    createdAt:
                      $ref: '#/components/schemas/SearchCreatedAt'
                    updatedAt:
                      $ref: '#/components/schemas/SearchUpdatedAt'
                  example:
                    name: End Of Life
                sort:
                  type: object
                  properties:
                    name:
                      type: string
                      enum:
                        - asc
                        - desc
                    description:
                      type: string
                      enum:
                        - asc
                        - desc
                    createdAt:
                      type: string
                      enum:
                        - asc
                        - desc
                    updatedAt:
                      type: string
                      enum:
                        - asc
                        - desc
                  example:
                    createdAt: asc
                nextToken:
                  type: string
                  example: eyJza2lwIjoxMH0
                pageSize:
                  type: integer
                  minimum: 1
                  maximum: 100
                  default: 10
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Policy'
                  nextToken:
                    type: string
                  totalCount:
                    type: integer
                    example: 12
                required:
                  - items
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
      deprecated: true
components:
  schemas:
    SearchCreatedAt:
      type: object
      properties:
        eq:
          type: string
          format: date-time
        gt:
          type: string
          format: date-time
        gte:
          type: string
          format: date-time
        lt:
          type: string
          format: date-time
        lte:
          type: string
          format: date-time
      example:
        gte: '2024-01-01T00:00:00Z'
        lt: '2024-12-31T23:59:59Z'
    SearchUpdatedAt:
      type: object
      properties:
        eq:
          type: string
          format: date-time
        gt:
          type: string
          format: date-time
        gte:
          type: string
          format: date-time
        lt:
          type: string
          format: date-time
        lte:
          type: string
          format: date-time
      example:
        gte: '2024-01-01T00:00:00Z'
        lt: '2024-12-31T23:59:59Z'
    Policy:
      type: object
      properties:
        id:
          type: number
        name:
          type: string
        description:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - name
      example:
        id: 1
        name: End Of Life
        description: All components should be in the supported version
        createdAt: '2024-05-06T11:25:51.513Z'
        updatedAt: '2024-09-09T19:35:31.898Z'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
          required:
            - message
      required:
        - error
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: Too Many Requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````