Retrieve Multiple Components
Returns an array of component objects. This endpoint's response is not paginated, so you will retrieve all components.
This endpoint also returns the information about the component groups (folders) in a separate key named component_groups
, which is an array of objects containing the details of component groups (folders) inside the space.
https://mapi.storyblok.com/v1/spaces/:space_id/components/
Path Parameters
-
:space_id
required numberNumeric ID of a space
Query Parameters
-
by_ids
stringFilter by ids (comma separated)
-
sort_by
stringComponents can be sorted in an ascending or descending order by a specific property. Following are a few options and examples
- Retrieve Nestable first -
is_nestable:desc,is_root:asc
- Retrieve Universal first -
is_nestable:desc,is_root:desc
- Retrieve Content Type first -
is_nestable:asc,is_root:desc
You can also use properties like
name
andupdated_at
. - Retrieve Nestable first -
-
is_root
booleanRetrieve all the components based on
is_root
property of a component. Set to true to retrieve all the components that can be used as content types or set to false to retrieve all the nestable components. -
search
stringSearch by
name
ordisplay_name
. -
in_group
stringFind components that are present in a specific group with the UUID of the group
Response Properties
-
components
The Component Object[]An array of components.
-
id
numberThe numeric ID
-
name
stringTechnical name used for component property in entries
-
display_name
stringName that will be used in the editor interface
-
created_at
stringCreation date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
updated_at
stringLatest update date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
schema
objectKey value pairs of component fields.
-
image
string or nullURL to the preview image, if uploaded
-
preview_field
stringThe field that is for preview in the interface (Preview Field)
-
is_root
booleanTrue if the component can be used as a Content Type
-
preview_tmpl
stringYour component preview template. You can learn how to design your preview template here.
-
is_nestable
booleanTrue if the component is nestable (insertable) in block field types
-
all_presets
object[]An array of presets for this component
-
id
numberThe numeric ID of the preset
-
name
stringName of the preset
-
component_id
numberThe ID of the component the preset is for
-
image
string or nullLink to the preview image of the preset
-
icon
stringIcon selected for the preset
-
color
stringColor of the icon selected for the preset
-
description
stringThe description of the preset
-
-
real_name
stringDuplicated technical name or display name, used for internal tasks
-
component_group_uuid
stringThe component folder ID of the component
-
color
stringThe color of the icon selected for the component
-
icon
stringIcon selected for the component
-
internal_tags_list
object[]List of objects containing the details of tags used for the component
-
id
numberId of the tag
-
name
stringName of the tag
-
-
internal_tag_ids
string[]List of ids of the tags assigned to the component
-
content_type_asset_preview
stringAsset preview field (Preview Card) for a content type component
-
-
component_groups
The Component Folder Object[]Component groups present inside the space
-
id
numberThe numeric ID
-
name
stringName of the group
-
uuid
stringUuid of the group
-
parent_id
numberID of the parent folder
-
parent_uuid
stringUUID of component's parent group (folder)
-
curl "https://mapi.storyblok.com/v1/spaces/606/components/" \
-X GET \
-H "Authorization: YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json"
// Using the Universal JavaScript Client:
// https://github.com/storyblok/storyblok-js-client
Storyblok.get('/spaces/606/components/', {})
.then(response => {
console.log(response)
}).catch(error => {
console.log(error)
})
$client = new \Storyblok\ManagementClient('YOUR_OAUTH_TOKEN');
$client->get('/spaces/606/components/')->getBody();
require 'storyblok'
client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')
client.false('/spaces/606/components/')
HttpResponse<String> response = Unirest.get("https://mapi.storyblok.com/v1/spaces/606/components/")
.header("Authorization", "YOUR_OAUTH_TOKEN")
.asString();
var client = new RestClient("https://mapi.storyblok.com/v1/spaces/606/components/");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "YOUR_OAUTH_TOKEN");
IRestResponse response = client.Execute(request);
import Foundation
let headers = [
"Content-Type": "application/json",
"Authorization": "YOUR_OAUTH_TOKEN"
]
let request = NSMutableURLRequest(url: NSURL(string: "https://mapi.storyblok.com/v1/spaces/606/components/")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0)
request.method = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
import requests
url = "https://mapi.storyblok.com/v1/spaces/606/components/"
querystring = {}
payload = ""
headers = {
'Content-Type': "application/json",
'Authorization': "YOUR_OAUTH_TOKEN"
}
response = requests.request("GET", url, data=payload, headers=headers, params=querystring)
print(response.text)
You will receive an array of component objects as a response.