> ## 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 active workspaces

> Searches the authenticated organization's Active Work with exact totals and opaque cursor pagination. The default scope is current, open workspaces with an opportunity primary focus or no primary focus. Explicit participants narrow organization participation and never grant access. A workspace without a primary focus is represented by includeWithoutPrimaryFocus; primaryFocusTypes never uses a standalone sentinel.




## OpenAPI

````yaml /openapi/tools-v1.yaml post /api/tools/v1/workspaces/search
openapi: 3.1.0
info:
  title: Govly Tools API
  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: Shares
    description: Share awards and contacts with colleagues by email.
  - 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/workspaces/search:
    post:
      tags:
        - Workspaces
      summary: Search active workspaces
      description: >
        Searches the authenticated organization's Active Work with exact totals
        and opaque cursor pagination. The default scope is current, open
        workspaces with an opportunity primary focus or no primary focus.
        Explicit participants narrow organization participation and never grant
        access. A workspace without a primary focus is represented by
        includeWithoutPrimaryFocus; primaryFocusTypes never uses a standalone
        sentinel.
      operationId: search_workspaces
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                query:
                  type: string
                  maxLength: 30000
                  description: >-
                    Search workspace name/description and opportunity display
                    name/title.
                cursor:
                  type: string
                  description: >-
                    Opaque nextCursor from the previous page, bound to the actor
                    and all filters.
                perPage:
                  type: integer
                  default: 25
                  maximum: 100
                primaryFocusTypes:
                  type: array
                  items:
                    type: string
                    enum:
                      - opportunity
                  description: >-
                    Primary focus types to include. This beta supports
                    opportunity only.
                includeWithoutPrimaryFocus:
                  type: boolean
                  default: true
                  description: Include workspaces whose primary focus is absent.
                lifecycle:
                  type: string
                  enum:
                    - current
                    - archived
                  default: current
                  description: >-
                    Workspace lifecycle; source opportunity lifecycle does not
                    affect membership.
                statusGroup:
                  type: string
                  enum:
                    - open
                    - closed
                  default: open
                statusCategories:
                  type: array
                  items:
                    type: string
                    enum:
                      - triage
                      - planned
                      - in_progress
                      - completed
                      - canceled
                  description: Exact workspace categories, intersected with statusGroup.
                workspaceStatusIds:
                  type: array
                  items:
                    type: string
                  description: Current-organization custom workspace status IDs.
                participants:
                  type: array
                  items:
                    $ref: '#/components/schemas/WorkspaceSearchParticipantInput'
                  description: >-
                    Current-organization users or teams that narrow Active Work
                    participation.
                participantOperator:
                  type: string
                  enum:
                    - any
                    - all
                  default: any
                labelIds:
                  type: array
                  items:
                    type: string
                  description: >-
                    Include workspaces with any selected label belonging to the
                    authenticated organization.
                excludeLabelIds:
                  type: array
                  items:
                    type: string
                  description: >-
                    Exclude workspaces with any selected label belonging to the
                    authenticated organization.
      responses:
        '200':
          description: Matching workspaces
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/WorkspaceSearchResult'
                  meta:
                    $ref: '#/components/schemas/WorkspaceSearchMeta'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '500':
          $ref: '#/components/responses/Error'
components:
  schemas:
    WorkspaceSearchParticipantInput:
      type: object
      additionalProperties: false
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - user
            - team
        id:
          type: string
    WorkspaceSearchResult:
      allOf:
        - $ref: '#/components/schemas/Workspace'
        - type: object
          required:
            - updatedAt
            - privateAccess
            - organization
            - participants
            - labels
          properties:
            archivedAt:
              type: string
              format: date-time
            privateAccess:
              type: boolean
            organization:
              type: object
              required:
                - id
                - name
              properties:
                id:
                  type: string
                name:
                  type: string
            participants:
              type: array
              items:
                $ref: '#/components/schemas/WorkspaceSearchParticipant'
            labels:
              type: array
              items:
                $ref: '#/components/schemas/WorkspaceSearchLabel'
    WorkspaceSearchMeta:
      type: object
      required:
        - total
        - perPage
      properties:
        total:
          type: integer
          description: Exact number of matching workspaces.
        perPage:
          type: integer
        nextCursor:
          type: string
          description: Opaque cursor for the next page. Absent on the final page.
    Workspace:
      type: object
      required:
        - id
        - name
        - status
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        commentsCount:
          type: integer
        status:
          type: object
          required:
            - category
            - label
          properties:
            id:
              type: string
              description: Exact custom workspace status ID, when assigned.
            category:
              type: string
              description: >-
                Coarse status bucket. Triage is the default for newly created
                workspaces.
            label:
              type: string
              description: >-
                Human-readable status name. Falls back to the category label
                when no custom status is set.
        primaryFocus:
          $ref: '#/components/schemas/AssociatedEntity'
        comments:
          type: array
          description: >-
            Recent comments. Only present on show/create/update responses,
            capped at the most recent 20.
          items:
            $ref: '#/components/schemas/Comment'
        attachments:
          type: array
          description: Workspace attachments. Only present on show/create/update responses.
          items:
            $ref: '#/components/schemas/WorkspaceAttachment'
        customFields:
          type: array
          description: >-
            Your organization's custom field values for this workspace, ordered
            by field id. Every field your organization has defined is included,
            unset fields with a null value. Only present on show/create/update
            responses.
          items:
            $ref: '#/components/schemas/WorkspaceCustomField'
    WorkspaceSearchParticipant:
      type: object
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - user
            - team
        id:
          type: string
        name:
          type: string
        email:
          type: string
          format: email
    WorkspaceSearchLabel:
      type: object
      required:
        - id
        - name
        - color
      properties:
        id:
          type: string
        name:
          type: string
        color:
          type: string
        description:
          type: string
        domain:
          type: string
    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
    AssociatedEntity:
      type: object
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - opportunity
            - award
            - contact
        id:
          type: string
    Comment:
      type: object
      required:
        - id
        - body
        - createdAt
        - attachments
      properties:
        id:
          type: string
        body:
          type: string
          description: Markdown body for the comment.
        attachments:
          type: array
          description: Workspace attachments tied to this comment.
          items:
            $ref: '#/components/schemas/WorkspaceAttachment'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    WorkspaceAttachment:
      type: object
      required:
        - id
        - workspaceId
        - filename
      properties:
        id:
          type: string
        workspaceId:
          type: string
        commentId:
          type: string
          nullable: true
        filename:
          type: string
        contentType:
          type: string
        byteSize:
          type: integer
        createdAt:
          type: string
          format: date-time
        file:
          $ref: '#/components/schemas/AttachmentFile'
          description: >-
            Present only on the workspace attachments endpoint. Workspace show
            responses surface attachments without download metadata.
    WorkspaceCustomField:
      type: object
      required:
        - id
        - name
        - type
        - value
      properties:
        id:
          type: string
          description: Stable custom field id, unique within your organization.
        name:
          type: string
          description: Display name. Names are not guaranteed unique; use id as the key.
        type:
          type: string
          description: >-
            Field type as stored, typically one of text_block, select_block,
            number_block, date_block, or multiselect_block. Best-effort; not an
            enforced enum.
        value:
          description: >-
            Raw stored value, or null when the field is unset for this
            workspace. Shape depends on the field type (select fields store the
            option label as a string); keys of object-shaped values are
            camelized.
    AttachmentFile:
      type: object
      description: >-
        Presigned download metadata. Omitted when attachment content is
        unavailable 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

````