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

# Create a CMS Section

> Creates a CMS Section



## OpenAPI

````yaml /api-reference/platform.yaml post /api/v2/platform/cms_sections
openapi: 3.0.3
info:
  title: Platform API
  contact:
    name: Vendo Connect Inc.
    url: https://getvendo.com
    email: sales@getvendo.com
  description: Spree Platform API
  version: v2
servers:
  - url: http://{defaultHost}
    variables:
      defaultHost:
        default: localhost:3000
security: []
tags:
  - name: Addresses
  - name: Adjustments
  - name: Classifications
  - name: Countries
  - name: CMS Pages
  - name: CMS Sections
  - name: Digital Assets
  - name: Digital Links
  - name: Line Items
  - name: Menus
  - name: Menu Items
  - name: Option Types
  - name: Option Values
  - name: Orders
  - name: Payments
  - name: Payment Methods
  - name: Products
  - name: Promotions
  - name: Promotion Actions
  - name: Promotion Categories
  - name: Promotion Rules
  - name: Roles
  - name: Shipments
  - name: Shipping Categories
  - name: Shipping Methods
  - name: States
  - name: Stock Items
  - name: Stock Locations
  - name: Store Credit Categories
  - name: Store Credit Types
  - name: Store Credits
  - name: Tax Categories
  - name: Tax Rates
  - name: Taxons
  - name: Taxonomies
  - name: Users
  - name: Variants
  - name: Vendors
  - name: Webhook Events
  - name: Webhook Subscribers
  - name: Wishlists
  - name: Wished Items
  - name: Zones
paths:
  /api/v2/platform/cms_sections:
    post:
      tags:
        - CMS Sections
      summary: Create a CMS Section
      description: Creates a CMS Section
      operationId: create-cms-section
      parameters:
        - name: include
          in: query
          description: >-
            Select which associated resources you would like to fetch, see: <a
            href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>
          example: product
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/create_hero_image_cms_section_params'
                - $ref: >-
                    #/components/schemas/create_product_carousel_cms_section_params
                - $ref: >-
                    #/components/schemas/create_side_by_side_images_cms_section_params
                - $ref: >-
                    #/components/schemas/create_featured_article_cms_section_params
                - $ref: '#/components/schemas/create_image_gallery_cms_section_params'
                - $ref: '#/components/schemas/create_rich_text_cms_section_params'
      responses:
        '201':
          description: Record created
          content:
            application/vnd.api+json:
              examples:
                Example:
                  value:
                    data:
                      id: '13'
                      type: cms_section
                      attributes:
                        name: Hic iste cupiditate corrupti esse minima.
                        content: {}
                        settings:
                          gutters: No Gutters
                        fit: Screen
                        destination: null
                        type: Spree::Cms::Sections::HeroImage
                        position: 3
                        linked_resource_type: Spree::Product
                        created_at: '2022-11-08T19:34:04.185Z'
                        updated_at: '2022-11-08T19:34:04.185Z'
                      relationships:
                        cms_page:
                          data:
                            id: '15'
                            type: cms_page
                        linked_resource:
                          data:
                            id: '23'
                            type: product
              schema:
                $ref: '#/components/schemas/resource'
        '422':
          description: Invalid request
          content:
            application/vnd.api+json:
              examples:
                Example:
                  value:
                    error: >-
                      Name can't be blank, Cms page can't be blank, and Type
                      can't be blank
                    errors:
                      name:
                        - can't be blank
                      cms_page:
                        - can't be blank
                      type:
                        - can't be blank
              schema:
                $ref: '#/components/schemas/validation_errors'
      security:
        - bearer_auth: []
