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

# Create an opportunity saved search

> Saves a set of opportunity search criteria. Opportunity saved searches percolate, so the stored filters also drive match notifications. The market the search is created under is stored with it and bounds every later match, so set searchType explicitly when scoping to a state or local place. Stored filters can be changed but not removed.




## OpenAPI

````yaml /openapi/tools-v1.yaml post /api/tools/v1/opportunities/saved_searches
openapi: 3.1.0
info:
  title: Govly Tools API (Alpha)
  version: 1.0.0-alpha
  description: >
    ALPHA / UNSTABLE: This API is still in active development. Endpoint
    behavior, request fields, response fields, error codes, and operation names
    may change before the Tools API is declared stable.

    REST-callable tool surface for agent and automation workflows. Agents are
    the primary consumer, but integrations can be built on this API. Responses
    are JSON for typed clients; MCP tools may render action results into
    text-oriented formats separately.
servers:
  - url: https://app.govly.com
security:
  - bearerApiKey: []
  - headerApiKey: []
tags:
  - name: Opportunities
    description: Search, fetch, and inspect Govly opportunity records.
  - name: Awards
    description: Search and inspect awarded government contracts.
  - name: Contacts
    description: Search and inspect government points of contact.
  - name: Signals
    description: Search clustered procurement and market intelligence signals.
  - name: Places
    description: Resolve place names to canonical Govly Place ids.
  - name: Product Catalogs
    description: List government contract price lists and search their line items.
  - name: Workspaces
    description: Create, update, and inspect opportunity workspaces.
  - name: Workspace Members
    description: Add users and teams to workspaces.
  - name: Workspace Attachments
    description: List and upload workspace attachments.
  - name: Workspace Comments
    description: Post comments to workspaces.
  - name: Follows
    description: Follow opportunities and related workspace activity.
  - name: Saved Searches
    description: List saved opportunity searches and cached matches.
  - name: Documents
    description: >-
      Read document representations and request temporary original-file
      downloads.
  - name: Quote Submissions
    description: >-
      Inspect quote submission requirements, submit quotes, and poll submission
      status.
  - name: Inbox
    description: Read and triage the authenticated user's matched inbox items.
paths:
  /api/tools/v1/opportunities/saved_searches:
    post:
      tags:
        - Saved Searches
      summary: Create an opportunity saved search
      description: >
        Saves a set of opportunity search criteria. Opportunity saved searches
        percolate, so the stored filters also drive match notifications. The
        market the search is created under is stored with it and bounds every
        later match, so set searchType explicitly when scoping to a state or
        local place. Stored filters can be changed but not removed.
      operationId: create_opportunity_saved_search
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - name
              properties:
                name:
                  type: string
                  description: Display name for the saved search.
                query:
                  type: string
                  description: Free-text search terms.
                searchType:
                  type: string
                  enum:
                    - fed
                    - sled
                    - international
                  description: >
                    Market this search covers. Defaults to the caller's market
                    focus and is stored, so it bounds every later match.
                buyerIds:
                  type: array
                  items:
                    type: string
                  description: Govly buyer (government entity) ids.
                includeSubBuyers:
                  type: boolean
                  description: >-
                    Include opportunities from child agencies. Default true when
                    buyerIds is set.
                naics:
                  type: array
                  items:
                    type: string
                  description: NAICS codes to filter by.
                placeIds:
                  type: array
                  items:
                    type: string
                  description: >
                    Canonical Govly Place ids to scope the saved search to, from
                    the place search or list tools. Matches at any
                    administrative level. Bounded by the stored market, and
                    changeable but not removable.
                placeIdsNone:
                  type: array
                  items:
                    type: string
                  description: >-
                    Canonical Govly Place ids to exclude. Same matching rules as
                    placeIds.
                recordType:
                  type: array
                  items:
                    type: string
                  description: Record types. Published and forecast types cannot be mixed.
                noticeType:
                  type: array
                  items:
                    type: string
                  description: Notice types.
                status:
                  type: array
                  items:
                    type: string
                  description: Opportunity statuses.
                dateRangeParam:
                  type: string
                  description: Which date field the relative window applies to.
                relativeStartDayPivot:
                  type: integer
                  description: Window start, in days relative to today.
                relativeEndDayPivot:
                  type: integer
                  description: Window end, in days relative to today.
      responses:
        '201':
          description: Created opportunity saved search
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/OppSearch'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/Error'
components:
  schemas:
    OppSearch:
      type: object
      required:
        - id
        - name
        - active
        - criteria
      properties:
        id:
          type: string
        name:
          type: string
        active:
          type: boolean
        criteria:
          type: object
          description: Stored search criteria for this saved search.
        matchCount:
          type: integer
        lastMatchedAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ErrorEnvelope:
      type: object
      required:
        - errors
      properties:
        errors:
          type: array
          items:
            type: object
            required:
              - status
              - code
              - title
              - detail
            properties:
              status:
                type: string
              code:
                type: string
              title:
                type: string
              detail:
                type: string
              source:
                type: object
                properties:
                  pointer:
                    type: string
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    bearerApiKey:
      type: http
      scheme: bearer
      bearerFormat: API key
    headerApiKey:
      type: apiKey
      in: header
      name: X-API-KEY

````