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

# Search jobs and runs by approximate metadata matches

> Search uses PostgreSQL pg_trgm approximate matching over job names/slugs and run names, issue titles, and issue identifiers. Identifier matching is whole-field trigram matching; names and titles use word-level trigram matching. Exact identifiers and metadata names rank first, followed by the strongest individual field score. Results are unique, tenant-scoped, deterministically ordered, and limited to 100. Blank or punctuation-only queries return no results. One- and two-character queries may return no results because trigram matching is approximate; this is not ordered-character or substring matching.

Requires the runs:read scope.

Accepts a scoped bearer token or interactive owner session.



## OpenAPI

````yaml /openapi.yaml get /api/v1/search
openapi: 3.1.0
info:
  title: Factorize API
  version: 1.0.0
  description: >-
    Versioned Factorize REST API. See the hosted docs for examples and OAuth
    discovery.
  x-dashboard-auth: >-
    Access-token and authorized-client management and trace replay operations
    require an interactive owner session; all other operations accept a suitably
    scoped bearer token or owner session.
servers:
  - url: https://app.factorize.sh
security:
  - bearerAuth: []
paths:
  /api/v1/search:
    get:
      tags:
        - search
      summary: Search jobs and runs by approximate metadata matches
      description: >-
        Search uses PostgreSQL pg_trgm approximate matching over job names/slugs
        and run names, issue titles, and issue identifiers. Identifier matching
        is whole-field trigram matching; names and titles use word-level trigram
        matching. Exact identifiers and metadata names rank first, followed by
        the strongest individual field score. Results are unique, tenant-scoped,
        deterministically ordered, and limited to 100. Blank or punctuation-only
        queries return no results. One- and two-character queries may return no
        results because trigram matching is approximate; this is not
        ordered-character or substring matching.


        Requires the runs:read scope.


        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_search
      parameters:
        - name: q
          in: query
          required: false
          schema:
            default: ''
            type: string
      responses:
        '200':
          description: Search results
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        kind:
                          type: string
                          enum:
                            - job
                            - run
                            - trace
                        id:
                          type: string
                        title:
                          type: string
                        subtitle:
                          type: string
                        url:
                          type: string
                        source:
                          type: object
                          properties:
                            kind:
                              type: string
                              enum:
                                - job
                                - run
                                - trace
                            label:
                              type: string
                            id:
                              type: string
                          required:
                            - kind
                            - label
                            - id
                          additionalProperties: false
                        match:
                          type: object
                          properties:
                            text:
                              type: string
                            ranges:
                              type: array
                              items:
                                type: object
                                properties:
                                  start:
                                    type: integer
                                    minimum: 0
                                    maximum: 9007199254740991
                                  end:
                                    type: integer
                                    minimum: 0
                                    maximum: 9007199254740991
                                required:
                                  - start
                                  - end
                                additionalProperties: false
                          required:
                            - text
                            - ranges
                          additionalProperties: false
                      required:
                        - kind
                        - id
                        - title
                        - subtitle
                        - url
                        - source
                        - match
                      additionalProperties: false
                required:
                  - items
                additionalProperties: false
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '403':
          $ref: '#/components/responses/Error403'
        '404':
          $ref: '#/components/responses/Error404'
        '409':
          $ref: '#/components/responses/Error409'
        '429':
          $ref: '#/components/responses/Error429'
        '500':
          $ref: '#/components/responses/Error500'
        '503':
          $ref: '#/components/responses/Error503'
      security:
        - bearerAuth: []
        - cookieAuth: []
components:
  responses:
    Error400:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error401:
      description: Invalid or revoked credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error403:
      description: Missing scope or required owner session
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error404:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error409:
      description: Operation conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error429:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error500:
      description: Internal error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error503:
      description: Service unavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: OAuth2
    cookieAuth:
      type: apiKey
      in: cookie
      name: factorize_session

````

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