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

# Search specifications

> Search original specification inputs with a case-insensitive regular expression.

Pass the required `query` parameter as a regular expression. Search applies to the **original input text**, not the generated specification body.

```bash theme={null}
curl --fail-with-body --get https://api.pre.dev/find-specs \
  -H "Authorization: Bearer $PREDEV_API_KEY" \
  --data-urlencode 'query=export|report' \
  --data-urlencode 'status=completed' \
  --data-urlencode 'limit=20'
```

| Query            | Matches                                       |
| ---------------- | --------------------------------------------- |
| `payment`        | Inputs containing payment, case-insensitively |
| `^Build`         | Inputs starting with Build                    |
| `export\|report` | Inputs containing either word                 |

Use `--data-urlencode` or your HTTP library's query encoder so regex characters reach the API intact. Escape regex metacharacters when you intend a literal search.

The `specs`, `total`, and `hasMore` envelope uses the same summary format and pagination as [list specifications](/architect-agent/api/list-specs). Use [spec status](/architect-agent/api/spec-status) for full bodies.

A missing or empty query returns `400`. An invalid regular expression returns `500`; correct the pattern instead of repeatedly retrying it.


## OpenAPI

````yaml api-reference/openapi.json GET /find-specs
openapi: 3.1.0
info:
  title: pre.dev API
  description: >-
    Public REST API for software specifications, browser automation, proposal
    assessment, and credit balance. Base URL: https://api.pre.dev. MCP is
    documented separately at https://docs.pre.dev/mcp/tools.
  version: 1.1.0
  contact:
    name: pre.dev Support
    url: https://pre.dev
    email: support@pre.dev
  license:
    name: Proprietary
    url: https://pre.dev/terms
servers:
  - url: https://api.pre.dev
    description: Production API Server
security:
  - apiKeyAuth: []
  - xApiKey: []
tags:
  - name: Specifications
  - name: Browser Agents
  - name: Proposals
  - name: Account
paths:
  /find-specs:
    get:
      tags:
        - Specifications
      summary: Search specs
      description: >-
        Newest first. Summary records omit Markdown, JSON, graphs, and credit
        details. Unrecognized status or endpoint filters are ignored.
      operationId: findSpecs
      parameters:
        - name: query
          in: query
          required: true
          schema:
            type: string
            minLength: 1
          description: >-
            Case-insensitive regular expression matched against spec input.
            Invalid syntax returns 500.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 20
            minimum: 1
            maximum: 100
        - name: skip
          in: query
          required: false
          schema:
            type: integer
            default: 0
            minimum: 0
        - name: endpoint
          in: query
          required: false
          schema:
            type: string
            enum:
              - fast_spec
              - deep_spec
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - pending
              - processing
              - completed
              - failed
      responses:
        '200':
          description: Paginated spec summaries.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListSpecsResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, invalid, or ineligible authentication.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Access or trial eligibility denied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Request failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ListSpecsResponse:
      type: object
      required:
        - specs
        - total
        - hasMore
      properties:
        specs:
          type: array
          items:
            $ref: '#/components/schemas/SpecSummary'
        total:
          type: integer
          minimum: 0
        hasMore:
          type: boolean
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        message:
          type: string
          description: Optional detail; not returned by every endpoint.
        code:
          type: string
          description: Machine-readable code when available.
        actionUrl:
          type: string
          format: uri
        requiresSubscription:
          type: boolean
        trialsUsed:
          type: integer
        maxTrials:
          type: integer
      additionalProperties: true
    SpecSummary:
      type: object
      required:
        - status
      properties:
        _id:
          type: string
          description: 24-character record ID.
          pattern: ^[a-fA-F0-9]{24}$
        created:
          type: string
          format: date-time
        endpoint:
          type: string
          enum:
            - fast_spec
            - deep_spec
          description: Which endpoint was used
        input:
          type: string
          description: Original input text provided
        status:
          type: string
          enum:
            - pending
            - processing
            - completed
            - failed
        success:
          type: boolean
          description: Whether the request succeeded
        uploadedFileShortUrl:
          anyOf:
            - type: string
              description: Short URL for uploaded file (if file was uploaded)
            - type: 'null'
        uploadedFileName:
          anyOf:
            - type: string
              description: Name of uploaded file (if file was uploaded)
            - type: 'null'
        executionTime:
          anyOf:
            - type: integer
              description: Processing time in milliseconds (only when completed or failed)
            - type: 'null'
        currentContext:
          anyOf:
            - type: string
              description: Existing context supplied with generation.
            - type: 'null'
        specSource:
          anyOf:
            - type: string
              description: Origin of the request, such as api or mcp.
            - type: 'null'
        errorMessage:
          anyOf:
            - type: string
              description: Error description (only when failed)
            - type: 'null'
        progress:
          anyOf:
            - type: number
              description: Completion percentage (0-100) while processing
            - type: 'null'
        predevUrl:
          anyOf:
            - type: string
              format: uri
              description: pre.dev project URL (only when completed)
            - type: 'null'
        docURLs:
          anyOf:
            - type: array
              items:
                type: string
                format: uri
            - type: 'null'
        zippedDocsUrls:
          anyOf:
            - type: array
              description: >-
                Array of scraped documentation archives (only when completed).
                Empty array if no docURLs provided or scraping fails
              items:
                $ref: '#/components/schemas/ZippedDocsUrl'
            - type: 'null'
        codingAgentSpecUrl:
          anyOf:
            - type: string
              format: uri
              description: >-
                URL where the coding agent spec format is hosted (only when
                completed)
            - type: 'null'
        humanSpecUrl:
          anyOf:
            - type: string
              format: uri
              description: >-
                URL where the human-readable spec is hosted (only when
                completed)
            - type: 'null'
        architectureInfographicUrl:
          anyOf:
            - type: string
              format: uri
              description: >-
                URL to a visual architecture infographic/diagram for the
                specification (only when completed)
            - type: 'null'
      description: >-
        Summary only. Use GET /spec-status/{specId} for Markdown, JSON, graphs,
        totalHumanHours, creditsUsed, and progressMessage.
    ZippedDocsUrl:
      type: object
      required:
        - platform
        - masterZipShortUrl
      properties:
        platform:
          type: string
          description: >-
            Hostname extracted from the documentation URL (e.g., 'stripe.com',
            'docs.github.com')
          example: stripe.com
        masterZipShortUrl:
          type: string
          format: uri
          description: >-
            Short URL to download the zipped documentation archive for this
            platform
        masterMarkdownShortUrl:
          type: string
          format: uri
          description: Optional short URL to consolidated markdown file for this platform
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: Use a pre.dev API key from https://pre.dev/projects/key.
    xApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Alternative to Authorization: Bearer.'

````