Create Component

Create a new Component

Creates a new page editor component definition. Components define the data structure and UI configuration for reusable content blocks in the Makaira Page Editor.

Requires authentication.

Request

POST /component

Headers

HeaderValue
AuthorizationBearer <token>
Content-Typeapplication/json

Request Body

FieldTypeRequiredDescription
identifierstringYesMachine-readable identifier used by the frontend to map this component to a React component.
namestringYesDisplay name shown in the Page Editor.
iconstringNoIcon identifier for the Page Editor. Must be one of the values supported by the Makaira UI.
sectionsarrayNoArray of section definitions. Each section groups related fields.

Section Object

FieldTypeDescription
typestringSection type.
uuidstringUnique identifier for this section.
fieldsarrayArray of field definitions. Each field has id, type, uuid, and label properties.

Example Request

{
  "identifier": "hero-banner",
  "name": "Hero Banner",
  "icon": "image",
  "sections": [
    {
      "type": "general",
      "uuid": "section-001",
      "fields": [
        {
          "id": "headline",
          "type": "text",
          "uuid": "field-001",
          "label": "Headline"
        },
        {
          "id": "image",
          "type": "image",
          "uuid": "field-002",
          "label": "Background Image"
        }
      ]
    }
  ]
}

Response

Returns the created component definition.

Body Params
string

The identifier used by the frontend to map the properties of the API into the right (React) component

string

The name used by the page editor for displaying/listing the component

string

The icon used by the page editor for displaying/listing the component. Only given values by Makaira UI are valid.

sections
array of objects
sections
Headers
string
required

Makaira Instance ID

Response
200

OK

Language
Credentials
Bearer
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here!