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

# Save Collection Endpoint



## OpenAPI

````yaml /api-reference/openapi/foundation-portal.json patch /api/v1/merchants/{merchant_id}/collections/{collection_id}
openapi: 3.1.0
info:
  title: Depict Foundation Portal API
  version: 1.0.0
  description: >-
    REST API behind the Depict Foundation merchant portal: merchants, products,
    collections, curation, metrics, analytics and search insights. All endpoints
    require an Auth0-issued bearer token.
servers:
  - url: ''
security: []
paths:
  /api/v1/merchants/{merchant_id}/collections/{collection_id}:
    patch:
      tags:
        - Collections
      summary: Save Collection Endpoint
      operationId: >-
        save_collection_endpoint_api_v1_merchants__merchant_id__collections__collection_id__patch
      parameters:
        - name: merchant_id
          in: path
          required: true
          schema:
            type: string
            title: Merchant Id
        - name: collection_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Collection Id
        - name: locale
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Locale
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CollectionSaveRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Auth0: []
components:
  schemas:
    CollectionSaveRequest:
      properties:
        market_group_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Market Group Id
        market_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Market Id
        localized_titles:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Localized Titles
        uri:
          anyOf:
            - type: string
              maxLength: 512
            - type: 'null'
          title: Uri
        show_in_filter:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Show In Filter
        show_in_search_suggestions:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Show In Search Suggestions
        appear_in_quicklinks:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Appear In Quicklinks
        display_breadcrumb:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Display Breadcrumb
        pinned_main_product_ids:
          anyOf:
            - items:
                type: string
              type: array
              maxItems: 2000
            - type: 'null'
          title: Pinned Main Product Ids
        hidden_main_product_ids:
          anyOf:
            - items:
                type: string
              type: array
              maxItems: 2000
            - type: 'null'
          title: Hidden Main Product Ids
        added_main_product_ids:
          anyOf:
            - items:
                type: string
              type: array
              maxItems: 2000
            - type: 'null'
          title: Added Main Product Ids
        removed_main_product_ids:
          anyOf:
            - items:
                type: string
              type: array
              maxItems: 2000
            - type: 'null'
          title: Removed Main Product Ids
        pinned_collection_ids:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Pinned Collection Ids
        content_blocks:
          anyOf:
            - items:
                $ref: '#/components/schemas/ContentBlock'
              type: array
              maxItems: 100
            - type: 'null'
          title: Content Blocks
        cover_image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Cover Image Url
        ranking_type:
          anyOf:
            - $ref: '#/components/schemas/CollectionRankingType'
            - type: 'null'
        added_filter_rules:
          anyOf:
            - items:
                items:
                  $ref: '#/components/schemas/PortalSearchFilter'
                type: array
              type: array
              maxItems: 100
            - type: 'null'
          title: Added Filter Rules
      type: object
      title: CollectionSaveRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ContentBlock:
      properties:
        span_columns:
          type: integer
          title: Span Columns
        span_rows:
          type: integer
          title: Span Rows
        position:
          $ref: '#/components/schemas/ContentPosition'
        row:
          type: integer
          title: Row
        content:
          anyOf:
            - $ref: '#/components/schemas/ImageContent'
            - $ref: '#/components/schemas/VideoContent'
          title: Content
      type: object
      required:
        - span_columns
        - span_rows
        - position
        - row
        - content
      title: ContentBlock
    CollectionRankingType:
      type: string
      enum:
        - top
        - similar
        - complementary
      title: CollectionRankingType
    PortalSearchFilter:
      properties:
        field:
          type: string
          title: Field
        op:
          type: string
          enum:
            - eq
            - neq
            - in
            - nin
            - leq
            - geq
            - inrange
          title: Op
        data:
          title: Data
        meta:
          title: Meta
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
      type: object
      required:
        - field
        - op
      title: PortalSearchFilter
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ContentPosition:
      type: string
      enum:
        - left
        - right
        - center
      title: ContentPosition
    ImageContent:
      properties:
        type:
          type: string
          enum:
            - image
          const: image
          title: Type
          default: image
        url:
          type: string
          title: Url
        link:
          anyOf:
            - type: string
            - type: 'null'
          title: Link
      type: object
      required:
        - url
        - link
      title: ImageContent
    VideoContent:
      properties:
        type:
          type: string
          enum:
            - video
          const: video
          title: Type
          default: video
        url:
          type: string
          title: Url
        link:
          anyOf:
            - type: string
            - type: 'null'
          title: Link
      type: object
      required:
        - url
        - link
      title: VideoContent
  securitySchemes:
    Auth0:
      type: oauth2
      flows:
        authorizationCode:
          scopes:
            openid: OpenID Connect
            profile: User profile
            email: User email
          authorizationUrl: https://depict.eu.auth0.com/oauth/authorize
          tokenUrl: https://depict.eu.auth0.com/oauth/token
      x-tokenName: id_token

````