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

# Search Workspace

> Agents, grants, trajectories and clause references matching `q`.

**Who may call it:** any role. A workspace API key is refused here: this is an act that belongs to a named person.



## OpenAPI

````yaml /api/openapi.json get /v1/search
openapi: 3.1.0
info:
  title: RotaGrant API
  version: 0.1.0
  description: >-
    The HTTP API of a RotaGrant deployment, made from the product's own route
    definitions at the commit named in `x-rotascale-source`. Nothing here is
    written by hand.


    There is no shared endpoint. RotaGrant runs in your environment, and your
    deployment serves its own copy of this description at `/api/docs`. That copy
    is the authority on what your version has and which features are switched
    on; this one is the reference for one commit of the main line. The version
    is 0.1.0: routes and shapes can still change.


    Every route says who may call it. Most need a bearer token from the identity
    provider your deployment uses, held by a person with the role named. The
    routes an SDK calls also accept a workspace API key. A few are open, and say
    why.
servers:
  - url: https://{deployment}
    description: Your own deployment. There is no shared endpoint.
    variables:
      deployment:
        default: rotagrant.internal.example
        description: The host your deployment answers on.
security: []
paths:
  /v1/search:
    get:
      tags:
        - Search
      summary: Search Workspace
      description: >-
        Agents, grants, trajectories and clause references matching `q`.


        **Who may call it:** any role. A workspace API key is refused here: this
        is an act that belongs to a named person.
      operationId: search_workspace_v1_search_get
      parameters:
        - name: q
          in: query
          required: false
          schema:
            type: string
            description: free text, or a pasted identifier
            default: ''
            title: Q
          description: free text, or a pasted identifier
        - name: per_kind
          in: query
          required: false
          schema:
            type: integer
            maximum: 25
            minimum: 1
            default: 5
            title: Per Kind
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - bearerToken: []
components:
  schemas:
    SearchOut:
      properties:
        query:
          type: string
          title: Query
        exact:
          anyOf:
            - $ref: '#/components/schemas/HitOut'
            - type: 'null'
        hits:
          items:
            $ref: '#/components/schemas/HitOut'
          type: array
          title: Hits
          default: []
        counts:
          additionalProperties:
            type: integer
          type: object
          title: Counts
          default: {}
        total:
          type: integer
          title: Total
          default: 0
        shown:
          type: integer
          title: Shown
          default: 0
      type: object
      required:
        - query
      title: SearchOut
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    HitOut:
      properties:
        kind:
          type: string
          title: Kind
        id:
          type: string
          title: Id
        label:
          type: string
          title: Label
        sublabel:
          anyOf:
            - type: string
            - type: 'null'
          title: Sublabel
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
        context:
          additionalProperties: true
          type: object
          title: Context
          default: {}
      type: object
      required:
        - kind
        - id
        - label
      title: HitOut
      description: One thing found, and what it is.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearerToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        A token from the identity provider your deployment federates with. It
        identifies a person; their roles in the workspace decide what they may
        do.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.