Skip to main content

Components

Components are the building blocks of a page. Each component has a type (e.g. text content, image gallery, form, links) and type-specific form data that defines its content and options. Components belong to a page and are scoped by page template (e.g. LINK, VCARD_PLUS) so different templates can show different component sets.

In this section

  • Endpoints (this page): list, create, get, update, delete, and bulk operations for components.
  • Component types: full reference for the type enum and the form_data structure for each type. Use it when building request bodies for create/update.

All component endpoints require authentication unless noted otherwise.


List Components

Get a list of all components for a page.

GET https://v1.freeqr.io/api/pages/{page}/components

Requires Authentication: Yes

Path Parameters

ParameterTypeRequiredDescription
pagestring (ULID)YesPage ID

Query Parameters

ParameterTypeRequiredDescription
pageintegerNoPage number (default: 1)
limitintegerNoItems per page (default: 10, max: 100)
filtersobjectNoFilter object (see Filters section below)

Filters

Filters allow you to narrow down the results based on specific criteria. Filters are passed as a query parameter object:

GET https://v1.freeqr.io/api/pages/{page}/components?filters[page_template]=0

page_template

The page_template filter acts as a scope that isolates components into separate sets. Each page template maintains its own independent collection of components, meaning components created for one template are completely separate from components in other templates.

For example:

  • Components created with page_template=1 (LINK) are isolated from components with page_template=2 (VCARD_PLUS)
  • Each template scope can have its own set of components with their own sorting, visibility, and form data
  • When you query components, you must specify the page_template filter to access components within that specific scope

Default Behavior:

  • If the page_template filter is not provided, the API will automatically use the page's template as the default scope
  • If the page doesn't have a template set, it falls back to DEFAULT (0)
  • If an invalid page_template value is provided, it will also use the page's template (or DEFAULT if the page has no template)
ValueTemplateDescription
0DEFAULTDefault template (fallback if page has no template)
1LINKLink template
2VCARD_PLUSvCard Plus template
3DOCUMENTDocument template
4SOCIALSocial template
5IMAGESImages template
6VIDEOSVideos template
7AUDIOAudio template
8PRODUCTSProducts template
9BUSINESSBusiness template
10EVENTEvent template
11COUPONCoupon template
12FEEDBACKFeedback template

Note: If the specified template doesn't have components yet, default components will be automatically created for that template scope.

Example Request with Filter

curl -X GET "https://v1.freeqr.io/api/pages/{page}/components?filters[page_template]=1" \
-H "Authorization: Bearer your-api-key-here"

Response

{
"data": [
{
"id": "01arz3ndektsv4rrffq69g5fav",
"type": 1,
"title": "My Component",
"description": "Component description",
"visibility": 1,
"sorting": 0,
"created_at": "2024-01-01T00:00:00.000000Z",
"updated_at": "2024-01-01T00:00:00.000000Z"
}
],
"meta": {
"total": 1
},
"included_files": []
}

Create Component

Create a new component for a page.

POST https://v1.freeqr.io/api/pages/{page}/components

Requires Authentication: Yes

Path Parameters

ParameterTypeRequiredDescription
pagestring (ULID)YesPage ID

Request Body

{
"type": 1,
"page_template": 0,
"visibility": 1,
"show_header": true,
"wrap_content": true,
"title": "My Component",
"description": "Component description",
"form_data": {
"content": "Rich text content here"
},
"sorting": 0
}

Note: The form_data structure depends on the component type. See Component types for the full reference.

Parameters

ParameterTypeRequiredDescription
typeintegerYesComponent type (1–11). See Component types for the enum and form_data for each type.
page_templateintegerNoPage template enum: 0 (DEFAULT), 1 (LINK), 2 (VCARD_PLUS), etc.
visibilityintegerNoVisibility level enum: 1 (PUBLIC), 2 (HIDDEN), 3 (PRIVATE)
show_headerbooleanNoWhether to show header
wrap_contentbooleanNoWhether to wrap content
titlestringNoComponent title (max 100 characters)
descriptionstringNoComponent description (max 255 characters)
form_dataobjectNoComponent form data. Structure depends on type. See Component types for type-specific structures.
sortingintegerNoSort order (0-1000000)

Response