components:
  schemas:
    create_hero_image_cms_section_params:
      type: object
      properties:
        cms_section:
          type: object
          required:
            - name
            - cms_page_id
            - type
          properties:
            name:
              type: string
              description: Give this section a name.
            cms_page_id:
              type: string
              description: Set the `cms_page` ID that this section belongs to.
            type:
              type: string
              enum:
                - Spree::Cms::Sections::HeroImage
              example: Spree::Cms::Sections::HeroImage
              description: Set the section type.
            linked_resource_type:
              type: string
              example: Spree::Taxon
              nullable: true
              enum:
                - Spree::Taxon
                - Spree::Product
                - Spree::CmsPage
              description: Set the resource type that this section links to.
            linked_resource_id:
              type: string
              example: '1'
              nullable: true
              description: >-
                Set the ID of the resource that you would like this section to
                link to.
            fit:
              type: string
              example: Screen
              enum:
                - Screen
                - Container
              description: >-
                This value is used by front end developers to set CSS classes
                for content that fits the screen edge-to-edge, or stays within
                the boundaries of the central container.
            position:
              type: integer
              example: 2
              description: >-
                Pass the position that you want this section to appear in. (The
                list is not zero indexed, so the first item is position: `1`)
            gutters:
              type: string
              example: No Gutters
              enum:
                - Gutters
                - No Gutters
              description: >-
                This value is used by front end developers for styling the
                section padding.
            button_text:
              type: string
              example: Click Here
              description: Set the text value of the button used in this section.
            title:
              type: string
              example: Shop Today
              description: Create a title for the Hero Section.
            cms_section[image_one]:
              type: string
              format: binary
              description: Use a `multipart/form-data` request to upload assets.
      required:
        - cms_section
      title: Create a Hero Image Section
      x-internal: false
    create_product_carousel_cms_section_params:
      type: object
      properties:
        cms_section:
          type: object
          required:
            - name
            - cms_page_id
            - type
          properties:
            name:
              type: string
              description: Give this section a name.
            cms_page_id:
              type: string
              description: Set the `cms_page` ID that this section belongs to.
            type:
              type: string
              enum:
                - Spree::Cms::Sections::ProductCarousel
              example: Spree::Cms::Sections::ProductCarousel
              description: Set the section type.
            position:
              type: integer
              example: 2
              description: >-
                Pass the position that you want this section to appear in. (The
                list is not zero indexed, so the first item is position: `1`)
            linked_resource_id:
              type: string
              example: '1'
              nullable: true
              description: >-
                Set the ID of the Taxon that you would like displayed as a
                Product Carousel.
      required:
        - cms_section
      title: Create a Product Carousel Section
      x-internal: false
    create_side_by_side_images_cms_section_params:
      type: object
      properties:
        cms_section:
          type: object
          required:
            - name
            - cms_page_id
            - type
          properties:
            name:
              type: string
              description: Give this section a name.
            cms_page_id:
              type: string
              description: Set the `cms_page` ID that this section belongs to.
            type:
              type: string
              enum:
                - Spree::Cms::Sections::SideBySideImages
              example: Spree::Cms::Sections::SideBySideImages
              description: Set the section type.
            position:
              type: integer
              example: 2
              description: >-
                Pass the position that you want this section to appear in. (The
                list is not zero indexed, so the first item is position: `1`)
            link_type_one:
              type: string
              example: Spree::Taxon
              enum:
                - Spree::Taxon
                - Spree::Product
              description: Set the resource type that image one links to.
            link_type_two:
              type: string
              example: Spree::Taxon
              enum:
                - Spree::Taxon
                - Spree::Product
              description: Set the resource type that image two links to.
            link_one:
              type: string
              example: men/shirts
              nullable: true
              description: Set the slug or path that image two links to.
            link_two:
              type: string
              example: white-shirt
              nullable: true
              description: Set the slug or path that image two links to.
            title_one:
              type: string
              example: Shop Men's Shirts
              nullable: true
              description: Set the title used in image one.
            title_two:
              type: string
              example: Buy This Men's Shirt
              nullable: true
              description: Set the title used in image two.
            fit:
              type: string
              example: Screen
              enum:
                - Screen
                - Container
              description: >-
                This value is used by front end developers to set CSS classes
                for content that fits the screen edge-to-edge, or stays within
                the boundaries of the central container.
            subtitle_one:
              type: string
              example: Save 50% today
              nullable: true
              description: Set the subtitle used in image one.
            subtitle_two:
              type: string
              example: Save 50% today
              nullable: true
              description: Set the subtitle used in image two.
            gutters:
              type: string
              example: No Gutters
              enum:
                - Gutters
                - No Gutters
              description: >-
                This value is used by front end developers for styling the
                section padding.
            cms_section[image_one]:
              type: string
              format: binary
              description: Use a `multipart/form-data` request to upload assets.
            cms_section[image_two]:
              type: string
              format: binary
              description: Use a `multipart/form-data` request to upload assets.
      required:
        - cms_section
      title: Create a Side-by-Side Image Section
      x-internal: false
    create_featured_article_cms_section_params:
      type: object
      properties:
        cms_section:
          type: object
          required:
            - name
            - cms_page_id
            - type
          properties:
            name:
              type: string
              description: Give this section a name.
            cms_page_id:
              type: string
              description: Set the `cms_page` ID that this section belongs to.
            type:
              type: string
              enum:
                - Spree::Cms::Sections::FeaturedArticle
              example: Spree::Cms::Sections::FeaturedArticle
              description: Set the section type.
            position:
              type: integer
              example: 2
              description: >-
                Pass the position that you want this section to appear in. (The
                list is not zero indexed, so the first item is position: `1`)
            linked_resource_type:
              type: string
              example: Spree::Taxon
              nullable: true
              enum:
                - Spree::Taxon
                - Spree::Product
                - Spree::CmsPage
              description: Set the resource type that this section links to.
            linked_resource_id:
              type: string
              example: '1'
              nullable: true
              description: >-
                Set the ID of the resource that you would like this section to
                link to.
            fit:
              type: string
              example: Screen
              enum:
                - Screen
                - Container
              description: >-
                This value is used by front end developers to set CSS classes
                for content that fits the screen edge-to-edge, or stays within
                the boundaries of the central container.
            gutters:
              type: string
              example: No Gutters
              enum:
                - Gutters
                - No Gutters
              description: >-
                This value is used by front end developers for styling the
                section padding.
            button_text:
              type: string
              example: Click Here
              description: Set the text value of the button used in this section.
            title:
              type: string
              example: Shop Today
              description: Create a title for the Section.
            subtitle:
              type: string
              example: Save Big!
              description: Create a subtitle for the Section.
            rte_content:
              type: string
              example: Lots of text and content goes here.
              description: Set the content, here, this can be rich text editor content.
      required:
        - cms_section
      title: Create a Featured Article Section
      x-internal: false
    create_image_gallery_cms_section_params:
      type: object
      properties:
        cms_section:
          type: object
          required:
            - name
            - cms_page_id
            - type
          properties:
            name:
              type: string
              description: Give this section a name.
            cms_page_id:
              type: string
              description: Set the `cms_page` ID that this section belongs to.
            type:
              type: string
              enum:
                - Spree::Cms::Sections::ImageGallery
              example: Spree::Cms::Sections::ImageGallery
              description: Set the section type.
            position:
              type: integer
              example: 2
              description: >-
                Pass the position that you want this section to appear in. (The
                list is not zero indexed, so the first item is position: `1`)
            link_type_one:
              type: string
              example: Spree::Taxon
              enum:
                - Spree::Taxon
                - Spree::Product
              description: Set the resource type that image one links to.
            link_type_two:
              type: string
              example: Spree::Taxon
              enum:
                - Spree::Taxon
                - Spree::Product
              description: Set the resource type that image two links to.
            link_type_three:
              type: string
              example: Spree::Taxon
              enum:
                - Spree::Taxon
                - Spree::Product
              description: Set the resource type that image three links to.
            link_one:
              type: string
              example: men/shirts
              nullable: true
              description: Set the slug or path that image two links to.
            link_two:
              type: string
              example: white-shirt
              nullable: true
              description: Set the slug or path that image two links to.
            link_three:
              type: string
              example: red-shirt
              nullable: true
              description: Set the slug or path that image three links to.
            title_one:
              type: string
              example: Shop Men's Shirts
              nullable: true
              description: Set the title used in image one.
            title_two:
              type: string
              example: Buy This Men's Shirt
              nullable: true
              description: Set the title used in image two.
            title_three:
              type: string
              example: Buy This Women's Skirt
              nullable: true
              description: Set the title used in image three.
            fit:
              type: string
              example: Screen
              enum:
                - Screen
                - Container
              description: >-
                This value is used by front end developers to set CSS classes
                for content that fits the screen edge-to-edge, or stays within
                the boundaries of the central container.
            layout_style:
              type: string
              example: Default
              enum:
                - Default
                - Reversed
              description: >-
                This value is used by front end developers for styling the order
                the images appear.
            display_labels:
              type: string
              example: Show
              enum:
                - Show
                - Hide
              description: >-
                This value is used by front end developers for showing and
                hiding the label on the images.
            cms_section[image_one]:
              type: string
              format: binary
              description: Use a `multipart/form-data` request to upload assets.
            cms_section[image_two]:
              type: string
              format: binary
              description: Use a `multipart/form-data` request to upload assets.
            cms_section[image_three]:
              type: string
              format: binary
              description: Use a `multipart/form-data` request to upload assets.
      required:
        - cms_section
      title: Create an Image Gallery Section
      x-internal: false
    create_rich_text_cms_section_params:
      type: object
      properties:
        cms_section:
          type: object
          required:
            - name
            - cms_page_id
            - type
          properties:
            name:
              type: string
              description: Give this section a name.
            cms_page_id:
              type: string
              description: Set the `cms_page` ID that this section belongs to.
            type:
              type: string
              enum:
                - Spree::Cms::Sections::RichTextContent
              example: Spree::Cms::Sections::RichTextContent
              description: Set the section type.
            position:
              type: integer
              example: 2
              description: >-
                Pass the position that you want this section to appear in. (The
                list is not zero indexed, so the first item is position: `1`)
            fit:
              type: string
              example: Screen
              enum:
                - Screen
                - Container
              description: >-
                This value is used by front end developers to set CSS classes
                for content that fits the screen edge-to-edge, or stays within
                the boundaries of the central container.
            rte_content:
              type: string
              example: Lots of text and content goes here.
              description: Set the content, here, this can be rich text editor content.
      required:
        - cms_section
      title: Create a Rich Text Section
      x-internal: false
    resource:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/resource_properties'
      required:
        - data
      x-internal: false
    validation_errors:
      type: object
      properties:
        error:
          type: string
        errors:
          type: object
      required:
        - error
        - errors
      x-internal: false
    resource_properties:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        attributes:
          type: object
        relationships:
          type: object
      required:
        - id
        - type
        - attributes
      x-internal: false
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer

````