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

# Create a saved view

> Creates a saved view for the authenticated user. A view stores a reusable scope expression that can later be listed or searched.



## OpenAPI

````yaml /api-reference/openapi.json post /create-view
openapi: 3.1.0
info:
  title: Memex REST API
  description: Memex REST API endpoints.
  version: '2026-03-10'
servers:
  - url: https://memex.garden/api
    description: Public edge router
  - url: https://rubctkzqxcdgkbbcprnu.supabase.co/functions/v1
    description: Direct Supabase Edge Functions
security:
  - bearerAuth: []
paths:
  /create-view:
    post:
      summary: Create a saved view
      description: >-
        Creates a saved view for the authenticated user. A view stores a
        reusable scope expression that can later be listed or searched.
      operationId: createView
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateViewRequest'
            examples:
              tagScopedView:
                summary: Create a tag-scoped view
                value:
                  title: AI research
                  description: Saved content tagged for AI research
                  scope:
                    version: 1
                    expression:
                      type: tag
                      tagId: tag_123
                    defaults:
                      sortBy: date-desc
                      includeNotes: true
      responses:
        '200':
          description: Created view response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateViewResponse'
        '401':
          description: Authentication required or invalid bearer token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '500':
          description: Unexpected server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
components:
  schemas:
    CreateViewRequest:
      type: object
      required:
        - title
        - scope
      properties:
        title:
          type: string
        description:
          type: string
        favicon:
          type: string
        scope:
          $ref: '#/components/schemas/ViewScopeV1'
      additionalProperties: false
    CreateViewResponse:
      type: object
      required:
        - view
      properties:
        view:
          $ref: '#/components/schemas/ViewEntity'
      additionalProperties: false
    UnauthorizedError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          example: Unauthorized
      additionalProperties: true
    InternalServerError:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
          example: Internal server error
        message:
          type: string
      additionalProperties: true
    ViewScopeV1:
      type: object
      required:
        - version
        - expression
      properties:
        version:
          type: integer
          const: 1
        expression:
          $ref: '#/components/schemas/ViewExpression'
        defaults:
          type: object
          properties:
            sortBy:
              type: string
              enum:
                - date-desc
                - date-asc
            includeNotes:
              type: boolean
          additionalProperties: false
      additionalProperties: false
    ViewEntity:
      type: object
      required:
        - id
        - userId
        - title
        - description
        - scope
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
        userId:
          type: string
        title:
          type: string
        description:
          type: string
        favicon:
          type: string
        scope:
          $ref: '#/components/schemas/ViewScopeV1'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      additionalProperties: false
    ViewExpression:
      oneOf:
        - $ref: '#/components/schemas/ViewQueryExpression'
        - $ref: '#/components/schemas/ViewTagExpression'
        - $ref: '#/components/schemas/ViewContentTypeExpression'
        - $ref: '#/components/schemas/ViewTimeExpression'
        - $ref: '#/components/schemas/ViewLibraryExpression'
        - $ref: '#/components/schemas/ViewFeedExpression'
        - $ref: '#/components/schemas/ViewGroupExpression'
        - $ref: '#/components/schemas/ViewNotExpression'
    ViewQueryExpression:
      type: object
      required:
        - type
        - text
      properties:
        type:
          type: string
          const: query
        text:
          type: string
      additionalProperties: false
    ViewTagExpression:
      type: object
      required:
        - type
        - tagId
      properties:
        type:
          type: string
          const: tag
        tagId:
          type: string
      additionalProperties: false
    ViewContentTypeExpression:
      type: object
      required:
        - type
        - contentType
      properties:
        type:
          type: string
          const: contentType
        contentType:
          $ref: '#/components/schemas/ContentEntityType'
      additionalProperties: false
    ViewTimeExpression:
      type: object
      required:
        - type
        - field
      properties:
        type:
          type: string
          const: time
        field:
          type: string
          enum:
            - contentCreatedAt
        start:
          type: number
          description: Unix timestamp in milliseconds.
        end:
          type: number
          description: Unix timestamp in milliseconds.
      additionalProperties: false
    ViewLibraryExpression:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          const: library
      additionalProperties: false
    ViewFeedExpression:
      type: object
      required:
        - type
        - feedId
        - entryScope
      properties:
        type:
          type: string
          const: feed
        feedId:
          type: string
        entryScope:
          $ref: '#/components/schemas/ViewFeedEntryScope'
      additionalProperties: false
    ViewGroupExpression:
      type: object
      required:
        - type
        - operator
        - children
      properties:
        type:
          type: string
          const: group
        operator:
          $ref: '#/components/schemas/ViewExpressionOperator'
        children:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/ViewExpression'
      additionalProperties: false
    ViewNotExpression:
      type: object
      required:
        - type
        - child
      properties:
        type:
          type: string
          const: not
        child:
          $ref: '#/components/schemas/ViewExpression'
      additionalProperties: false
    ContentEntityType:
      type: string
      enum:
        - web
        - pdf
        - youtube
        - twitter
        - instagram
        - tiktok
        - facebook
        - linkedin
        - pinterest
        - reddit
        - chatgpt
        - claude
        - annotation
        - image
        - transcribedMedia
        - audioRecording
        - selector
        - chatThread
        - twitterProfile
        - subreddit
        - youtubeChannel
      description: Exact persisted `content_entity.type` value.
    ViewFeedEntryScope:
      type: string
      enum:
        - all
        - saved
    ViewExpressionOperator:
      type: string
      enum:
        - AND
        - OR
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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