> ## 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.

# Search opportunities

> Search opportunities with the constrained public parameter set shared by MCP search_opportunities. Defaults to open opportunities and excludes prediction records from search results.




## OpenAPI

````yaml /openapi/tools-v1.yaml post /api/tools/v1/opportunities/search
openapi: 3.1.0
info:
  title: Govly Tools API
  version: 1.0.0
  description: >
    REST-callable tool surface for agent and automation workflows. Agents are
    the primary consumer, but integrations can be built on this API. Within this
    version, Govly aims to avoid breaking regressions in documented behavior;
    response objects may receive additional fields at any time. 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: 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: Attachments
    description: Fetch extracted or readable attachment text.
paths:
  /api/tools/v1/opportunities/search:
    post:
      tags:
        - Opportunities
      summary: Search opportunities
      description: >
        Search opportunities with the constrained public parameter set shared by
        MCP search_opportunities. Defaults to open opportunities and excludes
        prediction records from search results.
      operationId: search_opportunities
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                query:
                  type: string
                cursor:
                  type: string
                  description: >-
                    Opaque cursor from the previous response's meta.nextCursor.
                    Omit for the first page.
                perPage:
                  type: integer
                  default: 25
                  maximum: 100
                status:
                  type: string
                  default: open
                  enum:
                    - open
                    - all
                    - expired
                    - cancelled
                    - awarded
                    - not_cancelled
                  description: >
                    Defaults to open for actionable opportunities. Use all,
                    expired, cancelled, awarded, or not_cancelled for historical
                    or specific lookup requests. Prediction records are always
                    excluded.
                naics:
                  type: array
                  items:
                    type: string
                  description: NAICS codes to filter by, such as 541519.
                postedAfter:
                  type: string
                  description: >-
                    Only include opportunities posted at or after this
                    date/time. ISO 8601 dates work best.
                postedBefore:
                  type: string
                  description: >-
                    Only include opportunities posted at or before this
                    date/time. ISO 8601 dates work best.
                modifiedAfter:
                  type: string
                  description: >-
                    Only include opportunities modified at or after this
                    date/time. ISO 8601 dates work best.
                modifiedBefore:
                  type: string
                  description: >-
                    Only include opportunities modified at or before this
                    date/time. ISO 8601 dates work best.
                respondByAfter:
                  type: string
                  description: >-
                    Only include opportunities with a response deadline at or
                    after this date/time. ISO 8601 dates work best.
                respondByBefore:
                  type: string
                  description: >-
                    Only include opportunities with a response deadline at or
                    before this date/time. ISO 8601 dates work best.
                awardedAfter:
                  type: string
                  description: >-
                    Only include awarded opportunities awarded at or after this
                    date/time. ISO 8601 dates work best.
                awardedBefore:
                  type: string
                  description: >-
                    Only include awarded opportunities awarded at or before this
                    date/time. ISO 8601 dates work best.
                sort:
                  type: string
                  enum:
                    - modified_at
                    - posted_at
                    - respond_by
                    - relevance
                sortDirection:
                  type: string
                  enum:
                    - asc
                    - desc
      responses:
        '200':
          description: Matching opportunities
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Opportunity'
                  meta:
                    $ref: '#/components/schemas/CursorMeta'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/Error'
components:
  schemas:
    Opportunity:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          description: >-
            Govly opportunity ID. Use this ID for show requests, workspace
            associations, and links.
        title:
          type: string
        displayName:
          type: string
          description: >-
            Human-readable opportunity reference, usually source name plus
            identifier.
        identifier:
          type: string
          description: >-
            Public opportunity identifier, such as a solicitation or request
            number. This may differ from raw source-system IDs when Govly merges
            related notices.
        externalUrl:
          type: string
          format: uri
        recordType:
          type: string
        status:
          type: string
          enum:
            - open
            - expired
            - cancelled
            - awarded
            - forecasted
            - unknown
        postedAt:
          type: string
          format: date-time
        modifiedAt:
          type: string
          format: date-time
        respondBy:
          type: string
          format: date-time
        cancelledAt:
          type: string
          format: date-time
        awardedAt:
          type: string
          format: date-time
        aiTitle:
          type: string
        aiSummary:
          type: string
        jurisdiction:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
            isoCode:
              type: string
        contractVehicle:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
        followerCount:
          type: integer
          description: >-
            Count of active follow rows across visible workspaces for this
            opportunity.
        followedByCurrentUser:
          type: boolean
          description: >-
            Whether the authenticated user actively follows any visible
            workspace for this opportunity.
        followedByCurrentOrganization:
          type: boolean
          description: >-
            Whether the authenticated user's organization actively follows any
            visible workspace for this opportunity.
        workspaces:
          type: array
          description: >-
            Visible workspaces associated with this opportunity, including
            active follow context.
          items:
            $ref: '#/components/schemas/OpportunityWorkspace'
        aggregateAttachments:
          type: array
          items:
            $ref: '#/components/schemas/OpportunityAttachment'
        opportunitySources:
          type: array
          items:
            $ref: '#/components/schemas/OpportunitySource'
    CursorMeta:
      type: object
      required:
        - count
      properties:
        count:
          type: integer
        perPage:
          type: integer
        nextCursor:
          type:
            - string
            - 'null'
    OpportunityWorkspace:
      type: object
      required:
        - id
        - name
        - status
        - followerCount
        - follows
      properties:
        id:
          type: string
        name:
          type: string
        organizationDefault:
          type: boolean
        organization:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
        status:
          type: object
          required:
            - category
            - label
          properties:
            category:
              type: string
            label:
              type: string
        followerCount:
          type: integer
          description: Count of active follow rows on this workspace.
        followedByCurrentUser:
          type: boolean
        followedByCurrentOrganization:
          type: boolean
        follows:
          type: array
          description: >-
            Active workspace follows. Inactive/unfollowed/disinterested rows are
            omitted.
          items:
            $ref: '#/components/schemas/WorkspaceMember'
    OpportunityAttachment:
      type: object
      required:
        - id
        - filename
        - redacted
      properties:
        id:
          type: string
        filename:
          type: string
        contentType:
          type: string
        byteSize:
          type: integer
        redacted:
          type: boolean
        tags:
          type: array
          items:
            type: string
        file:
          $ref: '#/components/schemas/AttachmentFile'
    OpportunitySource:
      type: object
      required:
        - id
        - attachments
      properties:
        id:
          type: string
        postedAt:
          type: string
          format: date-time
        externalUrl:
          type: string
          format: uri
        noticeType:
          type: string
        recordType:
          type: string
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/OpportunityAttachment'
    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
    WorkspaceMember:
      type: object
      required:
        - id
        - member
      properties:
        id:
          type: string
        state:
          type: string
        notifications:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        member:
          type: object
          required:
            - type
            - id
          properties:
            type:
              type: string
              enum:
                - user
                - team
            id:
              type: string
            name:
              type: string
            email:
              type: string
              format: email
            organization:
              type: object
              properties:
                id:
                  type: string
                name:
                  type: string
    AttachmentFile:
      type: object
      description: >-
        Presigned download metadata. Omitted when the attachment is redacted or
        URLs are excluded.
      required:
        - url
        - expiresAt
      properties:
        url:
          type: string
          format: uri
        expiresAt:
          type: string
          format: date-time
  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

````