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

# Search Collections

> Search collections using free-text relevance matching.
Returns a bounded relevance-ranked result set and does not return `next_page`.
For deterministic chronological pagination, use `GET /v2/collections`.



## OpenAPI

````yaml POST /v2/collections/search
openapi: 3.1.0
info:
  title: Mem API
  description: An API that allows you to interact with the Mem platform.
  version: 1.0.0
servers:
  - url: https://api.mem.ai
security:
  - bearerAuth: []
paths:
  /v2/collections/search:
    post:
      tags:
        - external
        - external-v2
      summary: Search Collections
      description: >-
        Search collections using free-text relevance matching.

        Returns a bounded relevance-ranked result set and does not return
        `next_page`.

        For deterministic chronological pagination, use `GET /v2/collections`.
      operationId: app_src_api_routes_external_v2_collections_views_search_collections
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CollectionSearchRequestSchema'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CollectionSearchResponseSchema'
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl "https://api.mem.ai/v2/collections/search" \
                 --header "Content-Type: application/json" \
                 --header "Authorization: Bearer $MEM_API_KEY" \
                 --data '{
                     "query": "recipes"
                 }'
components:
  schemas:
    CollectionSearchRequestSchema:
      properties:
        query:
          anyOf:
            - type: string
            - type: 'null'
          description: |-
            Optional text query for relevance matching across collections.
            If omitted, search can still return a bounded general set.
          title: Query
        filter_by_created_after:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: >-
            Optional inclusive lower bound for collection creation time (ISO
            8601).

            The timestamp must include a timezone offset such as `Z` or
            `+01:00`.
          examples:
            - '2025-04-01T14:30:45Z'
            - '2023-12-15T09:45:30+01:00'
          title: Filter By Created After
        filter_by_created_before:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: >-
            Optional inclusive upper bound for collection creation time (ISO
            8601).

            The timestamp must include a timezone offset such as `Z` or
            `+01:00`.
          examples:
            - '2025-04-30T23:59:59Z'
            - '2023-12-31T18:00:00+01:00'
          title: Filter By Created Before
        filter_by_updated_after:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: >-
            Optional inclusive lower bound for collection update time (ISO
            8601).

            The timestamp must include a timezone offset such as `Z` or
            `+01:00`.
          examples:
            - '2025-04-01T14:30:45Z'
            - '2023-12-15T09:45:30+01:00'
          title: Filter By Updated After
        filter_by_updated_before:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: >-
            Optional inclusive upper bound for collection update time (ISO
            8601).

            The timestamp must include a timezone offset such as `Z` or
            `+01:00`.
          examples:
            - '2025-04-30T23:59:59Z'
            - '2023-12-31T18:00:00+01:00'
          title: Filter By Updated Before
      title: CollectionSearchRequestSchema
      type: object
    CollectionSearchResponseSchema:
      example:
        request_id: api-request-018f8d0d-5a3c-7afc-8321-2f6f6e0fefab
        results:
          - created_at: '2025-03-18T11:00:00Z'
            description: Saved recipes from around the web
            id: 018f8d0d-5a3c-7afc-8321-2f6f6e0fefab
            note_count: 10
            title: Recipe Notes
            updated_at: '2025-04-22T16:12:34Z'
        total: 1
      properties:
        request_id:
          description: Identifier for this API request. Useful for tracing and support.
          title: Request Id
          type: string
        results:
          description: Relevance-ranked collection results matching the search request.
          items:
            $ref: '#/components/schemas/CollectionSearchItemResponseSchema'
          title: Results
          type: array
        total:
          description: Number of collections returned by this bounded search response.
          title: Total
          type: integer
      required:
        - request_id
        - results
        - total
      title: CollectionSearchResponseSchema
      type: object
    CollectionSearchItemResponseSchema:
      properties:
        id:
          description: UUID of the collection.
          format: uuid
          title: Id
          type: string
        title:
          description: Current title of the collection.
          title: Title
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Optional description text currently stored on the collection.
          title: Description
        note_count:
          description: Current number of notes in the collection.
          title: Note Count
          type: integer
        created_at:
          description: Creation timestamp for the collection in ISO 8601 format.
          format: date-time
          title: Created At
          type: string
        updated_at:
          description: Last modification timestamp for the collection in ISO 8601 format.
          format: date-time
          title: Updated At
          type: string
      required:
        - id
        - title
        - description
        - note_count
        - created_at
        - updated_at
      title: CollectionSearchItemResponseSchema
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````