Skip to content

Create Block

POST/blocks

Create a new block.

Attributes

AttributeTypeDescription
type *enumtext, header, gallery, video, speakers, schedule, sponsors, organisers, location, countdown, mailinglist, live, custom, organisation-events, menu-organisation, link, message-text, message-image. The type of block. Determines which content fields are valid.
status *enumpublished, preview, deleted, hidden. Block visibility status.
slugstring
ordernumber
contentobjectBlock content object. ONLY use fields listed for the specific type — unknown fields are silently stripped. Shared fields (all types): name, cssClassName, theme (primary|inverted|secondary|custom), style (spacing object with spacing/spacingTop/spacingBottom each: small|medium|large|custom), blockStyleSettings (colors/fonts/css/effects), includeTickets (bool), filterTicketBatches (number[]), url. Type-specific fields: - text, message-text: html, textLayout (text-only|image-left|image-right|image-top|image-background|custom), showSocial, showRsvpButton, ctaText, ctaUrl - header: title, headerStyle (text|logo|none), logoSize, coverStyle (fullscreen|poster|compact), shadowStyle (gradient|grid|none), shadowOpacity, headerTextColor, ctaText, ctaUrl - gallery: title, html, galleryLayout (standard|grid|info|custom) - video: videoEmbedId, videoEmbedType (youtube|vimeo|vimeo-event|facebook|twitch), videoEmbedVimeoChat, videoLayout (block|block-large|theater) - speakers: title, speakersLayout (standard|grid|full|preview|custom), speakersShowSelected, speakersSettings ({id, order, show, isAnnounced?}[]), focusOn (speaker|talk), speakersPagePath, schedulePagePath - schedule: title, speakersPagePath - organisers: title, organisersLayout (standard|minimal) - location: html, showMap, showRsvpButton - countdown: title, countdownType (custom|event-start-date), countdownTo (ISO date string) - mailinglist: title, showPublicCategories, categoriesTitle - live: liveStreamId, liveStreamMode (block|theater) - custom: html - organisation-events: title, organisationEventsLayout (standard|grid-layout), organisationEventsSelection (all|upcoming|past) - sponsors, menu-organisation, link, message-image: shared fields only When updating, provide the complete content object — partial content replaces the entire content.
blockStyleIdnumber
pageIdnumber
eventIdnumber
workspaceIdnumber
categoryIdsarray of numbers

Fields marked with * are required.

Request

js
import Confetti from 'confetti'

const confetti = new Confetti({ apiKey: 'your-key' })

const block = await confetti.blocks.create({
  type: 'text',
  status: 'published',
})
sh
curl -X POST "https://api.confetti.events/blocks" \
  -H "Content-Type: application/json" \
  -H "Authorization: apikey your-key" \
  -d '{
  "data": {
    "type": "block",
    "attributes": {
      "type": "text",
      "status": "published"
    }
  }
}'