Skip to content

Create a Component

Terminal window
https://mapi.storyblok.com/v1/spaces/:space_id/components/

You can set any property available in the component object. Below we only list the properties in the example and the possible required fields.

  • :space_id required number

    Numeric ID of a space

  • component The Component Object

    The component object

    Show child properties
    • name required string

      Technical name of a component. Visible in the content editor if the display_name is null.

    • display_name string

      Name displayed in the content editor

    • schema object

      Key value pairs of the component fields

    • image string | null

      URL of the component preview image (if uploaded)

    • preview_field string

      The component preview field in the UI

    • is_root boolean

      true if a component can be used as a content type block

    • preview_tmpl string

      The component preview template. Learn how to create a preview template.

    • is_nestable boolean

      true if a component is a Nestable block

    • component_group_id string

      The component folder ID

    • icon string

      Icon of the component

    • color string

      Color of the icon

    • internal_tag_ids string[]

      List of IDs of the internal tags assigned to a component

    • content_type_asset_preview string

      Asset preview field of a content type block

curl "https://mapi.storyblok.com/v1/spaces/606/components/" \
-X POST \
-H "Authorization: YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"component\":{\"display_name\":null,\"is_nestable\":true,\"is_root\":false,\"name\":\"banner_section\",\"schema\":{\"headline\":{\"description\":\"This field is used to render a title\",\"pos\":0,\"translatable\":true,\"type\":\"text\"}}}}"