> ## 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.

# Save content entity

> Save content entities. URL saves can pass data.url with optional metadata and tags.



## OpenAPI

````yaml /api-reference/openapi.json post /save-content-entity
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:
  /save-content-entity:
    post:
      summary: Save content entity
      description: >-
        Save content entities. URL saves can pass data.url with optional
        metadata and tags.
      operationId: saveContentEntity
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SaveContentEntityRequest'
            examples:
              webUrl:
                summary: Save a URL with tags
                value:
                  data:
                    url: https://example.com/article
                  tags:
                    - reading
                    - research
      responses:
        '200':
          description: Save response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SaveContentEntityResponse'
        '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:
    SaveContentEntityRequest:
      type: object
      required:
        - data
      properties:
        data:
          type: object
          required:
            - url
          properties:
            url:
              type: string
              format: uri
            title:
              type: string
            description:
              type: string
            html:
              type: string
              description: Optional HTML body for web saves.
          additionalProperties: true
        tags:
          type: array
          items:
            type: string
          description: Tag names. Missing tags are created and attached.
        includeHtml:
          type: boolean
          description: If true, the response includes HTML on web entities.
        responseMode:
          type: string
          enum:
            - content
            - receipt
          description: >-
            Use receipt to return after the processing request is queued instead
            of waiting for entity data.
      additionalProperties: true
    SaveContentEntityResponse:
      oneOf:
        - type: object
          required:
            - entity
            - entities
            - isNew
          properties:
            entity:
              $ref: '#/components/schemas/ContentEntity'
            entities:
              type: array
              items:
                $ref: '#/components/schemas/ContentEntity'
            tags:
              type: array
              items:
                $ref: '#/components/schemas/TagEntity'
            isNew:
              type: boolean
        - type: object
          required:
            - ok
            - processingRequestId
          properties:
            ok:
              type: boolean
              const: true
            processingRequestId:
              type: string
              format: uuid
    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
    ContentEntity:
      oneOf:
        - $ref: '#/components/schemas/WebContentEntity'
        - $ref: '#/components/schemas/TweetContentEntity'
        - $ref: '#/components/schemas/YoutubeContentEntity'
        - $ref: '#/components/schemas/ImageContentEntity'
        - $ref: '#/components/schemas/RedditContentEntity'
        - $ref: '#/components/schemas/OtherContentEntity'
      discriminator:
        propertyName: type
        mapping:
          web: '#/components/schemas/WebContentEntity'
          twitter: '#/components/schemas/TweetContentEntity'
          youtube: '#/components/schemas/YoutubeContentEntity'
          image: '#/components/schemas/ImageContentEntity'
          reddit: '#/components/schemas/RedditContentEntity'
      description: >-
        Union over Memex content entities. API-facing documented variants are
        web, twitter (tweets), youtube, image, and reddit.
    TagEntity:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
        name:
          type: string
        created_at:
          type: number
          description: Unix timestamp in milliseconds.
        updated_at:
          type: number
          description: Unix timestamp in milliseconds.
      additionalProperties: true
    WebContentEntity:
      allOf:
        - $ref: '#/components/schemas/ContentEntityBase'
        - type: object
          required:
            - type
            - title
            - url
            - normalized_url
          properties:
            type:
              type: string
              const: web
            title:
              type: string
            url:
              type: string
            normalized_url:
              type: string
            canonical_url:
              type: string
            favicon_url:
              type: string
            description:
              type: string
            keywords:
              type: string
            author:
              type: string
            date:
              type: string
            html:
              type: string
            full_text:
              type: string
          additionalProperties: true
    TweetContentEntity:
      allOf:
        - $ref: '#/components/schemas/ContentEntityBase'
        - type: object
          required:
            - type
            - author_name
            - author_handle
            - text
          properties:
            type:
              type: string
              const: twitter
            author_name:
              type: string
            author_handle:
              type: string
            title:
              type: string
            text:
              type: string
            published_at:
              type: number
              description: Unix timestamp in milliseconds.
            save_type:
              type: string
              enum:
                - like
                - retweet
                - bookmark
            videos:
              type: array
              items:
                $ref: '#/components/schemas/TweetVideo'
            images:
              type: array
              items:
                type: string
            image_analysis:
              $ref: '#/components/schemas/ImageAnalysisMap'
          additionalProperties: true
    YoutubeContentEntity:
      allOf:
        - $ref: '#/components/schemas/ContentEntityBase'
        - type: object
          required:
            - type
            - title
            - description
            - thumbnail_url
            - published_at
          properties:
            type:
              type: string
              const: youtube
            title:
              type: string
            description:
              type: string
            thumbnail_url:
              type: string
            published_at:
              type: number
              description: Unix timestamp in milliseconds.
            transcript:
              type: object
              description: Map of language code to transcript segments.
              additionalProperties:
                type: array
                items:
                  $ref: '#/components/schemas/YoutubeTranscriptSegment'
            summary:
              type: object
              description: Map of language code to generated summary text.
              additionalProperties:
                type: string
          additionalProperties: true
    ImageContentEntity:
      allOf:
        - $ref: '#/components/schemas/ContentEntityBase'
        - type: object
          required:
            - type
            - description
          properties:
            type:
              type: string
              const: image
            description:
              type: string
            original_url:
              type: string
            is_reference:
              type: boolean
            source_url:
              type: string
            source_title:
              type: string
          additionalProperties: true
    RedditContentEntity:
      allOf:
        - $ref: '#/components/schemas/ContentEntityBase'
        - type: object
          required:
            - type
            - text
            - author_name
            - author_handle
          properties:
            type:
              type: string
              const: reddit
            title:
              type: string
            text:
              type: string
            author_name:
              type: string
            author_handle:
              type: string
            author_favicon_url:
              type: string
            subreddit_favicon_url:
              type: string
            media_urls:
              type: array
              items:
                type: string
            videos:
              type: array
              items:
                $ref: '#/components/schemas/RedditVideo'
            permalink:
              type: string
            subreddit_id:
              type: string
            subreddit_name:
              type: string
            image_analysis:
              $ref: '#/components/schemas/ImageAnalysisMap'
          additionalProperties: true
    OtherContentEntity:
      allOf:
        - $ref: '#/components/schemas/ContentEntityBase'
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - pdf
                - instagram
                - tiktok
                - facebook
                - linkedin
                - pinterest
                - chatgpt
                - claude
                - annotation
                - transcribedMedia
                - audioRecording
                - selector
                - chatThread
                - twitterProfile
                - subreddit
                - youtubeChannel
          additionalProperties: true
    ContentEntityBase:
      type: object
      required:
        - id
        - type
        - created_at
        - updated_at
      properties:
        id:
          type: string
        type:
          $ref: '#/components/schemas/ContentEntityType'
        created_at:
          type: number
          description: Unix timestamp in milliseconds.
        updated_at:
          type: number
          description: Unix timestamp in milliseconds.
        user_id:
          type: string
          description: Owner user ID when present.
        external_id:
          type: string
          description: Deterministic/shared external identifier.
        url:
          type: string
          description: >-
            Resolved source URL when Memex can derive a stable reference link
            for this entity.
        tag_ids:
          type: array
          items:
            type: string
          description: Tag IDs linked directly to this entity.
        reference_content_ids:
          type: array
          items:
            type: string
          description: Referenced content entity IDs.
      additionalProperties: true
    TweetVideo:
      type: object
      required:
        - variants
      properties:
        variants:
          type: array
          items:
            $ref: '#/components/schemas/TweetMediaVariant'
        duration:
          type: number
        preview_url:
          type: string
      additionalProperties: true
    ImageAnalysisMap:
      type: object
      description: Map of image URL to an analysis object.
      additionalProperties:
        $ref: '#/components/schemas/ImageAnalysisEntry'
    YoutubeTranscriptSegment:
      type: object
      required:
        - offset
        - text
        - duration
      properties:
        offset:
          oneOf:
            - type: string
            - type: number
        text:
          type: string
        duration:
          type: number
      additionalProperties: true
    RedditVideo:
      type: object
      required:
        - url
      properties:
        url:
          type: string
        preview_url:
          type: string
      additionalProperties: true
    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.
    TweetMediaVariant:
      type: object
      required:
        - url
      properties:
        content_type:
          type: string
        url:
          type: string
        bitrate:
          type: number
      additionalProperties: true
    ImageAnalysisEntry:
      type: object
      required:
        - description
      properties:
        description:
          type: string
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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