{
"data": {
"id": "01arz3ndektsv4rrffq69g5fav",
"type": 1,
"title": "My Component",
"description": "Component description",
"visibility": 1,
"sorting": 0,
"created_at": "2024-01-01T00:00:00.000000Z",
"updated_at": "2024-01-01T00:00:00.000000Z"
}
}

Bulk Store Components

Create multiple components at once.

POST https://v1.freeqr.io/api/pages/{page}/components:bulk_store

Requires Authentication: Yes

Path Parameters

ParameterTypeRequiredDescription
pagestring (ULID)YesPage ID

Request Body

{
"components": [
{
"type": 1,
"title": "Component 1",
"form_data": {},
"sorting": 0
},
{
"type": 2,
"title": "Component 2",
"form_data": {},
"sorting": 1
}
]
}

Parameters

ParameterTypeRequiredDescription
componentsarrayYesArray of component objects (max 20 items)

Each component object uses the same parameters as Create Component.

Response

{
"data": [
{
"id": "01arz3ndektsv4rrffq69g5fav",
"type": 1,
"title": "Component 1",
"sorting": 0,
"created_at": "2024-01-01T00:00:00.000000Z",
"updated_at": "2024-01-01T00:00:00.000000Z"
},
{
"id": "01arz3ndektsv4rrffq69g5fav",
"type": 2,
"title": "Component 2",
"sorting": 1,
"created_at": "2024-01-01T00:00:00.000000Z",
"updated_at": "2024-01-01T00:00:00.000000Z"
}
]
}

Bulk Update Components

Update multiple components at once.

POST https://v1.freeqr.io/api/pages/{page}/components:bulk_update

Requires Authentication: Yes

Path Parameters

ParameterTypeRequiredDescription
pagestring (ULID)YesPage ID

Request Body

{
"components": [
{
"id": "01arz3ndektsv4rrffq69g5fav",
"title": "Updated Component 1",
"sorting": 0
},
{
"id": "01arz3ndektsv4rrffq69g5fav",
"title": "Updated Component 2",
"sorting": 1
}
]
}

Parameters

ParameterTypeRequiredDescription
componentsarrayYesArray of component objects with id and fields to update

Response

{
"data": [
{
"id": "01arz3ndektsv4rrffq69g5fav",
"type": 1,
"title": "Updated Component 1",
"sorting": 0,
"created_at": "2024-01-01T00:00:00.000000Z",
"updated_at": "2024-01-01T00:00:00.000000Z"
},
{
"id": "01arz3ndektsv4rrffq69g5fav",
"type": 2,
"title": "Updated Component 2",
"sorting": 1,
"created_at": "2024-01-01T00:00:00.000000Z",
"updated_at": "2024-01-01T00:00:00.000000Z"
}
]
}

Get Component

Get a specific component by ID.

GET https://v1.freeqr.io/api/components/{id}

Requires Authentication: Yes

Path Parameters

ParameterTypeRequiredDescription
idstring (ULID)YesComponent ID

Response

{
"data": {
"id": "01arz3ndektsv4rrffq69g5fav",
"type": 1,
"title": "My Component",
"description": "Component description",
"visibility": 1,
"sorting": 0,
"created_at": "2024-01-01T00:00:00.000000Z",
"updated_at": "2024-01-01T00:00:00.000000Z"
}
}

Update Component

Update an existing component.

PATCH https://v1.freeqr.io/api/components/{id}

Requires Authentication: Yes

Path Parameters

ParameterTypeRequiredDescription
idstring (ULID)YesComponent ID

Request Body

Same parameters as Create Component, but all fields are optional.

Response

{
"data": {
"id": "01arz3ndektsv4rrffq69g5fav",
"type": 1,
"title": "Updated Component",
"description": "Updated description",
"visibility": 1,
"sorting": 1,
"created_at": "2024-01-01T00:00:00.000000Z",
"updated_at": "2024-01-01T00:00:00.000000Z"
}
}

Delete Component

Delete a component.

DELETE https://v1.freeqr.io/api/components/{id}

Requires Authentication: Yes

Path Parameters

ParameterTypeRequiredDescription
idstring (ULID)YesComponent ID

Response

Returns the deleted component resource (same structure as Get Component).


See also

  • Component types — Full reference for the type enum and form_data structure for each type.
  • Pages — Components belong to pages; create and manage pages first.
  • Files — Many component types reference file IDs (images, videos, audio, etc.) from the Files API.