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

# Search

> Search for catalogs, schemas, and tables across the project. You can filter the search results by specifying a catalog or schema. You can also specify a limit and offset for pagination.


See the request body for more details.


<span style={{display: "flex", gap: "10px", flexDirection: "row", alignItems: "center"}}>
  <img src="https://cdn.peaka.com/badges/partner-api-key-badge.png" />

  <img src="https://cdn.peaka.com/badges/project-api-key-badge.png" />
</span>


## OpenAPI

````yaml post /data/projects/{projectId}/search
openapi: 3.0.1
info:
  title: Peaka Gateway API
  description: Peaka Gateway API Documentation
  version: '1.0'
servers:
  - url: https://partner.peaka.studio/api/v1
    description: Default Server URL (US Zone)
  - url: https://partner.eu.peaka.studio/api/v1
    description: EU Zone
security:
  - bearerAuth: []
paths:
  /data/projects/{projectId}/search:
    post:
      tags:
        - Data -- Catalogs
      summary: Search
      description: >
        Search for catalogs, schemas, and tables across the project. You can
        filter the search results by specifying a catalog or schema. You can
        also specify a limit and offset for pagination.



        See the request body for more details.
      operationId: search
      parameters:
        - name: projectId
          in: path
          description: ID of the project
          required: true
          schema:
            type: string
          example: mtKDhe1U
      requestBody:
        description: Search Anywhere
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchRequest'
            examples:
              Search Anywhere Request:
                description: Search Anywhere Request
                value:
                  query: apple
              Search Under a Catalog:
                description: Search Under a Catalog
                value:
                  query: apple
                  catalog: my_catalog
              Search Under a Schema:
                description: Search Under a Schema
                value:
                  query: apple
                  catalog: my_catalog
                  schema: my_schema
              Search with Limit Increased:
                description: Search with Limit Increased
                value:
                  query: apple
                  limit: 200
              Search with Offset:
                description: Search with Offset
                value:
                  query: apple
                  limit: 200
                  offset: 400
        required: true
      responses:
        '200':
          description: Successful Search
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResult'
              examples:
                Search Result:
                  description: Search Result
                  value:
                    matchedCatalogs:
                      - catalog: apple_catalog
                    matchedSchemas:
                      - catalog: my_catalog
                        schema: apple_schema
                    matchedTables:
                      - catalog: my_catalog
                        schema: apple_schema
                        table: apple_table
                      - catalog: my_catalog
                        schema: another_schema
                        table: another_apple_table
                    meta:
                      page:
                        limit: 100
                        offset: 0
                        nextOffset: null
                      query:
                        text: apple
components:
  schemas:
    SearchRequest:
      type: object
      properties:
        catalog:
          type: string
          description: Catalog Query Name. Search only for that catalog.
        schema:
          type: string
          description: >-
            Schema Name. Search only for that schema. If catalog is also given,
            find the tables under catalog.schema.*
        query:
          type: string
          description: Search term. Does a case-insensitive contains search.
        limit:
          type: integer
          description: Number of results to return. Default is 100.
          format: int32
        offset:
          type: integer
          description: Number of results to skip. Default is 0.
          format: int32
    SearchResult:
      type: object
      properties:
        matchedCatalogs:
          type: array
          description: Catalogs matched.
          items:
            $ref: '#/components/schemas/CatalogSchemaTable'
        matchedSchemas:
          type: array
          description: Schemas matched.
          items:
            $ref: '#/components/schemas/CatalogSchemaTable'
        matchedTables:
          type: array
          description: Tables matched.
          items:
            $ref: '#/components/schemas/CatalogSchemaTable'
        meta:
          $ref: '#/components/schemas/Meta'
    CatalogSchemaTable:
      type: object
      properties:
        catalog:
          type: string
          description: Catalog Query Name
        schema:
          type: string
          description: Schema Name
        table:
          type: string
          description: Table Name
    Meta:
      type: object
      properties:
        page:
          $ref: '#/components/schemas/Page'
        query:
          $ref: '#/components/schemas/Query'
    Page:
      type: object
      properties:
        limit:
          type: integer
          format: int32
        offset:
          type: integer
          format: int32
        nextOffset:
          type: integer
          format: int32
    Query:
      type: object
      properties:
        id:
          type: string
          description: The ID of the query.
        displayName:
          type: string
          description: The display name of the query.
        name:
          type: string
          description: >-
            The name of the query used in SQL, e.g. SELECT * FROM
            "peaka"."query"."<name>".
        inputQuery:
          type: string
          description: The SQL query.
        inputQueryRefId:
          type: string
          description: >-
            The reference id of the input query. For a MATERIALIZED query, the
            id of the original query it materializes.
          nullable: true
        queryType:
          type: string
          description: The type of the query.
          enum:
            - PLAIN
            - MATERIALIZED
        schedule:
          $ref: '#/components/schemas/MaterializedQuerySchedule'
        path:
          type: string
          description: >-
            The folder path of the query (e.g. "/analytics/dashboards"). Null if
            not in any folder.
          nullable: true
        folderId:
          type: string
          description: >-
            The ID of the folder containing this query. Null if not in any
            folder.
          nullable: true
      description: A saved query belonging to a project.
    MaterializedQuerySchedule:
      type: object
      properties:
        type:
          type: string
          description: Type of schedule.
          enum:
            - interval
            - cron
            - none
        cronExpression:
          type: string
          description: Cron expression. Set only when the schedule type is 'cron'.
          nullable: true
        repeatDuration:
          type: string
          description: ISO-8601 duration. Set only when the schedule type is 'interval'.
          nullable: true
        timezone:
          type: string
          description: >-
            IANA timezone used to evaluate the cron expression. Set only when
            the schedule type is 'cron'.
          nullable: true
      description: >-
        Schedule configuration of a materialized query. Provide EITHER an
        interval schedule (`type=interval` with `repeatDuration`) OR a cron
        schedule (`type=cron` with `cronExpression` and optional `timezone`).
        Use `type=none` for no schedule. The fields that do not apply to the
        chosen type are omitted.
      nullable: true
      example:
        type: cron
        cronExpression: 0 0 * * *
        timezone: UTC
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        Use the Authorization header with the value 'Bearer <apiKey>' to
        authenticate. Partner API Keys have full access; Project API Keys are
        limited to their project scope. Learn more:
        https://docs.peaka.com/api-reference/authentication
      scheme: bearer
      bearerFormat: Api Key

````