Delete Section
curl --request DELETE \
--url https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}.json \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}.json"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}.json', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}.json"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}.json")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyThemes
Delete Section
Remove a section from a template
DELETE
/
api
/
v1
/
themes
/
{theme_id}
/
sections
/
{section_id}
.json
Delete Section
curl --request DELETE \
--url https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}.json \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}.json"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}.json', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}.json"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}.json")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyRemoves a section (and its blocks) from a template. The section file stays
in the theme. Requires the
write_themes scope.
Request
curl -X DELETE "https://api.launchmystore.io/api/v1/themes/1f2e3d4c-5b6a-7980-a1b2-c3d4e5f60718/sections/rich-text.json?template=index" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Path Parameters
string
required
The theme id.
string
required
The section’s id in the template.
Query Parameters
string
required
The template the section is on. Templates are named as in the theme’s
templates/ folder: index,
product, product.alternate, customers/account (URL-encode the / in a
path segment), and section groups such as header-group. A path such as
templates/index.json is accepted too. Also accepted as
templateName or templatePath.Response
{
"status": 200,
"state": "success",
"message": "Section deleted successfully"
}
Error Codes
| Status | Description |
|---|---|
404 | Theme, template or section not found |
422 | template missing or an invalid template name |
401 | Invalid or missing access token |
403 | App doesn’t have the write_themes scope |