Search Storyblok's Documentation
  1. Delete a Component

Delete a Component

Delete any component using its numeric id. Already used components will still stay in place but will show up with no schema definition so your inserted values won't be removed. You can use the update stories to migrate your content to other or new components.

https://mapi.storyblok.com/v1/spaces/:space_id/components/:component_id

Path Parameters

  • :space_id

    required number

    Numeric ID of a space

  • :component_id

    required number

    Numeric id of a component

Response Properties

  • component

    The Component Object

    component object.

    • id

      number

      The numeric ID

    • name

      string

      Technical name used for component property in entries

    • display_name

      string

      Name that will be used in the editor interface

    • created_at

      string

      Creation date (Format: yyyy-MM-dd'T'HH:mm:ssZ)

    • updated_at

      string

      Latest update date (Format: yyyy-MM-dd'T'HH:mm:ssZ)

    • schema

      object

      Key value pairs of component fields.

    • image

      string or null

      URL to the preview image, if uploaded

    • preview_field

      string

      The field that is for preview in the interface (Preview Field)

    • is_root

      boolean

      True if the component can be used as a Content Type

    • preview_tmpl

      string

      Your component preview template. You can learn how to design your preview template here.

    • is_nestable

      boolean

      True if the component is nestable (insertable) in block field types

    • all_presets

      object[]

      An array of presets for this component

      • id

        number

        The numeric ID of the preset

      • name

        string

        Name of the preset

      • component_id

        number

        The ID of the component the preset is for

      • image

        string or null

        Link to the preview image of the preset

      • icon

        string

        Icon selected for the preset

      • color

        string

        Color of the icon selected for the preset

      • description

        string

        The description of the preset

    • real_name

      string

      Duplicated technical name or display name, used for internal tasks

    • component_group_uuid

      string

      The component folder ID of the component

    • color

      string

      The color of the icon selected for the component

    • icon

      string

      Icon selected for the component

    • internal_tags_list

      object[]

      List of objects containing the details of tags used for the component

      • id

        number

        Id of the tag

      • name

        string

        Name of the tag

    • internal_tag_ids

      string[]

      List of ids of the tags assigned to the component

    • content_type_asset_preview

      string

      Asset preview field (Preview Card) for a content type component

Request
curl "https://mapi.storyblok.com/v1/spaces/606/components/4123" \ 
  -X DELETE \
  -H "Authorization: YOUR_OAUTH_TOKEN" \
  -d ""
Request
// Using the Universal JavaScript Client:
// https://github.com/storyblok/storyblok-js-client
Storyblok.delete('/spaces/606/components/4123')
  .then(response => {
    console.log(response)
  }).catch(error => { 
    console.log(error)
  })
Request
$client = new \Storyblok\ManagementClient('YOUR_OAUTH_TOKEN');

$client->delete('/spaces/606/components/4123')->getBody();
Request
require 'storyblok'
client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')

client.delete('/spaces/606/components/4123')
Request
HttpResponse<String> response = Unirest.delete("https://mapi.storyblok.com/v1/spaces/606/components/4123")
  .header("Content-Type", "application/json")
  .header("Authorization", "YOUR_OAUTH_TOKEN")
  .asString();
Request
var client = new RestClient("https://mapi.storyblok.com/v1/spaces/606/components/4123");
var request = new RestRequest(Method.DELETE);

request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "YOUR_OAUTH_TOKEN");
IRestResponse response = client.Execute(request);
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/4123")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0)
request.method = "DELETE"
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()
Request
import requests

url = "https://mapi.storyblok.com/v1/spaces/606/components/4123"

querystring = {}

payload = undefined
headers = {
  'Content-Type': "application/json",
  'Authorization': "YOUR_OAUTH_TOKEN"
}

response = requests.request("DELETE", url, data=payload, headers=headers, params=querystring)

print(response.text)